OpenTTD

Public Member Functions | Data Fields
HeaderFileWriter Struct Reference
Inheritance diagram for HeaderFileWriter:

## Public Member Functions
| HeaderFileWriter (const char *filename)
| Open a file to write to. More...
| ~HeaderFileWriter ()
| Free the filename. More...
void | WriteStringID (const char *name, int stringid)
| Write the string ID. More...
void | Finalise (const StringData &data)
| Finalise writing the file. More...
Public Member Functions inherited from HeaderWriter
virtual | ~HeaderWriter ()
| Especially destroy the subclasses. More...
void | WriteHeader (const StringData &data)
| Write the header information. 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...

## Data Fields
const char * | real_filename
| The real file name we eventually want to write to. More...
int | prev
| The previous string ID that was printed. More...
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

Definition at line 277 of file strgen.cpp.

## Constructor & Destructor Documentation

## ◆ HeaderFileWriter()

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

Open a file to write to.

Parameters

  filename | The file to open.

Definition at line 287 of file strgen.cpp.

References FileStringReader::fh.

## ◆ ~HeaderFileWriter()

HeaderFileWriter::~HeaderFileWriter | ( |  | ) |
| inline

Free the filename.

Definition at line 296 of file strgen.cpp.

References free().

## Member Function Documentation

## ◆ Finalise()

void HeaderFileWriter::Finalise | ( | const StringData & | data | ) |
| inline virtual

Finalise writing the file.

Parameters

  data | The data about the string.

Implements HeaderWriter.

Definition at line 308 of file strgen.cpp.

References _plural_forms, FileStringReader::fh, lengthof, max(), and StringData::Version().

## ◆ WriteStringID()

void HeaderFileWriter::WriteStringID | ( | const char * | name,
|  | int | stringid
| ) |  |
| inline virtual

Write the string ID.

Parameters

  name | The name of the string.
  stringid | The ID of the string.

Implements HeaderWriter.

Definition at line 301 of file strgen.cpp.

References FileStringReader::fh.

## Field Documentation

## ◆ prev

int HeaderFileWriter::prev

The previous string ID that was printed.

Definition at line 281 of file strgen.cpp.

## ◆ real_filename

const char* HeaderFileWriter::real_filename

The real file name we eventually want to write to.

Definition at line 279 of file strgen.cpp.

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

- src/strgen/strgen.cpp