CoreIOWriter Class Reference

The core output class. More...

#include <core_io_writer.h>

Inheritance diagram for CoreIOWriter:

Console FileWriter

List of all members.

Public Member Functions

 CoreIOWriter (FILE *_outputBuffer, bool _isUnicode, LineEndingType _lnEnding=CC_LN_NATIVE)
 The constructor.
virtual ~CoreIOWriter ()
 The destructor.
virtual bool IsOpen ()
 Validates that the file buffer isn't NULL.
virtual CrissCross::Errors SetLineEndings (LineEndingType _ending)
 Sets the line ending convention used by this CoreIOWriter instance.
virtual CrissCross::Errors Write (const char *_format,...)
 Writes a string to the buffer.
virtual CrissCross::Errors Write (std::string &_string)
 Writes a string to the buffer.
virtual CrissCross::Errors WriteLine ()
 Writes an empty line to the buffer.
virtual CrissCross::Errors WriteLine (const char *_format,...)
 Writes a string to the buffer with a newline appended.
virtual CrissCross::Errors WriteLine (std::string &_string)
 Writes a string to the buffer with a newline appended.
void Flush ()
 Flushes the output buffer.

Protected Attributes

char m_lineEnding [4]
 Line ending buffer.
FILE * m_fileOutputPointer
 Input/output FILE pointer.
bool m_unicode
 Indicates whether the buffer is to be written in unicode or not. (UNIMPLEMENTED).
CrissCross::System::Mutex m_ioMutex
 Thread-safe mutex.


Detailed Description

The core output class.

A class inherited by most I/O classes, including Console and FileWriter.


Constructor & Destructor Documentation

CoreIOWriter ( FILE *  _outputBuffer,
bool  _isUnicode,
LineEndingType  _lnEnding = CC_LN_NATIVE 
)

The constructor.

Creates a new CoreIOWriter instance. Will initialize line endings to the platform's default, also initializes CoreIOWriter::m_ioMutex.

Parameters:
_outputBuffer The buffer to be used for write operations.
_isUnicode The buffer is going to be a Unicode I/O buffer. (UNIMPLEMENTED)
_lnEnding The line ending to use.


Member Function Documentation

virtual bool IsOpen (  )  [virtual]

Validates that the file buffer isn't NULL.

Returns:
Boolean indicating whether the file is safe to write to.

virtual CrissCross::Errors SetLineEndings ( LineEndingType  _ending  )  [virtual]

Sets the line ending convention used by this CoreIOWriter instance.

Parameters:
_ending Any of the LineEndingType values.

virtual CrissCross::Errors Write ( std::string &  _string  )  [virtual]

Writes a string to the buffer.

Parameters:
_string The string to be written.

virtual CrissCross::Errors Write ( const char *  _format,
  ... 
) [virtual]

Writes a string to the buffer.

Parameters:
_format The format of the string to be written.

virtual CrissCross::Errors WriteLine ( std::string &  _string  )  [virtual]

Writes a string to the buffer with a newline appended.

Prints the string to the buffer, and then prints the line terminator in the format specified by CoreIOWriter::m_lineEnding.

Parameters:
_string The std::string to write.
Returns:
Standard CrissCross::Errors values.

virtual CrissCross::Errors WriteLine ( const char *  _format,
  ... 
) [virtual]

Writes a string to the buffer with a newline appended.

Prints the string to the buffer, and then prints the line terminator in the format specified by CoreIOWriter::m_lineEnding.

Parameters:
_format The format of the string to be written.
Returns:
Standard CrissCross::Errors values.

virtual CrissCross::Errors WriteLine (  )  [virtual]

Writes an empty line to the buffer.

Writes CoreIOWriter::m_lineEnding to the buffer.


Member Data Documentation

Thread-safe mutex.

Prevents more than one read or write from occurring simultaneously.

char m_lineEnding[4] [protected]

Line ending buffer.

Stores the line ending selected by SetLineEndings.


Generated on Sun Feb 8 11:10:00 2009 for CrissCross by  doxygen 1.5.8