void BinStreamable::writeToBinFile(const char *filename, Format compression) const { switch(compression) { case BIN: { ofbinstream file(filename); if (!file.good()) { fthrow(Exception, "writeToBinFile(): could not open file."); } writeBin(file); file.close(); break; } #ifdef NICE_USELIB_ZLIB case BIN_GZ: { ogzbinstream file(filename); if (!file.good()) { fthrow(Exception, "writeToBinFile(): could not open file."); } writeBin(file); file.close(); break; } #endif default: fthrow(Exception, "File cannot be written! Compression method not supported."); break; } }
bool File::writeBin(const char *str){ return writeBin((edk::char8 *)str); }