Increments the stream to after the next zero byte and returns the bytes in between (not a copy). If the first byte is zero, stream is incremented one.
| 175 | // Increments the stream to after the next zero byte and returns the bytes in between (not a copy). |
| 176 | // If the first byte is zero, stream is incremented one. |
| 177 | const char* getString() { |
| 178 | assert(data); |
| 179 | size_type start = pos; |
| 180 | bool isNullTerminator = false; |
| 181 | do { |
| 182 | check(1); |
| 183 | isNullTerminator = (data[pos] == '\0'); |
| 184 | pos++; |
| 185 | } while (!isNullTerminator); |
| 186 | return reinterpret_cast<const char*>(&data[start]); |
| 187 | } |
| 188 | |
| 189 | // special factory function to set up internal buffer with copy of passed data. |
| 190 | // only necessary to create 'fake' TiffEntries (see e.g. RAF) |