OGS
Region.cpp
Go to the documentation of this file.
1
10
#include "
Region.h
"
11
12
#include <iterator>
13
#include <sstream>
14
15
#include "
BaseLib/Logging.h
"
16
17
namespace
FileIO
18
{
19
namespace
Gocad
20
{
21
std::ostream&
operator<<
(std::ostream& os,
Region
const
& r)
22
{
23
return
os <<
"("
<< r.
name
<<
"|"
<< r.
bit
<<
")"
;
24
}
25
26
Region
parseRegion
(std::string
const
& line)
27
{
28
std::istringstream iss(line);
29
std::istream_iterator<std::string> it(iss);
30
// Check first word is REGION or MODEL_REGION.
31
if
(*it != std::string(
"REGION"
) && *it != std::string(
"MODEL_REGION"
))
32
{
33
ERR
(
"Expected REGION or MODEL_REGION keyword but '{:s}' found.\n"
,
34
it->c_str());
35
throw
std::runtime_error(
36
"In parseRegion() expected REGION or MODEL_REGION keyword not "
37
"found.\n"
);
38
}
39
++it;
40
41
Region
r;
42
r.
name
= *it;
43
++it;
44
r.
bit
= atoi(it->c_str());
45
46
return
r;
47
}
48
49
}
// end namespace Gocad
50
}
// end namespace FileIO
Logging.h
ERR
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition
Logging.h:45
Region.h
FileIO::Gocad::operator<<
std::ostream & operator<<(std::ostream &os, CoordinateSystem const &c)
Definition
CoordinateSystem.cpp:111
FileIO::Gocad::parseRegion
Region parseRegion(std::string const &line)
Definition
Region.cpp:26
FileIO
Definition
SHPImportDialog.h:19
FileIO::Gocad::Region
Definition
Region.h:20
FileIO::Gocad::Region::name
std::string name
Definition
Region.h:21
FileIO::Gocad::Region::bit
unsigned bit
Definition
Region.h:22
Applications
FileIO
GocadIO
Region.cpp
Generated by
1.11.0