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

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

Definition at line 180 of file po2nsh.cpp.

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

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.

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.

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.

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().

void print_usage_and_exit (  ) 

Display application usage and exit.

Definition at line 164 of file po2nsh.cpp.

References tc::error().

QString read_next_line ( QTextStream *  stream  ) 

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

Definition at line 59 of file po2nsh.cpp.

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(), po2ts(), and po2wxl().


Generated on Mon Aug 30 19:10:00 2010 for Vidalia by  doxygen 1.5.9