Blob Blame History Raw
Index: armagetronad/src/tools/tLocale.cpp
===================================================================
--- armagetronad/src/tools/tLocale.cpp	(revision 10796)
+++ armagetronad/src/tools/tLocale.cpp	(revision 10811)
@@ -596,8 +596,19 @@
 {
     tNEW(tOutputItemLocale)(*this, tLocale::Find(x));
 }
+void tOutput::AddString(char const * locale)
+{
+    int len = strlen(locale);
+    if (len == 0)
+        return;
+    if (len == 1 && locale[0] == ' ')
+        tNEW(tOutputItemSpace)(*this);
+    else if (locale[0] == '$')
+        tNEW(tOutputItemLocale)(*this, tLocale::Find(locale+1));
+    else
+        tNEW(tOutputItem<tString>)(*this, tString(locale));
+}
 
-
 tOutput & tOutput::SetTemplateParameter(int num, const char *parameter)
 {
     tNEW(tOutputItemTemplate)(*this, num, parameter);
@@ -733,16 +744,7 @@
 
 // and a special implementation for the locales and strings:
 tOutput& operator << (tOutput &o, const char *locale){
-    int len = strlen(locale);
-    if (len == 0)
-        return o;
-    if (len == 1 && locale[0] == ' ')
-        tNEW(tOutputItemSpace)(o);
-    else if (locale[0] == '$')
-        tNEW(tOutputItemLocale)(o, tLocale::Find(locale+1));
-    else
-        tNEW(tOutputItem<tString>)(o, tString(locale));
-
+    o.AddString(locale);
     return o;
 }
 
Index: armagetronad/src/tools/tLocale.h
===================================================================
--- armagetronad/src/tools/tLocale.h	(revision 10796)
+++ armagetronad/src/tools/tLocale.h	(revision 10811)
@@ -82,7 +82,7 @@
 
     tOutputItemBase *anchor;
 
-    tOutput& operator << (const tOutput &o);
+    // tOutput& operator << (const tOutput &o);
 public:
     tOutput();
     ~tOutput();
@@ -92,6 +92,7 @@
     void AddLiteral(const char *);       // adds a language independent string
     void AddLocale(const char *);        // adds a language dependant string
     void AddSpace();                     // adds a simple space
+    void AddString(char const * pString); // checks the string, delegates to correct Add...()-Function
 
     // set a template parameter at this position of the output string
     tOutput & SetTemplateParameter(int num, const char *parameter);
@@ -114,7 +115,7 @@
 
         SetTemplateParameter(1, template1);
 
-        *this << identifier;
+        AddString(identifier);
     }
 
     template< class T1, class T2 >
@@ -126,7 +127,7 @@
         SetTemplateParameter(1, template1);
         SetTemplateParameter(2, template2);
 
-        *this << identifier;
+        AddString(identifier);
     }
 
     template< class T1, class T2, class T3 >
@@ -139,7 +140,7 @@
         SetTemplateParameter(2, template2);
         SetTemplateParameter(3, template3);
 
-        *this << identifier;
+        AddString(identifier);
     }
 
     template< class T1, class T2, class T3, class T4 >
@@ -153,7 +154,7 @@
         SetTemplateParameter(3, template3);
         SetTemplateParameter(4, template4);
 
-        *this << identifier;
+        AddString(identifier);
     }
 
     tOutput(const tOutput &o); // copy constructor