MCPcopy Create free account
hub / github.com/PDAL/PDAL / parse

Method parse

filters/AssignFilter.cpp:68–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66};
67
68void AssignRange::parse(const std::string& r)
69{
70 std::string::size_type pos, count;
71
72 pos = subParse(r);
73 count = Utils::extractSpaces(r, pos);
74 pos += count;
75
76 if (r[pos] != '=')
77 throw error("Missing '=' assignment separator.");
78 pos++;
79
80 count = Utils::extractSpaces(r, pos);
81 pos += count;
82
83 // Extract value.
84 Utils::StringStreamClassicLocale ss(r.data() + pos);
85 auto start = ss.tellg();
86 ss >> m_value;
87 if (ss.fail())
88 throw error("Missing value to assign following '='.");
89 else if (ss.eof())
90 pos = r.size();
91 else {
92 pos += (ss.tellg() - start);
93 count = Utils::extractSpaces(r, pos);
94 pos += count;
95 }
96
97 if (pos != r.size())
98 throw error("Invalid characters following valid range.");
99}
100
101
102std::istream& operator>>(std::istream& in, AssignRange& r)

Callers 3

initializeDomainMethod · 0.45
initializeMethod · 0.45
AssignFilter.cppFile · 0.45

Calls 4

errorClass · 0.50
dataMethod · 0.45
eofMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected