OpenTTD

Public Member Functions
LanguageFileWriter Struct Reference

Class for writing a language to disk. More...

Inheritance diagram for LanguageFileWriter:

## Public Member Functions
| LanguageFileWriter (const char *filename)
| Open a file to write to. More...
void | WriteHeader (const LanguagePackHeader *header)
| Write the header metadata. More...
void | Finalise ()
| Finalise writing the file.
void | Write (const byte *buffer, size_t length)
| Write a number of bytes. More...
Public Member Functions inherited from LanguageWriter
virtual | ~LanguageWriter ()
| Especially destroy the subclasses. More...
virtual void | WriteLength (uint length)
| Write the length as a simple gamma. More...
virtual void | WriteLang (const StringData &data)
| Actually write the language. More...
Public Member Functions inherited from FileWriter
| FileWriter (FILE *file)
| Create the file writer, so it writes to a specific file. More...
| ~FileWriter ()
| Make sure everything is cleaned up. More...
void | Write (byte *buf, size_t size)
| Write a given number of bytes into the savegame. More...
void | Finish ()
| Prepare everything to finish writing the savegame.
| FileWriter (const char *filename)
| Open a file to write to. More...
void | Finalise ()
| Finalise the writing. More...
virtual | ~FileWriter ()
| Make sure the file is closed. More...
Public Member Functions inherited from SaveFilter
| SaveFilter (SaveFilter *chain)
| Initialise this filter. More...
virtual | ~SaveFilter ()
| Make sure the writers are properly closed. More...

## Additional Inherited Members
Data Fields inherited from FileWriter
FILE * | file
| The file to write to.
FILE * | fh
| The file handle we're writing to.
const char * | filename
| The file name we're writing to.
Data Fields inherited from SaveFilter
SaveFilter * | chain
| Chained to the (savegame) filters. More...

## Detailed Description

Class for writing a language to disk.

Definition at line 342 of file strgen.cpp.

## Constructor & Destructor Documentation

## ◆ LanguageFileWriter()

LanguageFileWriter::LanguageFileWriter | ( | const char * | filename | ) |
| inline

Open a file to write to.

Parameters

  filename | The file to open.

Definition at line 347 of file strgen.cpp.

## Member Function Documentation

## ◆ Write()

void LanguageFileWriter::Write | ( | const byte * | buffer,
|  | size_t | length
| ) |  |
| inline virtual

Write a number of bytes.

Parameters

  buffer | The buffer to write.
  length | The amount of byte to write.

Implements LanguageWriter.

Definition at line 364 of file strgen.cpp.

References FileStringReader::fh.

## ◆ WriteHeader()

void LanguageFileWriter::WriteHeader | ( | const LanguagePackHeader * | header | ) |
| inline virtual

Write the header metadata.

The multi-byte integers are already converted to the little endian format.

Parameters

  header | The header to write.

Implements LanguageWriter.

Definition at line 351 of file strgen.cpp.

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

- src/strgen/strgen.cpp