Vidalia  0.3.1
Functions
po2nsh.cpp File Reference
#include <QHash>
#include <QFile>
#include <QTextStream>
#include <QTextCodec>
#include <stdlib.h>

Go to the source code of this file.

Functions

QString parse_message_context (const QString &str)
 
QString parse_message_context_lame (const QString &str)
 
QString parse_message_string (const QString &msg)
 
QString read_next_line (QTextStream *stream)
 
void skip_po_header (QTextStream *po)
 
int po2nsh (QTextStream *po, QString *nsh, const QString &language, QString *errorMessage)
 
void print_usage_and_exit ()
 
int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 180 of file po2nsh.cpp.

References tc::DebugMessage::arg(), tc::error(), i(), po2nsh(), and print_usage_and_exit().

◆ parse_message_context()

QString parse_message_context ( const QString &  str)

Parse the context name from str, where the context name is of the form DQUOTE ContextName DQUOTE.

Definition at line 21 of file po2nsh.cpp.

Referenced by po2nsh().

◆ parse_message_context_lame()

QString parse_message_context_lame ( const QString &  str)

Parse the context name from str, where str is of the form ContextName::Number. This is the format used by translate-toolkit.

Definition at line 31 of file po2nsh.cpp.

Referenced by po2nsh().

◆ parse_message_string()

QString parse_message_string ( const QString &  msg)

Parse the PO-formatted message string from msg. If msg is a multiline string, the extra double quotes will be replaced with newlines appropriately.

Definition at line 42 of file po2nsh.cpp.

Referenced by po2nsh().

◆ po2nsh()

int po2nsh ( QTextStream *  po,
QString *  nsh,
const QString &  language,
QString *  errorMessage 
)

Convert po from the PO format to a NSIS-formatted .nsh document. nsh will be set to the resulting .nsh document. Return the number of converted strings on success, or -1 on error and errorMessage will be set.

Definition at line 85 of file po2nsh.cpp.

References parse_message_context(), parse_message_context_lame(), parse_message_string(), read_next_line(), and skip_po_header().

Referenced by main().

◆ print_usage_and_exit()

void print_usage_and_exit ( )

Display application usage and exit.

Definition at line 164 of file po2nsh.cpp.

References tc::error().

Referenced by main().

◆ read_next_line()

QString read_next_line ( QTextStream *  stream)

Read and return the next non-empty line from stream.

Definition at line 59 of file po2nsh.cpp.

Referenced by po2nsh().

◆ skip_po_header()

void skip_po_header ( QTextStream *  po)

Skip past the header portion of the PO file and any leading whitespace. The next line read from po will be the first non-header line in the document.

Definition at line 69 of file po2nsh.cpp.

Referenced by po2nsh().