MCPcopy Create free account
hub / github.com/RenderKit/embree / ReadString

Function ReadString

tutorials/common/image/tinyexr.h:1119–1135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1117#endif
1118
1119static const char *ReadString(std::string *s, const char *ptr, size_t len) {
1120 // Read untile NULL(\0).
1121 const char *p = ptr;
1122 const char *q = ptr;
1123 while ((size_t(q - ptr) < len) && (*q) != 0) {
1124 q++;
1125 }
1126
1127 if (size_t(q - ptr) >= len) {
1128 (*s).clear();
1129 return NULL;
1130 }
1131
1132 (*s) = std::string(p, q);
1133
1134 return q + 1; // skip '\0'
1135}
1136
1137static bool ReadAttribute(std::string *name, std::string *type,
1138 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