Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

MyString Class Reference

Gestion de chaine de caractere dynamique. More...

#include <MyString.h>

List of all members.

Public Member Functions

 MyString ()
virtual ~MyString ()
BOOL IsEmpty ()
 MyString (char letter)
 MyString (int integer)
 MyString (long linteger)
 MyString (float floating)
 MyString (double lfloating)
 MyString (char *string)
 MyString (MyString &string)
void Zero ()
void operator+= (char letter)
void operator+= (int integer)
void operator+= (long linteger)
void operator+= (float floating)
void operator+= (double lfloating)
void operator+= (char *string)
void operator+= (MyString &string)
MyStringoperator= (char letter)
MyStringoperator= (int integer)
MyStringoperator= (long linteger)
MyStringoperator= (float floating)
MyStringoperator= (double lfloating)
MyStringoperator= (char *string)
MyStringoperator= (MyString &string)
BOOL operator== (char letter)
BOOL operator== (int integer)
BOOL operator== (long linteger)
BOOL operator== (float floating)
BOOL operator== (double lfloating)
BOOL operator== (char *string)
BOOL operator== (MyString &string)
BOOL operator!= (char letter)
BOOL operator!= (int integer)
BOOL operator!= (long linteger)
BOOL operator!= (float floating)
BOOL operator!= (double lfloating)
BOOL operator!= (char *string)
BOOL operator!= (MyString &string)
BOOL AddFormat (char *format,...)
 Formate le text avec les parametre du printf().

BOOL Format (char *format,...)
long ToInteger ()
float ToFloat ()
double ToDouble ()
char & operator[] (int num)
 Access a un element du text.

 operator char * () const
void SplitPath (MyString *drive, MyString *dir, MyString *file, MyString *ext, MyString *driveDir, MyString *fileExt)
BOOL SubStringBeforToken (int numSubString, MyString &result, char *lstToken)
 Decomposition d'une chaine par un modele.

char * GetValue (int index)
BOOL CopyTo (MyString &result, int index, int size)
 Recopy d'une chaine.

BOOL FormatToNoCtrl ()
BOOL FormatToLower ()
BOOL FormatToUpper ()
void AddRepetitiveFormat (char *matrise, int nbCopy)
BOOL IsVisibleText ()
int GetPositionFromLeft (int pos)
 Transforme les positions.

int GetPositionFromRight (int pos)
BOOL Delete (int pos, BOOL after, char letterToFind)
 Efface a partir de la position, avant ou apres d'un certain nombre de caracter ou delimité par un lettre a rechercher ex.:
MyString str="0123456"; str.Delete(-1,FALSE,1); // 012345 str.Delete(1,TRUE,2); // 0345 str.Delete(1,TRUE,'4'); // 05
.

BOOL Delete (int pos, BOOL after, int nbLetter)
BOOL Add (int pos, BOOL after, char letter)
 Ajoute un element a une position donnée.

BOOL Add (int pos, BOOL after, int integer)
BOOL Add (int pos, BOOL after, long linteger)
BOOL Add (int pos, BOOL after, float floating)
BOOL Add (int pos, BOOL after, double lfloating)
BOOL Add (int pos, BOOL after, char *string)
BOOL Add (int pos, BOOL after, MyString &string)
int FindLetter (int pos, BOOL after, char letter)
 Donne la position d'un lettre a partir de la pos de base dansla direction after avec comme model la letter.

int FindLetter (char letter)
 Donne la position d'un lettre a partir de la gauche.

MyString Mids (int beginPos, int sizeToCopy)
 Recopie la chaine a partir d'une postion et d'une taille donnée.

BOOL IsBeginWith (char *model)
 Test si le "model" est bien le debut du text.

char * TestSubString (char *text, BOOL caseSensitive=TRUE)
 Test si le text est contenu dans la chaine en cours caseSensitive: distingue les majuscule et minuscule.

void EnterHexaNumber (int value)
 Entre un nombre en hexadecimal.

void EnterBinNumber (int value)
 Entre un nombre en binaire.

void Reverse ()
 Met a l'envert une chaine "abcde" ==> "edcba".

long GetSize ()
char * GetValue ()

Friends

MyString operator+ (MyString &string, char letter)
MyString operator+ (char letter, MyString &string)
MyString operator+ (MyString &string, int integer)
MyString operator+ (int integer, MyString &string)
MyString operator+ (MyString &string, long linteger)
MyString operator+ (long linteger, MyString &string)
MyString operator+ (MyString &string, float floating)
MyString operator+ (float floating, MyString &string)
MyString operator+ (MyString &string, double lfloating)
MyString operator+ (double lfloating, MyString &string)
MyString operator+ (MyString &string1, char *string2)
MyString operator+ (char *string1, MyString &string2)
MyString operator+ (MyString &string1, MyString &string2)
MyStringoperator<< (MyString &string, char letter)
MyStringoperator<< (MyString &string, int integer)
MyStringoperator<< (MyString &string, long linteger)
MyStringoperator<< (MyString &string, float floating)
MyStringoperator<< (MyString &string, double lfloating)
MyStringoperator<< (MyString &string1, char *string2)
MyStringoperator<< (MyString &string1, MyString &string2)
MyStringoperator<< (MyString &in,FncManipulateur fnc)
 Lance un manipulateurs.


Detailed Description

Gestion de chaine de caractere dynamique.

Ex.:

MyString temp,a,b,c; a = "coucou"; b = "toi"; c = a; temp = a + "lui"; c = "hello " + b; temp = a + b;

Definition at line 46 of file MyString.h.


Constructor & Destructor Documentation

MyString::MyString  ) 
 

Definition at line 40 of file MyString.cpp.

References Zero().

virtual MyString::~MyString  )  [inline, virtual]
 

Definition at line 55 of file MyString.h.

References Delete().

MyString::MyString char  letter  ) 
 

Definition at line 46 of file MyString.cpp.

MyString::MyString int  integer  ) 
 

Definition at line 52 of file MyString.cpp.

MyString::MyString long  linteger  ) 
 

Definition at line 58 of file MyString.cpp.

MyString::MyString float  floating  ) 
 

Definition at line 64 of file MyString.cpp.

MyString::MyString double  lfloating  ) 
 

Definition at line 70 of file MyString.cpp.

MyString::MyString char *  string  ) 
 

Definition at line 76 of file MyString.cpp.

References string.

MyString::MyString MyString string  ) 
 

Definition at line 82 of file MyString.cpp.

References string.


Member Function Documentation

BOOL MyString::Add int  pos,
BOOL  after,
MyString string
 

Definition at line 739 of file MyString.cpp.

References BOOL(), and string.

BOOL MyString::Add int  pos,
BOOL  after,
char *  string
 

Definition at line 735 of file MyString.cpp.

References BOOL(), and string.

BOOL MyString::Add int  pos,
BOOL  after,
double  lfloating
 

Definition at line 731 of file MyString.cpp.

References BOOL().

BOOL MyString::Add int  pos,
BOOL  after,
float  floating
 

Definition at line 727 of file MyString.cpp.

References BOOL().

BOOL MyString::Add int  pos,
BOOL  after,
long  linteger
 

Definition at line 723 of file MyString.cpp.

References BOOL().

BOOL MyString::Add int  pos,
BOOL  after,
int  integer
 

Definition at line 719 of file MyString.cpp.

References BOOL().

BOOL MyString::Add int  pos,
BOOL  after,
char  letter
 

Ajoute un element a une position donnée.

Ex.:

MyString str="012"; str.Add(1,TRUE,'a'); // 01a2 str.Add(1,FALSE,-12.2); // 01-12.2a2 str.Add(-1,TRUE,"coucou"); // 01-12coucou

Definition at line 708 of file MyString.cpp.

References BOOL(), CopyTo(), GetPositionFromLeft(), and operator=().

BOOL MyString::AddFormat char *  format,
... 
 

Formate le text avec les parametre du printf().

Definition at line 784 of file MyString.cpp.

References BOOL(), buffer, format, len, and operator+=().

Referenced by OpenGL_TestError(), Picking::Test(), Window::ToString(), Univers::ToString(), TrackButton::ToString(), Title::ToString(), Tip::ToString(), TextBox::ToString(), Slider::ToString(), MasterContainer::ToString(), StateKey::ToString(), StateMouse::ToString(), Control::ToString(), Container::ToString(), and Button::ToString().

void MyString::AddRepetitiveFormat char *  matrise,
int  nbCopy
 

Definition at line 637 of file MyString.cpp.

References operator+=().

BOOL MyString::CopyTo MyString result,
int  index,
int  sizeToCopy
 

Recopy d'une chaine.

Todo:
a verifier le calcul me parais suspect

Definition at line 526 of file MyString.cpp.

References BOOL(), GetValue(), index, operator[](), and Resize().

Referenced by Add(), and SubStringBeforToken().

BOOL MyString::Delete int  pos,
BOOL  after,
int  nbLetter
 

Definition at line 689 of file MyString.cpp.

References BOOL(), and GetPositionFromLeft().

BOOL MyString::Delete int  pos,
BOOL  after,
char  letterToFind
 

Efface a partir de la position, avant ou apres d'un certain nombre de caracter ou delimité par un lettre a rechercher ex.:

MyString str="0123456"; str.Delete(-1,FALSE,1); // 012345 str.Delete(1,TRUE,2); // 0345 str.Delete(1,TRUE,'4'); // 05
.

Definition at line 681 of file MyString.cpp.

References BOOL(), FindLetter(), and GetPositionFromLeft().

Referenced by operator=(), and ~MyString().

void MyString::EnterBinNumber int  value  ) 
 

Entre un nombre en binaire.

Definition at line 874 of file MyString.cpp.

References operator+=(), Reverse(), and Zero().

void MyString::EnterHexaNumber int  value  ) 
 

Entre un nombre en hexadecimal.

Definition at line 857 of file MyString.cpp.

References operator+=(), Reverse(), and Zero().

int MyString::FindLetter char  letter  ) 
 

Donne la position d'un lettre a partir de la gauche.

Returns:
  • la postion par rapport a la gauche
  • -1 si pas de model trouvé

Definition at line 776 of file MyString.cpp.

References FindLetter().

int MyString::FindLetter int  pos,
BOOL  after,
char  letter
 

Donne la position d'un lettre a partir de la pos de base dansla direction after avec comme model la letter.

Returns:
  • la postion par rapport a la gauche
  • -1 si pas de model trouvé

Definition at line 752 of file MyString.cpp.

References GetPositionFromLeft().

Referenced by Delete(), and FindLetter().

BOOL MyString::Format char *  format,
... 
 

Definition at line 813 of file MyString.cpp.

References BOOL(), buffer, format, len, and operator=().

Referenced by AboutProc(), ControlEngine::DrawFPS(), ValueEditors::MakeElemControlStruct(), ValueEditors::MakeElemFaceStruct(), ValueEditors::MakeFontsStruct(), ValueEditors::MakeTexturesStruct(), Screen::MsgInfoType(), Tutorial::BaseDemo::OnWinMove(), Tutorial::BaseDemo::OnXSliderMove(), Tutorial::BaseDemo::OnYSliderMove(), OpenGL_TestError(), and Picking::Test().

BOOL MyString::FormatToLower  ) 
 

Definition at line 598 of file MyString.cpp.

References BOOL().

Referenced by TestSubString().

BOOL MyString::FormatToNoCtrl  ) 
 

Definition at line 583 of file MyString.cpp.

References BOOL().

BOOL MyString::FormatToUpper  ) 
 

Definition at line 612 of file MyString.cpp.

References BOOL().

int MyString::GetPositionFromLeft int  pos  ) 
 

Transforme les positions.

ex.:

// left count 012 // right count -321 MyString str= "012"; printf("%d",str.GetPositionFromLeft(1)); // 1 printf("%d",str.GetPositionFromLeft(-1)); // 2 printf("%d",str.GetPositionFromRight(1)); // -2 printf("%d",str.GetPositionFromRight(-1)); // -1

Definition at line 659 of file MyString.cpp.

Referenced by Add(), Delete(), FindLetter(), and operator[]().

int MyString::GetPositionFromRight int  pos  ) 
 

Definition at line 665 of file MyString.cpp.

long MyString::GetSize  ) 
 

Definition at line 30 of file MyString.cpp.

Referenced by Text3D::AnalyseLex(), Text3D::ComputeLineSize(), MyRegistry::GetValue(), ValueEditor< T >::InterpretedText(), CMyMenu::MeasureItem(), and NextSubKey().

char * MyString::GetValue  ) 
 

Definition at line 35 of file MyString.cpp.

Referenced by CopyTo().

char * MyString::GetValue int  index  ) 
 

Definition at line 510 of file MyString.cpp.

References index.

Referenced by MyRegistry::DeleteKey(), Text3D::GetText(), MyRegistry::GetValue(), and NextSubKey().

BOOL MyString::IsBeginWith char *  model  ) 
 

Test si le "model" est bien le debut du text.

Definition at line 832 of file MyString.cpp.

References BOOL().

BOOL MyString::IsEmpty  )  [inline]
 

Definition at line 57 of file MyString.h.

References BOOL().

Referenced by Text3D::Draw().

BOOL MyString::IsVisibleText  ) 
 

Definition at line 626 of file MyString.cpp.

References BOOL().

MyString MyString::Mids int  beginPos,
int  sizeToCopy
 

Recopie la chaine a partir d'une postion et d'une taille donnée.

Definition at line 802 of file MyString.cpp.

Referenced by Text3D::AnalyseGram(), and Text3D::ComputeLayout().

MyString::operator char *  )  const [inline]
 

Definition at line 128 of file MyString.h.

BOOL MyString::operator!= MyString string  )  [inline]
 

Definition at line 98 of file MyString.h.

References BOOL(), operator==(), and string.

BOOL MyString::operator!= char *  string  )  [inline]
 

Definition at line 97 of file MyString.h.

References BOOL(), operator==(), and string.

BOOL MyString::operator!= double  lfloating  )  [inline]
 

Definition at line 96 of file MyString.h.

References BOOL(), and operator==().

BOOL MyString::operator!= float  floating  )  [inline]
 

Definition at line 95 of file MyString.h.

References BOOL(), and operator==().

BOOL MyString::operator!= long  linteger  )  [inline]
 

Definition at line 94 of file MyString.h.

References BOOL(), and operator==().

BOOL MyString::operator!= int  integer  )  [inline]
 

Definition at line 93 of file MyString.h.

References BOOL(), and operator==().

BOOL MyString::operator!= char  letter  )  [inline]
 

Definition at line 92 of file MyString.h.

References BOOL(), and operator==().

void MyString::operator+= MyString string  )  [inline]
 

Definition at line 74 of file MyString.h.

References string.

void MyString::operator+= char *  string  ) 
 

Definition at line 257 of file MyString.cpp.

References string.

void MyString::operator+= double  lfloating  ) 
 

Definition at line 251 of file MyString.cpp.

void MyString::operator+= float  floating  ) 
 

Definition at line 245 of file MyString.cpp.

void MyString::operator+= long  linteger  ) 
 

Definition at line 239 of file MyString.cpp.

void MyString::operator+= int  integer  ) 
 

Definition at line 233 of file MyString.cpp.

void MyString::operator+= char  letter  ) 
 

Definition at line 221 of file MyString.cpp.

Referenced by AddFormat(), AddRepetitiveFormat(), EnterBinNumber(), and EnterHexaNumber().

MyString & MyString::operator= MyString string  ) 
 

Definition at line 165 of file MyString.cpp.

References Delete(), and string.

MyString & MyString::operator= char *  string  ) 
 

Definition at line 153 of file MyString.cpp.

References Delete(), and string.

MyString & MyString::operator= double  lfloating  ) 
 

Definition at line 145 of file MyString.cpp.

MyString & MyString::operator= float  floating  ) 
 

Definition at line 137 of file MyString.cpp.

MyString & MyString::operator= long  linteger  ) 
 

Definition at line 129 of file MyString.cpp.

MyString & MyString::operator= int  integer  ) 
 

Definition at line 121 of file MyString.cpp.

MyString & MyString::operator= char  letter  ) 
 

Definition at line 109 of file MyString.cpp.

References Delete().

Referenced by Add(), and Format().

BOOL MyString::operator== MyString string  ) 
 

Definition at line 214 of file MyString.cpp.

References BOOL(), and string.

BOOL MyString::operator== char *  string  ) 
 

Definition at line 208 of file MyString.cpp.

References BOOL(), and string.

BOOL MyString::operator== double  lfloating  ) 
 

Definition at line 202 of file MyString.cpp.

References BOOL(), and value.

BOOL MyString::operator== float  floating  ) 
 

Definition at line 196 of file MyString.cpp.

References BOOL(), and value.

BOOL MyString::operator== long  linteger  ) 
 

Definition at line 190 of file MyString.cpp.

References BOOL(), and value.

BOOL MyString::operator== int  integer  ) 
 

Definition at line 184 of file MyString.cpp.

References BOOL(), and value.

BOOL MyString::operator== char  letter  ) 
 

Definition at line 178 of file MyString.cpp.

References BOOL(), and value.

Referenced by operator!=().

char & MyString::operator[] int  index  ) 
 

Access a un element du text.

Ex.:

MyString temp = "coucou"; if (temp[1]=='o') temp[2]='i'; // temp == "coicou"

Definition at line 381 of file MyString.cpp.

References GetPositionFromLeft(), and index.

Referenced by CopyTo().

void MyString::Reverse  ) 
 

Met a l'envert une chaine "abcde" ==> "edcba".

Definition at line 889 of file MyString.cpp.

Referenced by EnterBinNumber(), and EnterHexaNumber().

void MyString::SplitPath MyString drive,
MyString dir,
MyString file,
MyString ext,
MyString driveDir,
MyString fileExt
 

Definition at line 541 of file MyString.cpp.

References clear().

BOOL MyString::SubStringBeforToken int  numSubString,
MyString result,
char *  lstToken
 

Decomposition d'une chaine par un modele.

Ex.: "c:\mp3\album\clapton\" index deb 1 2 3 4 index fin -4 -3 -2 -1

SubStringBeforToken(-1,result,"\\:") ==> result: "clapton"

Definition at line 483 of file MyString.cpp.

References BOOL(), and CopyTo().

char * MyString::TestSubString char *  text,
BOOL  caseSensitive = TRUE
 

Test si le text est contenu dans la chaine en cours caseSensitive: distingue les majuscule et minuscule.

Returns:
NULL si pas de sous string , charPtr si trouvé

Definition at line 843 of file MyString.cpp.

References FormatToLower().

double MyString::ToDouble  ) 
 

Definition at line 574 of file MyString.cpp.

References res.

Referenced by ValueEditor< T >::Get_Value(), and MyRegistry::GetValue().

float MyString::ToFloat  ) 
 

Definition at line 567 of file MyString.cpp.

References res.

Referenced by MyRegistry::GetValue().

long MyString::ToInteger  ) 
 

Definition at line 560 of file MyString.cpp.

References res.

void MyString::Zero  )  [inline]
 

Definition at line 67 of file MyString.h.

Referenced by EnterBinNumber(), EnterHexaNumber(), and MyString().


Friends And Related Function Documentation

MyString operator+ MyString string1,
MyString string2
[friend]
 

Definition at line 364 of file MyString.cpp.

MyString operator+ char *  string1,
MyString string2
[friend]
 

Definition at line 279 of file MyString.cpp.

MyString operator+ MyString string1,
char *  string2
[friend]
 

Definition at line 269 of file MyString.cpp.

MyString operator+ double  lfloating,
MyString string
[friend]
 

Definition at line 357 of file MyString.cpp.

MyString operator+ MyString string,
double  lfloating
[friend]
 

Definition at line 350 of file MyString.cpp.

MyString operator+ float  floating,
MyString string
[friend]
 

Definition at line 343 of file MyString.cpp.

MyString operator+ MyString string,
float  floating
[friend]
 

Definition at line 336 of file MyString.cpp.

MyString operator+ long  linteger,
MyString string
[friend]
 

Definition at line 329 of file MyString.cpp.

MyString operator+ MyString string,
long  linteger
[friend]
 

Definition at line 322 of file MyString.cpp.

MyString operator+ int  integer,
MyString string
[friend]
 

Definition at line 315 of file MyString.cpp.

MyString operator+ MyString string,
int  integer
[friend]
 

Definition at line 308 of file MyString.cpp.

MyString operator+ char  letter,
MyString string
[friend]
 

Definition at line 301 of file MyString.cpp.

MyString operator+ MyString string,
char  letter
[friend]
 

Definition at line 294 of file MyString.cpp.

MyString& operator<< MyString in,
FncManipulateur  fnc
[friend]
 

Lance un manipulateurs.

Liste:

  • clear ==> efface
  • ret ==> retour a la ligne

Definition at line 915 of file MyString.cpp.

MyString& operator<< MyString string1,
MyString string2
[friend]
 

Definition at line 432 of file MyString.cpp.

MyString& operator<< MyString string1,
char *  string2
[friend]
 

Definition at line 426 of file MyString.cpp.

MyString& operator<< MyString string,
double  lfloating
[friend]
 

Definition at line 420 of file MyString.cpp.

MyString& operator<< MyString string,
float  floating
[friend]
 

Definition at line 414 of file MyString.cpp.

MyString& operator<< MyString string,
long  linteger
[friend]
 

Definition at line 408 of file MyString.cpp.

MyString& operator<< MyString string,
int  integer
[friend]
 

Definition at line 402 of file MyString.cpp.

MyString& operator<< MyString string,
char  letter
[friend]
 

Definition at line 396 of file MyString.cpp.


The documentation for this class was generated from the following files:
Generated on Fri Aug 20 19:21:28 2004 for 3d Controls by doxygen 1.3.6