#include <FileWriter.h>


Public Member Functions | |
| FileWriter (const FileName &) | |
| virtual | ~FileWriter () |
| virtual void | close () |
| virtual String | getClassName () const |
| virtual String | toString () const |
Protected Member Functions | |
| void | open () |
| bool | isClosed () const |
| bool | isOpen () const |
| void | writeUInt4 (unsigned long value) |
| void | writeDouble (double value) |
| void | writeFloat (float value) |
| void | writeShort (short value) |
| void | writeChar (char value) |
| void | writeString (const String &string) |
| void | writeAttribute (const String &name, const String &value) |
| void | writeAttribute (const String &name, unsigned long value) |
| void | writeAttribute (const String &name, double value) |
| void | swap2Bytes (void *src, void *dest) |
| void | swap4Bytes (void *src, void *dest) |
| void | swap8Bytes (void *src, void *dest) |
Protected Attributes | |
| FILE * | _pFileStruct |
| FileName | _fileName |
| bool | _swap |
Private Member Functions | |
| FileWriter (const FileWriter &) | |
| const FileWriter & | operator= (const FileWriter &) |
| bool | operator== (const FileWriter &) const |
| bool | operator!= (const FileWriter &) const |
Convenient class used to write data to a file
Definition at line 81 of file FileWriter.h.
| FileWriter::FileWriter | ( | const FileName & | f ) | [explicit] |
Definition at line 68 of file FileWriter.cpp.
| FileWriter::~FileWriter | ( | ) | [virtual] |
Definition at line 220 of file FileWriter.cpp.
References close().
| alize::FileWriter::FileWriter | ( | const FileWriter & | ) | [private] |
| void FileWriter::close | ( | ) | [virtual] |
Closes the file
| IOException | if an I/O error occurs |
Reimplemented in alize::FeatureFileWriter.
Definition at line 87 of file FileWriter.cpp.
References _fileName, _pFileStruct, isOpen(), and NULL.
Referenced by alize::FeatureFileWriter::close(), open(), alize::ConfigFileWriter::writeConfig(), and ~FileWriter().
| String FileWriter::getClassName | ( | ) | const [virtual] |
Returns the name of the class
Implements alize::Object.
Reimplemented in alize::ConfigFileWriter, alize::FeatureFileWriter, alize::MixtureFileWriter, alize::MixtureServerFileWriter, and alize::SegServerFileWriter.
Definition at line 218 of file FileWriter.cpp.
| bool FileWriter::isClosed | ( | ) | const [protected] |
Tests whether the file is closed
Definition at line 71 of file FileWriter.cpp.
References _pFileStruct, and NULL.
| bool FileWriter::isOpen | ( | ) | const [protected] |
Tests whether the file is opened
Definition at line 73 of file FileWriter.cpp.
References _pFileStruct, and NULL.
| void FileWriter::open | ( | ) | [protected] |
| IOException | if an I/O error occurs |
Definition at line 75 of file FileWriter.cpp.
References _fileName, _pFileStruct, alize::String::c_str(), close(), alize::String::isEmpty(), isOpen(), and NULL.
Referenced by alize::ConfigFileWriter::writeConfig().
| bool alize::FileWriter::operator!= | ( | const FileWriter & | ) | const [private] |
Not implemented
| const FileWriter& alize::FileWriter::operator= | ( | const FileWriter & | ) | [private] |
Not implemented
| bool alize::FileWriter::operator== | ( | const FileWriter & | ) | const [private] |
Not implemented
| void FileWriter::swap2Bytes | ( | void * | src, |
| void * | dest | ||
| ) | [protected] |
Definition at line 175 of file FileWriter.cpp.
| void FileWriter::swap4Bytes | ( | void * | src, |
| void * | dest | ||
| ) | [protected] |
Definition at line 187 of file FileWriter.cpp.
| void FileWriter::swap8Bytes | ( | void * | src, |
| void * | dest | ||
| ) | [protected] |
Definition at line 202 of file FileWriter.cpp.
| String FileWriter::toString | ( | ) | const [virtual] |
This method is frequently overridden in the derived classes. If it is not, it returns the name of the class of the object and the address of the object
Reimplemented from alize::Object.
Definition at line 169 of file FileWriter.cpp.
References _fileName.
| void FileWriter::writeAttribute | ( | const String & | name, |
| double | value | ||
| ) | [protected] |
Definition at line 166 of file FileWriter.cpp.
References alize::String::valueOf(), and writeString().
| IOException | if an I/O error occurs |
Definition at line 157 of file FileWriter.cpp.
References writeString().
Referenced by alize::ConfigFileWriter::writeConfig().
| void FileWriter::writeAttribute | ( | const String & | name, |
| unsigned long | value | ||
| ) | [protected] |
Definition at line 163 of file FileWriter.cpp.
References alize::String::valueOf(), and writeString().
| void FileWriter::writeChar | ( | char | value ) | [protected] |
| IOException | if an I/O error occurs |
Definition at line 139 of file FileWriter.cpp.
References _fileName, _pFileStruct, and NULL.
| void FileWriter::writeDouble | ( | double | value ) | [protected] |
| IOException | if an I/O error occurs |
Definition at line 115 of file FileWriter.cpp.
References _fileName, _pFileStruct, and NULL.
| void FileWriter::writeFloat | ( | float | value ) | [protected] |
| IOException | if an I/O error occurs |
Definition at line 123 of file FileWriter.cpp.
References _fileName, _pFileStruct, and NULL.
| void FileWriter::writeShort | ( | short | value ) | [protected] |
| IOException | if an I/O error occurs |
Definition at line 131 of file FileWriter.cpp.
References _fileName, _pFileStruct, and NULL.
| void FileWriter::writeString | ( | const String & | string ) | [protected] |
| IOException | if an I/O error occurs |
Definition at line 147 of file FileWriter.cpp.
References _fileName, _pFileStruct, and NULL.
Referenced by writeAttribute(), and alize::ConfigFileWriter::writeConfig().
| void FileWriter::writeUInt4 | ( | unsigned long | value ) | [protected] |
| IOException | if an I/O error occurs |
Definition at line 96 of file FileWriter.cpp.
References _fileName, _pFileStruct, and NULL.
FileName alize::FileWriter::_fileName [protected] |
Definition at line 101 of file FileWriter.h.
Referenced by close(), open(), toString(), writeChar(), alize::ConfigFileWriter::writeConfig(), writeDouble(), writeFloat(), writeShort(), writeString(), and writeUInt4().
FILE* alize::FileWriter::_pFileStruct [protected] |
Definition at line 100 of file FileWriter.h.
Referenced by close(), isClosed(), isOpen(), open(), writeChar(), writeDouble(), writeFloat(), writeShort(), writeString(), and writeUInt4().
bool alize::FileWriter::_swap [protected] |
Definition at line 102 of file FileWriter.h.
1.7.2