OpenTTD Source: HeaderFileWriter Struct Reference

OpenTTD Source 12.2

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.
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.
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.
void | Write (byte *buf, size_t size) override
| Write a given number of bytes into the savegame. More...
void | Finish () override
| Prepare everything to finish writing the savegame.
| FileWriter (const char *filename)
| Open a file to write to. More...
void | Finalise ()
| Finalise the writing.
virtual | ~FileWriter ()
| Make sure the file is closed.
Public Member Functions inherited from SaveFilter
| SaveFilter (SaveFilter *chain)
| Initialise this filter. More...
virtual | ~SaveFilter ()
| Make sure the writers are properly closed.

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

## Detailed Description

Definition at line 275 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 286 of file strgen.cpp.

References FileWriter::fh.

## Member Function Documentation

## ◆ Finalise()

void HeaderFileWriter::Finalise | ( | const StringData & | data | ) |
| inlinevirtual

Finalise writing the file.

Parameters

  data | The data about the string.

Implements HeaderWriter.

Definition at line 308 of file strgen.cpp.

References _plural_forms, CompareFiles(), FileWriter::fh, FileWriter::filename, FileWriter::Finalise(), lengthof, and StringData::Version().

## ◆ WriteStringID()

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

Write the string ID.

Parameters

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

Implements HeaderWriter.

Definition at line 300 of file strgen.cpp.

References FileWriter::fh, and prev.

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

- src/strgen/strgen.cpp