MCPcopy Create free account
hub / github.com/assimp/assimp / AcGetString

Function AcGetString

code/AssetLib/AC/ACLoader.cpp:91–112  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------ read a string (may be enclosed in double quotation marks). buffer must point to "

Source from the content-addressed store, hash-verified

89// ------------------------------------------------------------------------------------------------
90// read a string (may be enclosed in double quotation marks). buffer must point to "
91inline const char *AcGetString(const char *buffer, const char *end, std::string &out) {
92 if (*buffer == '\0') {
93 throw DeadlyImportError("AC3D: Unexpected EOF in string");
94 }
95 ++buffer;
96 const char *sz = buffer;
97 while ('\"' != *buffer && buffer != end) {
98 if (IsLineEnd(*buffer)) {
99 ASSIMP_LOG_ERROR("AC3D: Unexpected EOF/EOL in string");
100 out = "ERROR";
101 break;
102 }
103 ++buffer;
104 }
105 if (IsLineEnd(*buffer)) {
106 return buffer;
107 }
108 out = std::string(sz, (unsigned int)(buffer - sz));
109 ++buffer;
110
111 return buffer;
112}
113
114// ------------------------------------------------------------------------------------------------
115// read 1 to n floats prefixed with an optional predefined identifier

Callers 2

LoadObjectSectionMethod · 0.85
InternReadFileMethod · 0.85

Calls 2

DeadlyImportErrorFunction · 0.85
IsLineEndFunction · 0.85

Tested by

no test coverage detected