src/tools/tLocale.cpp File Reference

#include "tMemManager.h"
#include "tLocale.h"
#include "tConsole.h"
#include "tDirectories.h"
#include "tSafePTR.h"
#include <fstream>
#include <string>
#include <map>

Include dependency graph for tLocale.cpp:

Go to the source code of this file.

Classes

class  tLocaleItem
class  tLocaleSubItem
class  tOutputItemLocale
class  tOutputItemSpace
class  tOutputItemTemplate

Typedefs

typedef std::map< std::string,
tJUST_CONTROLLED_PTR
< tLocaleItem > > 
tLocaleItemMap

Functions

static void getstring (tString &target, tOutputItemBase *item)
static void copyrec (tOutput &targ, tOutputItemBase *it)
tOutputoperator<< (tOutput &o, char *locale)
tOutputoperator<< (tOutput &o, const char *locale)
std::ostream & operator<< (std::ostream &s, const tOutput &o)
tStringoperator<< (tString &s, const tOutput &o)
std::ostream & operator<< (std::ostream &s, const tLocaleItem &t)
tStringoperator<< (tString &s, const tLocaleItem &o)

Variables

static tArray< tStringst_TemplateParameters
static tString s_gameName ("Armagetron")
static const tLanguagest_firstLanguage = NULL
static const tLanguagest_secondLanguage = NULL
static tLanguagest_languageAnchor = NULL
static tLanguagecurrentLanguage = NULL
static const tString LANGUAGE ("language")
static const tString INCLUDE ("include")


Typedef Documentation

typedef std::map< std::string, tJUST_CONTROLLED_PTR< tLocaleItem > > tLocaleItemMap

Definition at line 75 of file tLocale.cpp.


Function Documentation

static void copyrec ( tOutput targ,
tOutputItemBase it 
) [static]

Definition at line 650 of file tLocale.cpp.

References tOutputItemBase::Clone(), and tListItem< T >::Next().

Referenced by tOutput::Append(), tOutput::operator=(), and tOutput::tOutput().

00651 {
00652     if (!it)
00653         return;
00654 
00655     copyrec(targ, it->Next());
00656     it->Clone(targ);
00657 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void getstring ( tString target,
tOutputItemBase item 
) [static]

Definition at line 514 of file tLocale.cpp.

References tListItem< T >::Next(), and tOutputItemBase::Print().

Referenced by tOutput::operator const char *().

00515 {
00516     if (!item)
00517         return;
00518     getstring(target, item->Next());
00519     item->Print(target);
00520 }

Here is the call graph for this function:

Here is the caller graph for this function:

tString& operator<< ( tString s,
const tLocaleItem o 
)

Definition at line 808 of file tLocale.cpp.

00809 {
00810     s << static_cast<const char *>(o);
00811     return s;
00812 }

std::ostream& operator<< ( std::ostream &  s,
const tLocaleItem t 
)

Definition at line 803 of file tLocale.cpp.

00804 {
00805     return s << static_cast<const char*>(t);
00806 }

tString& operator<< ( tString s,
const tOutput o 
)

Definition at line 767 of file tLocale.cpp.

00768 {
00769     s << tString(o);
00770     return s;
00771 }

std::ostream& operator<< ( std::ostream &  s,
const tOutput o 
)

Definition at line 754 of file tLocale.cpp.

00755 {
00756     return s << tString(o);
00757 }

tOutput& operator<< ( tOutput o,
const char *  locale 
)

Definition at line 739 of file tLocale.cpp.

References tLocale::Find(), and tNEW.

00739                                                      {
00740     int len = strlen(locale);
00741     if (len == 0)
00742         return o;
00743     if (len == 1 && locale[0] == ' ')
00744         tNEW(tOutputItemSpace)(o);
00745     else if (locale[0] == '$')
00746         tNEW(tOutputItemLocale)(o, tLocale::Find(locale+1));
00747     else
00748         tNEW(tOutputItem<tString>)(o, tString(locale));
00749 
00750     return o;
00751 }

Here is the call graph for this function:

tOutput& operator<< ( tOutput o,
char *  locale 
)

Definition at line 733 of file tLocale.cpp.

00734 {
00735     return operator<<(o, static_cast<const char *>(locale));
00736 }


Variable Documentation

tLanguage* currentLanguage = NULL [static]

Definition at line 79 of file tLocale.cpp.

const tString INCLUDE("include") [static]

Referenced by tLocaleItem::Load().

const tString LANGUAGE("language") [static]

Referenced by tLocaleItem::Load().

tString s_gameName("Armagetron") [static]

Referenced by tLocale::Load(), and tLocaleItem::operator const char *().

const tLanguage* st_firstLanguage = NULL [static]

Definition at line 70 of file tLocale.cpp.

tLanguage* st_languageAnchor = NULL [static]

Definition at line 73 of file tLocale.cpp.

const tLanguage* st_secondLanguage = NULL [static]

Definition at line 71 of file tLocale.cpp.

tArray<tString> st_TemplateParameters [static]

Definition at line 38 of file tLocale.cpp.


Generated on Sat Mar 15 23:12:00 2008 for Armagetron Advanced by  doxygen 1.5.4