aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
tinystr.h File Reference
#include <assert.h>
#include <string.h>
+ Include dependency graph for tinystr.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  TiXmlString
 
struct  TiXmlString::Rep
 
class  TiXmlOutStream
 

Macros

#define TIXML_EXPLICIT
 

Functions

bool operator== (const TiXmlString &a, const TiXmlString &b)
 
bool operator< (const TiXmlString &a, const TiXmlString &b)
 
bool operator!= (const TiXmlString &a, const TiXmlString &b)
 
bool operator> (const TiXmlString &a, const TiXmlString &b)
 
bool operator<= (const TiXmlString &a, const TiXmlString &b)
 
bool operator>= (const TiXmlString &a, const TiXmlString &b)
 
bool operator== (const TiXmlString &a, const char *b)
 
bool operator== (const char *a, const TiXmlString &b)
 
bool operator!= (const TiXmlString &a, const char *b)
 
bool operator!= (const char *a, const TiXmlString &b)
 
TiXmlString operator+ (const TiXmlString &a, const TiXmlString &b)
 
TiXmlString operator+ (const TiXmlString &a, const char *b)
 
TiXmlString operator+ (const char *a, const TiXmlString &b)
 

Macro Definition Documentation

◆ TIXML_EXPLICIT

#define TIXML_EXPLICIT

Definition at line 56 of file tinystr.h.

Function Documentation

◆ operator!=() [1/3]

bool operator!= ( const TiXmlString a,
const TiXmlString b 
)
inline

Definition at line 251 of file tinystr.h.

References operator==().

251  {
252  return !(a == b);
253 }
+ Here is the call graph for this function:

◆ operator!=() [2/3]

bool operator!= ( const TiXmlString a,
const char *  b 
)
inline

Definition at line 266 of file tinystr.h.

References operator==().

266 { return !(a == b); }
+ Here is the call graph for this function:

◆ operator!=() [3/3]

bool operator!= ( const char *  a,
const TiXmlString b 
)
inline

Definition at line 267 of file tinystr.h.

References operator==().

267 { return !(b == a); }
+ Here is the call graph for this function:

◆ operator+() [1/3]

TiXmlString operator+ ( const TiXmlString a,
const TiXmlString b 
)

Definition at line 77 of file tinystr.cpp.

References TiXmlString::length(), TiXmlString::operator+=(), and TiXmlString::reserve().

77  {
78  TiXmlString tmp;
79  tmp.reserve(a.length() + b.length());
80  tmp += a;
81  tmp += b;
82  return tmp;
83 }
void reserve(size_type cap)
Definition: tinystr.cpp:40
size_type length() const
Definition: tinystr.h:137
+ Here is the call graph for this function:

◆ operator+() [2/3]

TiXmlString operator+ ( const TiXmlString a,
const char *  b 
)

Definition at line 85 of file tinystr.cpp.

References TiXmlString::append(), TiXmlString::length(), TiXmlString::operator+=(), and TiXmlString::reserve().

85  {
86  TiXmlString tmp;
87  TiXmlString::size_type b_len = static_cast< TiXmlString::size_type >(strlen(b));
88  tmp.reserve(a.length() + b_len);
89  tmp += a;
90  tmp.append(b, b_len);
91  return tmp;
92 }
void reserve(size_type cap)
Definition: tinystr.cpp:40
size_t size_type
Definition: tinystr.h:74
size_type length() const
Definition: tinystr.h:137
TiXmlString & append(const char *str, size_type len)
Definition: tinystr.cpp:65
+ Here is the call graph for this function:

◆ operator+() [3/3]

TiXmlString operator+ ( const char *  a,
const TiXmlString b 
)

Definition at line 94 of file tinystr.cpp.

References TiXmlString::append(), TiXmlString::length(), TiXmlString::operator+=(), and TiXmlString::reserve().

94  {
95  TiXmlString tmp;
96  TiXmlString::size_type a_len = static_cast< TiXmlString::size_type >(strlen(a));
97  tmp.reserve(a_len + b.length());
98  tmp.append(a, a_len);
99  tmp += b;
100  return tmp;
101 }
void reserve(size_type cap)
Definition: tinystr.cpp:40
size_t size_type
Definition: tinystr.h:74
size_type length() const
Definition: tinystr.h:137
TiXmlString & append(const char *str, size_type len)
Definition: tinystr.cpp:65
+ Here is the call graph for this function:

◆ operator<()

bool operator< ( const TiXmlString a,
const TiXmlString b 
)
inline

Definition at line 247 of file tinystr.h.

References TiXmlString::c_str().

Referenced by operator<=(), operator>(), and operator>=().

247  {
248  return strcmp(a.c_str(), b.c_str()) < 0;
249 }
const char * c_str() const
Definition: tinystr.h:131
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator<=()

bool operator<= ( const TiXmlString a,
const TiXmlString b 
)
inline

Definition at line 255 of file tinystr.h.

References operator<().

255  {
256  return !(b < a);
257 }
+ Here is the call graph for this function:

◆ operator==() [1/3]

bool operator== ( const TiXmlString a,
const TiXmlString b 
)
inline

Definition at line 243 of file tinystr.h.

References TiXmlString::c_str(), and TiXmlString::length().

Referenced by operator!=().

243  {
244  return (a.length() == b.length()) // optimization on some platforms
245  && (strcmp(a.c_str(), b.c_str()) == 0); // actual compare
246 }
size_type length() const
Definition: tinystr.h:137
const char * c_str() const
Definition: tinystr.h:131
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator==() [2/3]

bool operator== ( const TiXmlString a,
const char *  b 
)
inline

Definition at line 262 of file tinystr.h.

References TiXmlString::c_str().

Referenced by operator!=(), and operator==().

262  {
263  return strcmp(a.c_str(), b) == 0;
264 }
const char * c_str() const
Definition: tinystr.h:131
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator==() [3/3]

bool operator== ( const char *  a,
const TiXmlString b 
)
inline

Definition at line 265 of file tinystr.h.

References operator==().

265 { return b == a; }
+ Here is the call graph for this function:

◆ operator>()

bool operator> ( const TiXmlString a,
const TiXmlString b 
)
inline

Definition at line 254 of file tinystr.h.

References operator<().

254 { return b < a; }
+ Here is the call graph for this function:

◆ operator>=()

bool operator>= ( const TiXmlString a,
const TiXmlString b 
)
inline

Definition at line 258 of file tinystr.h.

References operator<().

258  {
259  return !(a < b);
260 }
+ Here is the call graph for this function: