| 193 | } |
| 194 | |
| 195 | void OrderedCode::WriteNumIncreasing(string* dest, uint64 val) { |
| 196 | // Values are encoded with a single byte length prefix, followed |
| 197 | // by the actual value in big-endian format with leading 0 bytes |
| 198 | // dropped. |
| 199 | unsigned char buf[9]; // 8 bytes for value plus one byte for length |
| 200 | int len = 0; |
| 201 | while (val > 0) { |
| 202 | len++; |
| 203 | buf[9 - len] = (val & 0xff); |
| 204 | val >>= 8; |
| 205 | } |
| 206 | buf[9 - len - 1] = len; |
| 207 | len++; |
| 208 | AppendBytes(dest, reinterpret_cast<const char*>(buf + 9 - len), len); |
| 209 | } |
| 210 | |
| 211 | // Parse the encoding of a previously encoded string. |
| 212 | // If parse succeeds, return true, consume encoding from |
nothing calls this directly
no test coverage detected