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

Function extractName

pdal/DimUtil.hpp:253–262  ·  view source on GitHub ↗

Extract a dimension name of a string. Dimension names start with an alpha and continue with numbers or underscores. \param s String from which to extract dimension name. \param p Position at which to start extracting. \return Number of characters in the extracted name.

Source from the content-addressed store, hash-verified

251/// \param p Position at which to start extracting.
252/// \return Number of characters in the extracted name.
253inline std::size_t extractName(const std::string& s, std::string::size_type p)
254{
255 if (!std::isalpha(s[p++]))
256 return 0;
257 auto isvalid = [](int c)
258 {
259 return std::isalpha(c) || std::isdigit(c) || c == '_' || c == ' ';
260 };
261 return Utils::extract(s, p, isvalid) + 1;
262}
263
264inline std::string fixName(std::string name)
265{

Callers 6

parseQuotedHeaderMethod · 0.85
parseUnquotedHeaderMethod · 0.85
parseDimFunction · 0.85
subParseMethod · 0.85
nameValidFunction · 0.85
validateDimensionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected