ANNA Suite  2020b
Multipurpose development suite for Telco applications
Classes | Public Member Functions | Static Public Member Functions | List of all members
anna::String Class Reference

#include <String.hpp>

Inheritance diagram for anna::String:
Inheritance graph
[legend]
Collaboration diagram for anna::String:
Collaboration graph
[legend]

Classes

struct  Flag
 

Public Member Functions

 String (const Flag::_v flag=Flag::None)
 
 String (const char *str, const Flag::_v flag=Flag::None)
 
 String (const String &other)
 
 String (const std::string &other, const Flag::_v flag=Flag::None)
 
void toUpper ()
 
void toLower ()
 
Stringoperator= (const char *vv)
 
Stringoperator= (const int vv)
 
Stringoperator= (const unsigned int vv)
 
Stringoperator= (const bool vv)
 
Stringoperator= (const S64 vv)
 
Stringoperator= (const U64 vv)
 
Stringoperator= (const float vv)
 
Stringoperator= (const double vv)
 
Stringoperator= (const std::string &vv)
 
Stringoperator= (const DataBlock &vv)
 
Stringoperator+= (const char *vv)
 
Stringoperator+= (const int vv)
 
Stringoperator+= (const unsigned int vv)
 
Stringoperator+= (const bool vv)
 
Stringoperator+= (const S64 vv)
 
Stringoperator+= (const U64 vv)
 
Stringoperator+= (const float vv)
 
Stringoperator+= (const double vv)
 
Stringoperator+= (const std::string &vv)
 
Stringoperator+= (const DataBlock &vv)
 
Stringoperator<< (const char *vv)
 
Stringoperator<< (const int vv)
 
Stringoperator<< (const unsigned int vv)
 
Stringoperator<< (const bool vv)
 
Stringoperator<< (const S64 vv)
 
Stringoperator<< (const U64 vv)
 
Stringoperator<< (const float vv)
 
Stringoperator<< (const double vv)
 
Stringoperator<< (const std::string &vv)
 
Stringoperator<< (const DataBlock &vv)
 

Static Public Member Functions

static String format (const float vv, const char *format)
 
static String format (const double vv, const char *format)
 
static String format (const DataBlock &vv, const int characterByLine)
 
static String hex (const int vv)
 
static String hex (const unsigned int vv)
 
static String hex (const S64 vv)
 

Detailed Description

Clase String que optimiza el uso y la conversi�n de tipos usados habitualmente.

Constructor & Destructor Documentation

◆ String() [1/4]

anna::String::String ( const Flag::_v  flag = Flag::None)
inline

Constructor.

Parameters
flagIndicadores que permiten ajustar el funcionamiento de la clase anna::String.
38 : a_flags(flag) {;}

◆ String() [2/4]

anna::String::String ( const char *  str,
const Flag::_v  flag = Flag::None 
)
inlineexplicit

Constructor.

Parameters
strCadena con la que iniciar el contenido de esta instancia. Puede ser NULL.
flagIndicadores que permiten ajustar el funcionamiento de la clase anna::String.
45  :
46  std::string((str == NULL) ? ((flag & Flag::ShowNull) ? "<null>" : "") : str),
47  a_flags(flag)
48  {;}
Definition: String.hpp:32

◆ String() [3/4]

anna::String::String ( const String other)
inline

Constructor copia.

Parameters
otherInstancia con la iniciar el contenido de esta instancia.
54 : std::string(other), a_flags(other.a_flags) {;}

◆ String() [4/4]

anna::String::String ( const std::string &  other,
const Flag::_v  flag = Flag::None 
)
inlineexplicit

Constructor copia.

Parameters
otherInstancia con la iniciar el contenido de esta instancia.
flagIndicadores que permiten ajustar el funcionamiento de la clase anna::String.
62 : std::string(other), a_flags(flag) {;}
Here is the call graph for this function:

Member Function Documentation

◆ format() [1/3]

static String anna::String::format ( const float  vv,
const char *  format 
)
inlinestatic

Formatea el contenido del float con la cadena recibida como par�metro. La cadena de forma se interpreta de la misma forma que en el m�todo 'sprintf'

Parameters
vvValor a interpretar.
formatCadena usada para interpretar el valor (ver sprintf).
Returns
La cadena con el contenido interpretado.
114 { return __format(vv, format); }
static String format(const float vv, const char *format)
Definition: String.hpp:114

◆ format() [2/3]

static String anna::String::format ( const double  vv,
const char *  format 
)
inlinestatic

Formatea el contenido del double con la cadena recibida como par�metro. La cadena de forma se interpreta de la misma forma que en el m�todo 'sprintf'

Parameters
vvValor a interpretar.
formatCadena usada para interpretar el valor (ver sprintf).
Returns
La cadena con el contenido interpretado.
123 { return __format(vv, format); }
static String format(const float vv, const char *format)
Definition: String.hpp:114
Here is the call graph for this function:

◆ format() [3/3]

static String anna::String::format ( const DataBlock vv,
const int  characterByLine 
)
static

Formatea el contenido del DataBlock con el n�mero de caracteres por l�nea recibida como par�metro.

Parameters
vvValor a interpretar.
characterByLineN�mero de caracters por l�nea.
Returns
La cadena con el contenido interpretado.

◆ hex() [1/3]

static String anna::String::hex ( const int  vv)
inlinestatic

Formatea el valor del par�metro como un n�mero en hexadecimal.

Parameters
vvValor a interpretar.
Returns
La cadena con el contenido interpretado.
138 { return __format(vv, "0x%x"); }

◆ hex() [2/3]

static String anna::String::hex ( const unsigned int  vv)
inlinestatic

Formatea el valor del par�metro como un n�mero en hexadecimal.

Parameters
vvValor a interpretar.
Returns
La cadena con el contenido interpretado.
145 { return __format(vv, "0x%x"); }

◆ hex() [3/3]

static String anna::String::hex ( const S64  vv)
inlinestatic

Formatea el valor del par�metro como un n�mero en hexadecimal.

Parameters
vvValor a interpretar.
Returns
La cadena con el contenido interpretado.
152  {
153  return __format(vv, "0x%llx");
154  /*#ifdef __anna64__
155  return __format (vv, "0x%lx");
156  #else
157  return __format (vv, "0x%llx");
158  #endif
159  */
160  }
Here is the call graph for this function:

◆ operator+=() [1/10]

String& anna::String::operator+= ( const char *  vv)
inline
85 { return operator<< (vv); }
String & operator<<(const char *vv)
Here is the call graph for this function:

◆ operator+=() [2/10]

String& anna::String::operator+= ( const int  vv)
inline
86 { return operator<< (vv); }
String & operator<<(const char *vv)
Here is the call graph for this function:

◆ operator+=() [3/10]

String& anna::String::operator+= ( const unsigned int  vv)
inline
87 { return operator<< (vv); }
String & operator<<(const char *vv)
Here is the call graph for this function:

◆ operator+=() [4/10]

String& anna::String::operator+= ( const bool  vv)
inline
88 { return operator<< (vv); }
String & operator<<(const char *vv)
Here is the call graph for this function:

◆ operator+=() [5/10]

String& anna::String::operator+= ( const S64  vv)
inline
89 { return operator<< (vv); }
String & operator<<(const char *vv)
Here is the call graph for this function:

◆ operator+=() [6/10]

String& anna::String::operator+= ( const U64  vv)
inline
90 { return operator<< (vv); }
String & operator<<(const char *vv)
Here is the call graph for this function:

◆ operator+=() [7/10]

String& anna::String::operator+= ( const float  vv)
inline
91 { return operator<< (vv); }
String & operator<<(const char *vv)
Here is the call graph for this function:

◆ operator+=() [8/10]

String& anna::String::operator+= ( const double  vv)
inline
92 { return operator<< (vv); }
String & operator<<(const char *vv)
Here is the call graph for this function:

◆ operator+=() [9/10]

String& anna::String::operator+= ( const std::string &  vv)
inline
93 { return *this << vv; }

◆ operator+=() [10/10]

String& anna::String::operator+= ( const DataBlock vv)
inline
94 { return *this << vv; }
Here is the call graph for this function:

◆ operator<<() [1/10]

String& anna::String::operator<< ( const char *  vv)

◆ operator<<() [2/10]

String& anna::String::operator<< ( const int  vv)

◆ operator<<() [3/10]

String& anna::String::operator<< ( const unsigned int  vv)

◆ operator<<() [4/10]

String& anna::String::operator<< ( const bool  vv)
inline
99 { std::string::operator+= ((vv == true) ? "true" : "false"); return *this; }
Here is the call graph for this function:

◆ operator<<() [5/10]

String& anna::String::operator<< ( const S64  vv)

◆ operator<<() [6/10]

String& anna::String::operator<< ( const U64  vv)

◆ operator<<() [7/10]

String& anna::String::operator<< ( const float  vv)

◆ operator<<() [8/10]

String& anna::String::operator<< ( const double  vv)

◆ operator<<() [9/10]

String& anna::String::operator<< ( const std::string &  vv)
inline
104 { std::string::operator+= (vv); return *this; }
Here is the call graph for this function:

◆ operator<<() [10/10]

String& anna::String::operator<< ( const DataBlock vv)

◆ operator=() [1/10]

String& anna::String::operator= ( const char *  vv)
inline
74 { std::string::clear(); return operator<< (vv); }
String & operator<<(const char *vv)
Here is the call graph for this function:

◆ operator=() [2/10]

String& anna::String::operator= ( const int  vv)
inline
75 { std::string::clear(); return operator<< (vv); }
String & operator<<(const char *vv)
Here is the call graph for this function:

◆ operator=() [3/10]

String& anna::String::operator= ( const unsigned int  vv)
inline
76 { std::string::clear(); return operator<< (vv); }
String & operator<<(const char *vv)
Here is the call graph for this function:

◆ operator=() [4/10]

String& anna::String::operator= ( const bool  vv)
inline
77 { std::string::clear(); return operator<< (vv); }
String & operator<<(const char *vv)
Here is the call graph for this function:

◆ operator=() [5/10]

String& anna::String::operator= ( const S64  vv)
inline
78 { std::string::clear(); return operator<< (vv); }
String & operator<<(const char *vv)
Here is the call graph for this function:

◆ operator=() [6/10]

String& anna::String::operator= ( const U64  vv)
inline
79 { std::string::clear(); return operator<< (vv); }
String & operator<<(const char *vv)
Here is the call graph for this function:

◆ operator=() [7/10]

String& anna::String::operator= ( const float  vv)
inline
80 { std::string::clear(); return operator<< (vv); }
String & operator<<(const char *vv)
Here is the call graph for this function:

◆ operator=() [8/10]

String& anna::String::operator= ( const double  vv)
inline
81 { std::string::clear(); return operator<< (vv); }
String & operator<<(const char *vv)
Here is the call graph for this function:

◆ operator=() [9/10]

String& anna::String::operator= ( const std::string &  vv)
inline
82 { std::string::operator= (vv); return *this; }

◆ operator=() [10/10]

String& anna::String::operator= ( const DataBlock vv)
inline
83 { std::string::clear(); return operator<< (vv); }
String & operator<<(const char *vv)
Here is the call graph for this function:

◆ toLower()

void anna::String::toLower ( )

Convierte a min�sculas el contenido de esta instancia.

◆ toUpper()

void anna::String::toUpper ( )

Convierte a may�sculas el contenido de esta instancia.


The documentation for this class was generated from the following file: