| 248 | |
| 249 | |
| 250 | bool Writer::writeOutputToFile(FILE *f) { |
| 251 | assert_precondition(!_outputFile); |
| 252 | bool result = true; |
| 253 | forEachChunk([&](slice chunk) { |
| 254 | if (result && fwrite(chunk.buf, chunk.size, 1, f) < chunk.size) |
| 255 | result = false; |
| 256 | }); |
| 257 | if (result) { |
| 258 | auto len = length(); |
| 259 | _reset(); // don't reset _length, so offsets remain consistent after |
| 260 | _length = len - _available.size; |
| 261 | } |
| 262 | return result; |
| 263 | } |
| 264 | |
| 265 | |
| 266 | #pragma mark - BASE64: |
nothing calls this directly
no outgoing calls
no test coverage detected