HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Writing Files

The FS_Writer class should be used to write files. It takes a file name in its constructor, and provides a C++ stream for writing the specified file. The difference between using FS_Writer and an ofstream directly is that FS_Writer supports an extensible architecture (see overview). Unlike with FS_Reader, there are no default FS_Writer implementations other than for accessing disk files. However it is possible to write your own extensions.

Most of the functions of this class are for internal use only. Only the functions listed below should be used in your code.


FS_Writer::FS_Writer(const char *filename)

-Use this constructor to create a new writer. The specified file is created immediately.


std::ostream *FS_Writer::getStream() const
  • This function retrieves the C++ stream object which you can interact with in the normal ways. If this function returns NULL, the file specified in the constructor could not be created.


  • Closes the stream. After calling this function, the getStream() function will always return NULL.