aGrUM 2.3.2
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.

Referenced by TiXmlString::TiXmlString(), and TiXmlString::TiXmlString().

Function Documentation

◆ operator!=() [1/3]

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

Definition at line 267 of file tinystr.h.

267{ return !(b == a); }

◆ operator!=() [2/3]

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

Definition at line 266 of file tinystr.h.

266{ return !(a == b); }

◆ operator!=() [3/3]

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

Definition at line 251 of file tinystr.h.

251 {
252 return !(a == b);
253}

◆ operator+() [1/3]

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

Definition at line 94 of file tinystr.cpp.

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}
size_type length() const
Definition tinystr.h:137
void reserve(size_type cap)
Definition tinystr.cpp:40
size_t size_type
Definition tinystr.h:74
TiXmlString & append(const char *str, size_type len)
Definition tinystr.cpp:65

References TiXmlString::append(), TiXmlString::length(), and TiXmlString::reserve().

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.

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}

References TiXmlString::append(), TiXmlString::length(), and TiXmlString::reserve().

Here is the call graph for this function:

◆ operator+() [3/3]

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

Definition at line 77 of file tinystr.cpp.

77 {
78 TiXmlString tmp;
79 tmp.reserve(a.length() + b.length());
80 tmp += a;
81 tmp += b;
82 return tmp;
83}

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

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.

247 {
248 return strcmp(a.c_str(), b.c_str()) < 0;
249}
const char * c_str() const
Definition tinystr.h:131

References TiXmlString::c_str().

Here is the call graph for this function:

◆ operator<=()

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

Definition at line 255 of file tinystr.h.

255 {
256 return !(b < a);
257}

◆ operator==() [1/3]

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

Definition at line 265 of file tinystr.h.

265{ return b == a; }

◆ operator==() [2/3]

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

Definition at line 262 of file tinystr.h.

262 {
263 return strcmp(a.c_str(), b) == 0;
264}

References TiXmlString::c_str().

Here is the call graph for this function:

◆ operator==() [3/3]

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

Definition at line 243 of file tinystr.h.

243 {
244 return (a.length() == b.length()) // optimization on some platforms
245 && (strcmp(a.c_str(), b.c_str()) == 0); // actual compare
246}

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

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.

254{ return b < a; }

◆ operator>=()

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

Definition at line 258 of file tinystr.h.

258 {
259 return !(a < b);
260}