OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions
Buffer Struct Reference

The buffer for writing a single string. More...

Inheritance diagram for Buffer:

## Public Member Functions
void | AppendByte (byte value)
| Convenience method for adding a byte.
void | AppendUtf8 (uint32 value)
| Add an Unicode character encoded in UTF-8 to the buffer.
Public Member Functions inherited from SmallVector< byte, 256 >
| SmallVector (const SmallVector &other)
| Copy constructor.
| SmallVector (const SmallVector< byte, X > &other)
| Generic copy constructor.
SmallVector & | operator= (const SmallVector &other)
| Assignment.
SmallVector & | operator= (const SmallVector< byte, X > &other)
| Generic assignment.
void | Assign (const SmallVector< byte, X > &other)
| Assign items from other vector.
void | Clear ()
| Remove all items from the list.
void | Reset ()
| Remove all items from the list and free allocated memory.
void | Compact ()
| Compact the list down to the smallest block size boundary.
byte * | Append (uint to_add=1)
| Append an item and return it.
void | Resize (uint num_items)
| Set the size of the vector, effectively truncating items from the end or appending uninitialised ones.
const byte * | Find (const byte &item) const
| Search for the first occurrence of an item.
byte * | Find (const byte &item)
| Search for the first occurrence of an item.
int | FindIndex (const byte &item) const
| Search for the first occurrence of an item.
bool | Contains (const byte &item) const
| Tests whether a item is present in the vector.
void | Erase (byte *item)
| Removes given item from this vector.
void | ErasePreservingOrder (uint pos, uint count=1)
| Remove items from the vector while preserving the order of other items.
bool | Include (const byte &item)
| Tests whether a item is present in the vector, and appends it to the end if not.
uint | Length () const
| Get the number of items in the list.
const byte * | Begin () const
| Get the pointer to the first item (const)
byte * | Begin ()
| Get the pointer to the first item.
const byte * | End () const
| Get the pointer behind the last valid item (const)
byte * | End ()
| Get the pointer behind the last valid item.
const byte * | Get (uint index) const
| Get the pointer to item "number" (const)
byte * | Get (uint index)
| Get the pointer to item "number".
const byte & | operator[] (uint index) const
| Get item "number" (const)
byte & | operator[] (uint index)
| Get item "number".

## Additional Inherited Members
Protected Attributes inherited from SmallVector< byte, 256 >
byte * | data
| The pointer to the first item.
uint | items
| The number of items stored.
uint | capacity
| The available space for storing items.

## Detailed Description

The buffer for writing a single string.

Definition at line 238 of file strgen_base.cpp.

## Member Function Documentation

void Buffer::AppendByte | ( | byte | value | ) |
| inline

Convenience method for adding a byte.

Parameters

  value | The value to add.

Definition at line 243 of file strgen_base.cpp.

References SmallVector< byte, 256 >::Append().

Referenced by LanguageWriter::WriteLang().

void Buffer::AppendUtf8 | ( | uint32 | value | ) |
| inline

Add an Unicode character encoded in UTF-8 to the buffer.

Parameters

  value | The character to add.

Definition at line 252 of file strgen_base.cpp.

References SmallVector< byte, 256 >::Append(), and GB().

Referenced by LanguageWriter::WriteLang().

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

- src/strgen/strgen_base.cpp