OutputBuffer Class Reference

Output buffer for a block of data. More...

Public Member Functions

void Clear ()
 Prepare buffer for use.
int Add (const char *text, int length)
 Add text to the output buffer.
void Write (FILE *out_fp) const
 Dump buffer to the output stream.
bool HasRoom () const
 Does the block have room for more data?

Data Fields

int size
 Number of bytes stored in data.
char data [OUTPUT_BLOCK_SIZE]
 Stored data.

Detailed Description

Output buffer for a block of data.

Definition at line 52 of file settingsgen.cpp.


Member Function Documentation

int OutputBuffer::Add ( const char *  text,
int  length 
) [inline]

Add text to the output buffer.

Parameters:
text Text to store.
length Length of the text in bytes.
Returns:
Number of bytes actually stored.

Definition at line 66 of file settingsgen.cpp.

References data, MemCpyT(), min(), OUTPUT_BLOCK_SIZE, and size.

Referenced by OutputStore::Add().

void OutputBuffer::Clear (  )  [inline]

Prepare buffer for use.

Definition at line 55 of file settingsgen.cpp.

References size.

Referenced by OutputStore::Add().

bool OutputBuffer::HasRoom (  )  const [inline]

Does the block have room for more data?

Returns:
true if room is available, else false.

Definition at line 91 of file settingsgen.cpp.

References OUTPUT_BLOCK_SIZE, and size.

void OutputBuffer::Write ( FILE *  out_fp  )  const [inline]

Dump buffer to the output stream.

Parameters:
out_fp Stream to write the data to.

Definition at line 80 of file settingsgen.cpp.

References data, and size.


The documentation for this class was generated from the following file:

Generated on Fri May 27 04:21:03 2011 for OpenTTD by  doxygen 1.6.1