tColoredString Class Reference

strings that know about color markings More...

#include <tString.h>

Inheritance diagram for tColoredString:

Inheritance graph
[legend]
Collaboration diagram for tColoredString:

Collaboration graph
[legend]

List of all members.

Public Types

typedef tColoredString THISCLASS
 typedef for this class
typedef tString BASE
 typedef for base clase

Public Member Functions

 ~tColoredString ()
 Destructor.
 tColoredString ()
 Default constructor.
 tColoredString (const tColoredString &other)
 Copy constructor.
 tColoredString (const tString &other)
 Base copy constructor.
 tColoredString (const CHAR *other)
 Constructor from raw C string.
 tColoredString (const tOutput &other)
 Constructor from output gatherer.
 WRAP_MUTATING_OPERATOR (=, CHAR const *) WRAP_MUTATING_OPERATOR(
 Assignment operators.
BASE const & WRAP_MUTATING_OPERATOR (=, tOutput const &) static tString RemoveColors(const CHAR *c)
 Removes the color codes from a string.
void SetPos (int len, bool cut=false)
 Makes sure string has length len when color codes are removed.
void RemoveTrailingColor ()
 Removes trailing, unfinished color code.
int LongestLine () const
 
Returns:
the length of the longest line, not including color codes


Static Public Member Functions

static tColoredStringProxy ColorString (REAL r, REAL g, REAL b)
 Creates a color string inserter.


Detailed Description

strings that know about color markings

Definition at line 191 of file tString.h.


Member Typedef Documentation

typedef tColoredString tColoredString::THISCLASS

typedef for this class

Reimplemented from tString.

Definition at line 194 of file tString.h.

typedef tString tColoredString::BASE

typedef for base clase

Reimplemented from tString.

Definition at line 195 of file tString.h.


Constructor & Destructor Documentation

tColoredString::~tColoredString ( void   ) 

Destructor.

Definition at line 1437 of file tString.cpp.

01438 {
01439 }

tColoredString::tColoredString ( void   ) 

Default constructor.

Definition at line 1450 of file tString.cpp.

01451 {
01452 }

tColoredString::tColoredString ( const tColoredString other  ) 

Copy constructor.

Parameters:
other string to copy from

Definition at line 1464 of file tString.cpp.

01465 :tString( other )
01466 {
01467 }

tColoredString::tColoredString ( const tString other  )  [explicit]

Base copy constructor.

Parameters:
other string to copy from

Definition at line 1479 of file tString.cpp.

01480         :tString( other )
01481 {
01482 }

tColoredString::tColoredString ( const CHAR other  )  [explicit]

Constructor from raw C string.

tColoredString::tColoredString ( const tOutput other  )  [explicit]

Constructor from output gatherer.

Parameters:
other output to copy from

Definition at line 1509 of file tString.cpp.

01510         :tString( other )
01511 {
01512 }


Member Function Documentation

tColoredString::WRAP_MUTATING_OPERATOR ( CHAR const *   ) 

Assignment operators.

BASE const& tColoredString::WRAP_MUTATING_OPERATOR ( tOutput const &   )  const

Removes the color codes from a string.

void tColoredString::SetPos ( int  len,
bool  cut = false 
)

Makes sure string has length len when color codes are removed.

Parameters:
len the desired length
cut only if set, the length of the string may be reduced

Reimplemented from tString.

Definition at line 1613 of file tString.cpp.

References RemoveTrailingColor(), and tString::SetPos().

Referenced by eTeam::Ranking(), and ePlayerNetID::Ranking().

01614 {
01615     // determine desired raw length taking color codes into account and possibly cutting
01616     int wishLen = len + ::RemoveTrailingColor( *this, cut ? len : -1 );
01617 
01618     // delegate
01619     tString::SetPos( wishLen, cut );
01620 }

Here is the call graph for this function:

Here is the caller graph for this function:

void tColoredString::RemoveTrailingColor ( void   ) 

Removes trailing, unfinished color code.

Definition at line 1631 of file tString.cpp.

Referenced by operator<<(), and SetPos().

01632 {
01633     // delegage
01634     ::RemoveTrailingColor( *this );
01635 }

Here is the caller graph for this function:

int tColoredString::LongestLine ( void   )  const

Returns:
the length of the longest line, not including color codes

Reimplemented from tString.

Definition at line 1374 of file tString.cpp.

Referenced by rConsole::Render().

01374                                             {
01375     return tColoredString::RemoveColors(c_str()).LongestLine();
01376 }

Here is the caller graph for this function:

static tColoredStringProxy tColoredString::ColorString ( REAL  r,
REAL  g,
REAL  b 
) [inline, static]

Creates a color string inserter.

Definition at line 219 of file tString.h.

Referenced by eTeam::AddPlayer(), ePlayerNetID::AddScore(), gGame::Analysis(), rConsole::ColorString(), eNameMessenger::eNameMessenger(), gMemuItemConsole::Event(), gCycle::KillAt(), operator<<(), eTeam::RankingGraph(), tConfItemLine::ReadVal(), ePlayerNetID::RemoveChatbots(), eTeam::RemovePlayer(), gServerMenu::Render(), rConsole::Render(), gServerMenuItem::RenderBackground(), se_BuildChatString(), se_ChatMe(), se_DisplayChatLocally(), se_rubyEval(), se_SendPrivateMessage(), se_SendTeamMessage(), sg_Deprecated(), eTeam::UpdateAppearance(), and ePlayerNetID::UpdateName().

00220     {
00221         return tColoredStringProxy( r, g, b );
00222     }

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
Generated on Sat Mar 15 23:55:06 2008 for Armagetron Advanced by  doxygen 1.5.4