The default FileWriter writes the vector of char to the filename file, returning false on error.
| 377 | // The default FileWriter writes the vector of char to the filename file, |
| 378 | // returning false on error. |
| 379 | inline bool SaveDataToFile(const GenericVector<char>& data, |
| 380 | const STRING& filename) { |
| 381 | FILE* fp = fopen(filename.string(), "wb"); |
| 382 | if (fp == NULL) return false; |
| 383 | bool result = |
| 384 | static_cast<int>(fwrite(&data[0], 1, data.size(), fp)) == data.size(); |
| 385 | fclose(fp); |
| 386 | return result; |
| 387 | } |
| 388 | |
| 389 | template <typename T> |
| 390 | bool cmp_eq(T const & t1, T const & t2) { |
no test coverage detected