aGrUM  0.16.0
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]

◆ 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 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(), and TiXmlString::reserve().

Referenced by operator!=().

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:
+ Here is the caller 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(), 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(), 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().

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:

◆ 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 TiXmlString a,
const TiXmlString b 
)
inline

Definition at line 243 of file tinystr.h.

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

Referenced by gum::HashTable< Val, Size, IndexAllocator >::map(), gum::IBayesNet< double >::operator!=(), gum::Set< gum::Potential< GUM_SCALAR > * >::operator!=(), gum::SequenceImplementation< gum::prm::PRMClassElement< double > *, std::allocator< gum::prm::PRMClassElement< double > *>, std::is_scalar< gum::prm::PRMClassElement< double > *>::value >::operator!=(), gum::SetIteratorSafe< const gum::DiscreteVariable * >::operator!=(), gum::HashTable< Val, Size, IndexAllocator >::operator!=(), gum::SequenceIteratorSafe< NodeId >::operator!=(), gum::BijectionIteratorSafe< NodeId, GUM_SCALAR >::operator!=(), gum::ListConstIterator< Val >::operator!=(), gum::BijectionIterator< int, int >::operator!=(), gum::List< const gum::Potential< GUM_SCALAR > * >::operator!=(), gum::HashTableConstIteratorSafe< const gum::DiscreteVariable *, Idx >::operator!=(), gum::HashTableIteratorSafe< int, int >::operator!=(), gum::HashTableConstIterator< Key, bool >::operator!=(), gum::HashTableIterator< int, int >::operator!=(), gum::List< const gum::Potential< GUM_SCALAR > * >::operator+=(), gum::SequenceImplementation< gum::prm::PRMClassElement< double > *, std::allocator< gum::prm::PRMClassElement< double > *>, std::is_scalar< gum::prm::PRMClassElement< double > *>::value >::operator=(), gum::HashTableIteratorSafe< int, int >::operator==(), gum::HashTableIterator< int, int >::operator==(), and gum::SequenceImplementation< gum::prm::PRMClassElement< double > *, std::allocator< gum::prm::PRMClassElement< double > *>, std::is_scalar< gum::prm::PRMClassElement< double > *>::value >::toString().

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

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:

◆ operator==() [3/3]

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

Definition at line 265 of file tinystr.h.

265 { return b == a; }

◆ 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 }