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

Function fixName

pdal/DimUtil.hpp:264–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264inline std::string fixName(std::string name)
265{
266
267 char replaceChar = '_';
268
269 auto isvalid = [replaceChar](int c)
270 {
271 return std::isalpha(c) || std::isdigit(c) || c == replaceChar || c == ' ';
272 };
273
274 // if first character isn't an alpha, we
275 // are going to replace it with _
276 if (!std::isalpha(name[0]))
277 name[0] = replaceChar;
278
279 for (std::size_t i = 0; i < name.size(); ++i)
280 {
281 if (!isvalid(name[i])) name[i] = replaceChar;
282 }
283 return name;
284}
285
286inline bool nameValid(std::string name)
287{

Callers 5

readDimensionsMethod · 0.85
addDimensionsMethod · 0.85
addDimensionsMethod · 0.85
initializeMethod · 0.85
TESTFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by 1

TESTFunction · 0.68