MCPcopy Create free account
hub / github.com/OpenPathGuidingLibrary/openpgl / ReadString

Function ReadString

third-party/tinyexr/tinyexr.h:1045–1061  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1043#endif
1044
1045static const char *ReadString(std::string *s, const char *ptr, size_t len) {
1046 // Read untile NULL(\0).
1047 const char *p = ptr;
1048 const char *q = ptr;
1049 while ((size_t(q - ptr) < len) && (*q) != 0) {
1050 q++;
1051 }
1052
1053 if (size_t(q - ptr) >= len) {
1054 (*s).clear();
1055 return NULL;
1056 }
1057
1058 (*s) = std::string(p, q);
1059
1060 return q + 1; // skip '\0'
1061}
1062
1063static bool ReadAttribute(std::string *name, std::string *type,
1064 std::vector<unsigned char> *data, size_t *marker_size,

Callers 1

ReadChannelInfoFunction · 0.85

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected