Page principale | Hiérarchie des classes | Liste par ordre alphabétique | Liste des composants | Liste des fichiers | Composants | Déclarations | Pages associées

Référence de la classe MyString

Gestion de chaine de caractere dynamique. Plus de détails...

#include <MyString.h>


Membres publics

 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".


Attributs Publics

char * value
long size

Membres privés

void Delete ()
BOOL Resize ()
BOOL Resize (int newSize, BOOL recopy=FALSE)

Attributs Privés

long allocSize

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


Description détaillée

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;


Documentation des contructeurs et destructeurs

MyString::MyString  ) 
 

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

MyString::MyString char  letter  ) 
 

MyString::MyString int  integer  ) 
 

MyString::MyString long  linteger  ) 
 

MyString::MyString float  floating  ) 
 

MyString::MyString double  lfloating  ) 
 

MyString::MyString char *  string  ) 
 

MyString::MyString MyString string  ) 
 


Documentation des méthodes

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

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

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

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

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

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

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

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

Formate le text avec les parametre du printf().

void MyString::AddRepetitiveFormat char *  matrise,
int  nbCopy
 

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

Recopy d'une chaine.

À Faire:
a verifier le calcul me parais suspect

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

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
.

void MyString::Delete  )  [private]
 

void MyString::EnterBinNumber int  value  ) 
 

Entre un nombre en binaire.

void MyString::EnterHexaNumber int  value  ) 
 

Entre un nombre en hexadecimal.

int MyString::FindLetter char  letter  ) 
 

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

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

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.

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

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

BOOL MyString::FormatToLower  ) 
 

BOOL MyString::FormatToNoCtrl  ) 
 

BOOL MyString::FormatToUpper  ) 
 

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

int MyString::GetPositionFromRight int  pos  ) 
 

char * MyString::GetValue int  index  ) 
 

BOOL MyString::IsBeginWith char *  model  ) 
 

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

BOOL MyString::IsEmpty  )  [inline]
 

BOOL MyString::IsVisibleText  ) 
 

MyString MyString::Mids int  beginPos,
int  sizeToCopy
 

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

MyString::operator char *  )  const [inline]
 

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

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

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

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

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

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

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

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

void MyString::operator+= char *  string  ) 
 

void MyString::operator+= double  lfloating  ) 
 

void MyString::operator+= float  floating  ) 
 

void MyString::operator+= long  linteger  ) 
 

void MyString::operator+= int  integer  ) 
 

void MyString::operator+= char  letter  ) 
 

MyString & MyString::operator= MyString string  ) 
 

MyString & MyString::operator= char *  string  ) 
 

MyString & MyString::operator= double  lfloating  ) 
 

MyString & MyString::operator= float  floating  ) 
 

MyString & MyString::operator= long  linteger  ) 
 

MyString & MyString::operator= int  integer  ) 
 

MyString & MyString::operator= char  letter  ) 
 

BOOL MyString::operator== MyString string  ) 
 

BOOL MyString::operator== char *  string  ) 
 

BOOL MyString::operator== double  lfloating  ) 
 

BOOL MyString::operator== float  floating  ) 
 

BOOL MyString::operator== long  linteger  ) 
 

BOOL MyString::operator== int  integer  ) 
 

BOOL MyString::operator== char  letter  ) 
 

char & MyString::operator[] int  index  ) 
 

Access a un element du text.

Ex.:

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

BOOL MyString::Resize int  newSize,
BOOL  recopy = FALSE
[private]
 

BOOL MyString::Resize  )  [private]
 

void MyString::Reverse  ) 
 

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

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

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"

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.

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

double MyString::ToDouble  ) 
 

float MyString::ToFloat  ) 
 

long MyString::ToInteger  ) 
 

void MyString::Zero  )  [inline]
 


Documentation des fonctions amies et associées

MyString operator+ MyString string1,
MyString string2
[friend]
 

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

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

MyString operator+ double  lfloating,
MyString string
[friend]
 

MyString operator+ MyString string,
double  lfloating
[friend]
 

MyString operator+ float  floating,
MyString string
[friend]
 

MyString operator+ MyString string,
float  floating
[friend]
 

MyString operator+ long  linteger,
MyString string
[friend]
 

MyString operator+ MyString string,
long  linteger
[friend]
 

MyString operator+ int  integer,
MyString string
[friend]
 

MyString operator+ MyString string,
int  integer
[friend]
 

MyString operator+ char  letter,
MyString string
[friend]
 

MyString operator+ MyString string,
char  letter
[friend]
 

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

Lance un manipulateurs.

Liste:

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

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

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

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

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

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

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

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


Documentation des données imbriquées

long MyString::allocSize [private]
 

long MyString::size
 

char* MyString::value
 


La documentation associée à cette classe a été générée à partir des fichiers suivants :
Généré le Thu Apr 8 18:58:45 2004 pour SFC par doxygen 1.3.6