FEDRA emulsion software from the OPERA Collaboration
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

struct  TiXmlString::Rep
 
class  TiXmlOutStream
 
class  TiXmlString
 

Macros

#define TIXML_EXPLICIT
 

Functions

bool operator!= (const char *a, const TiXmlString &b)
 
bool operator!= (const TiXmlString &a, const char *b)
 
bool operator!= (const TiXmlString &a, const TiXmlString &b)
 
TiXmlString operator+ (const char *a, const TiXmlString &b)
 
TiXmlString operator+ (const TiXmlString &a, const char *b)
 
TiXmlString 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 char *a, const TiXmlString &b)
 
bool operator== (const TiXmlString &a, const char *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)
 

Macro Definition Documentation

◆ TIXML_EXPLICIT

#define TIXML_EXPLICIT

Function Documentation

◆ operator!=() [1/3]

bool operator!= ( const char *  a,
const TiXmlString b 
)
inline
273 { return !(b == a); }
void a()
Definition: check_aligned.C:59

◆ operator!=() [2/3]

bool operator!= ( const TiXmlString a,
const char *  b 
)
inline
272 { return !(a == b); }

◆ operator!=() [3/3]

bool operator!= ( const TiXmlString a,
const TiXmlString b 
)
inline
265 { return !(a == b); }

◆ operator+() [1/3]

TiXmlString operator+ ( const char *  a,
const TiXmlString b 
)
101 {
102  TiXmlString tmp;
103  TiXmlString::size_type a_len = static_cast<TiXmlString::size_type>( strlen(a) );
104  tmp.reserve(a_len + b.length());
105  tmp.append(a, a_len);
106  tmp += b;
107  return tmp;
108 }
Definition: tinystr.h:56
size_type length() const
Definition: tinystr.h:134
void reserve(size_type cap)
Definition: tinystr.cpp:37
size_t size_type
Definition: tinystr.h:59
TiXmlString & append(const char *str, size_type len)
Definition: tinystr.cpp:68

◆ operator+() [2/3]

TiXmlString operator+ ( const TiXmlString a,
const char *  b 
)
91 {
92  TiXmlString tmp;
93  TiXmlString::size_type b_len = static_cast<TiXmlString::size_type>( strlen(b) );
94  tmp.reserve(a.length() + b_len);
95  tmp += a;
96  tmp.append(b, b_len);
97  return tmp;
98 }

◆ operator+() [3/3]

TiXmlString operator+ ( const TiXmlString a,
const TiXmlString b 
)
82 {
83  TiXmlString tmp;
84  tmp.reserve(a.length() + b.length());
85  tmp += a;
86  tmp += b;
87  return tmp;
88 }

◆ operator<()

bool operator< ( const TiXmlString a,
const TiXmlString b 
)
inline
261 {
262  return strcmp(a.c_str(), b.c_str()) < 0;
263 }
const char * c_str() const
Definition: tinystr.h:128

◆ operator<=()

bool operator<= ( const TiXmlString a,
const TiXmlString b 
)
inline
267 { return !(b < a); }

◆ operator==() [1/3]

bool operator== ( const char *  a,
const TiXmlString b 
)
inline
271 { return b == a; }

◆ operator==() [2/3]

bool operator== ( const TiXmlString a,
const char *  b 
)
inline
270 { return strcmp(a.c_str(), b) == 0; }

◆ operator==() [3/3]

bool operator== ( const TiXmlString a,
const TiXmlString b 
)
inline
256 {
257  return ( a.length() == b.length() ) // optimization on some platforms
258  && ( strcmp(a.c_str(), b.c_str()) == 0 ); // actual compare
259 }

◆ operator>()

bool operator> ( const TiXmlString a,
const TiXmlString b 
)
inline
266 { return b < a; }

◆ operator>=()

bool operator>= ( const TiXmlString a,
const TiXmlString b 
)
inline
268 { return !(a < b); }