| 129 | } |
| 130 | |
| 131 | void ByteStream::saveToFile( const std::string& filename ) |
| 132 | { |
| 133 | if (bufferSize() == 0) |
| 134 | return; |
| 135 | |
| 136 | std::ofstream file(filename.c_str(), std::ios::out | std::ios::binary | std::ios::trunc); |
| 137 | |
| 138 | if (file) |
| 139 | { |
| 140 | file.write((char*)&_buffer[0], _buffer.size() * sizeof(_buffer[0])); |
| 141 | file.close(); |
| 142 | } |
| 143 | else |
| 144 | SIBR_LOG << "ERROR: cannot write to the file '" << filename << "'" << std::endl; |
| 145 | } |
| 146 | |
| 147 | void ByteStream::push(const void* data, uint size) |
| 148 | { |
no test coverage detected