OpenTTD

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

- File List
- Globals

Data Structures | Macros | Functions | Variables
strgen.cpp File Reference

Tool to create computer readable (stand-alone) translation files. More...

`#include "../stdafx.h"`
`#include "../core/endian_func.hpp"`
`#include "../string_func.h"`
`#include "../strings_type.h"`
`#include "../misc/getoptdata.h"`
`#include "../table/control_codes.h"`
`#include "strgen.h"`
`#include <stdarg.h>`
`#include <exception>`
`#include <unistd.h>`
`#include <sys/stat.h>`
`#include "../table/strgen_tables.h"`
`#include "../safeguards.h"`

Go to the source code of this file.

## Data Structures
struct | FileStringReader
| A reader that simply reads using fopen. More...
struct | FileWriter
| Yes, simply writing to a file. More...
struct | HeaderFileWriter
struct | LanguageFileWriter
| Class for writing a language to disk. More...

## Macros
#define | LINE_NUM_FMT(s) "%s:%d: " s ": %s\n"

## Functions
void CDECL | strgen_warning (const char *s,...)
void CDECL | strgen_error (const char *s,...)
void NORETURN CDECL | strgen_fatal (const char *s,...)
void NORETURN CDECL | error (const char *s,...)
bool | CompareFiles (const char *n1, const char *n2)
static void | ottd_mkdir (const char *directory)
| Multi-OS mkdirectory function.
static char * | mkpath (char *buf, const char *last, const char *path, const char *file)
| Create a path consisting of an already existing path, a possible path separator and the filename.
static char * | replace_pathsep (char *s)
int CDECL | main (int argc, char *argv[])

## Variables
static const OptionData | _opts []
| Options of strgen.

## Detailed Description

Tool to create computer readable (stand-alone) translation files.

Definition in file strgen.cpp.

## Function Documentation

static char* mkpath | ( | char * | buf,
|  | const char * | last,
|  | const char * | path,
|  | const char * | file
| ) |  |
| inline static

Create a path consisting of an already existing path, a possible path separator and the filename.

The separator is only appended if the path does not already end with a separator

Definition at line 389 of file strgen.cpp.

References strecpy().

## Variable Documentation

const OptionData _opts[]
| static

Initial value:
{
GETOPT_NOVAL( 'v', "--version"),
GETOPT_GENERAL('C', '\0', "-export-commands", ODF_NO_VALUE),
GETOPT_GENERAL('L', '\0', "-export-plurals", ODF_NO_VALUE),
GETOPT_GENERAL('P', '\0', "-export-pragmas", ODF_NO_VALUE),
GETOPT_NOVAL( 't', "--todo"),
GETOPT_NOVAL( 'w', "--warning"),
GETOPT_NOVAL( 'h', "--help"),
GETOPT_GENERAL('h', '?', NULL, ODF_NO_VALUE),
GETOPT_VALUE( 's', "--source_dir"),
GETOPT_VALUE( 'd', "--dest_dir"),
GETOPT_END(),
}

Options of strgen.

Definition at line 415 of file strgen.cpp.