LibreOffice Module onlineupdate (master) 1
|
#include <limits.h>
#include <string.h>
#include <stdio.h>
#include "readstrings.h"
#include "errors.h"
Go to the source code of this file.
Classes | |
class | AutoFILE |
class | AutoCharArray |
Macros | |
#define | NS_tfopen fopen |
#define | OPEN_MODE "r" |
Functions | |
static const char * | NS_strspnp (const char *delims, const char *str) |
static char * | NS_strtok (const char *delims, char **str) |
static int | find_key (const char *keyList, char *key) |
Find a key in a keyList containing zero-delimited keys ending with "\0\0". More... | |
int | ReadStrings (const NS_tchar *path, const char *keyList, unsigned int numStrings, char results[][MAX_TEXT_LEN], const char *section) |
A very basic parser for updater.ini taken mostly from nsINIParser.cpp that can be used by standalone apps. More... | |
int | ReadStrings (const NS_tchar *path, StringTable *results) |
This function reads in localized strings from updater.ini. More... | |
Variables | |
static const char | kNL [] = "\r\n" |
static const char | kEquals [] = "=" |
static const char | kWhitespace [] = " \t" |
static const char | kRBracket [] = "]" |
#define NS_tfopen fopen |
Definition at line 17 of file readstrings.cxx.
#define OPEN_MODE "r" |
Definition at line 18 of file readstrings.cxx.
|
static |
Find a key in a keyList containing zero-delimited keys ending with "\0\0".
Returns a zero-based index of the key in the list, or -1 if the key is not found.
Definition at line 121 of file readstrings.cxx.
Referenced by ReadStrings().
|
static |
Definition at line 63 of file readstrings.cxx.
References d.
Referenced by NS_strtok(), and ReadStrings().
|
static |
Definition at line 83 of file readstrings.cxx.
References d, i, and NS_strspnp().
Referenced by ReadStrings().
int ReadStrings | ( | const NS_tchar * | path, |
const char * | keyList, | ||
unsigned int | numStrings, | ||
char | results[][MAX_TEXT_LEN], | ||
const char * | section | ||
) |
A very basic parser for updater.ini taken mostly from nsINIParser.cpp that can be used by standalone apps.
This function reads in localized strings corresponding to the keys from a given .ini.
path | Path to the .ini file to read |
keyList | List of zero-delimited keys ending with two zero characters |
numStrings | Number of strings to read into results buffer - must be equal to the number of keys |
results | Two-dimensional array of strings to be filled in the same order as the keys provided |
section | Optional name of the section to read; defaults to "Strings" |
Definition at line 152 of file readstrings.cxx.
References find_key(), kEquals, kNL, kRBracket, kWhitespace, MAX_TEXT_LEN, NS_strspnp(), NS_strtok(), NS_tfopen, OK, OPEN_MODE, PARSE_ERROR, READ_ERROR, READ_STRINGS_MEM_ERROR, and section.
Referenced by LaunchMacPostProcess(), ReadMaintenanceServiceStrings(), ReadStrings(), and ShowProgressUI().
int ReadStrings | ( | const NS_tchar * | path, |
StringTable * | results | ||
) |
This function reads in localized strings from updater.ini.
Definition at line 253 of file readstrings.cxx.
References StringTable::info, MAX_TEXT_LEN, ReadStrings(), result, and StringTable::title.
|
static |
Definition at line 58 of file readstrings.cxx.
Referenced by ReadStrings().
|
static |
Definition at line 57 of file readstrings.cxx.
Referenced by ReadStrings().
|
static |
Definition at line 60 of file readstrings.cxx.
Referenced by ReadStrings().
|
static |
Definition at line 59 of file readstrings.cxx.
Referenced by ReadStrings().