OpenTTD
Public Member Functions
Buffer Struct Reference

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

Inheritance diagram for Buffer:
SmallVector< byte, 256 >

Public Member Functions

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

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

◆ AppendByte()

void Buffer::AppendByte ( byte  value)
inline

Convenience method for adding a byte.

Parameters
valueThe value to add.

Definition at line 243 of file strgen_base.cpp.

◆ AppendUtf8()

void Buffer::AppendUtf8 ( uint32  value)
inline

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

Parameters
valueThe character to add.

Definition at line 252 of file strgen_base.cpp.

References GB().


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