40 #ifndef TIXML_STRING_INCLUDED
41 #define TIXML_STRING_INCLUDED
50 #if defined(_MSC_VER) && (_MSC_VER >= 1200 )
52 #define TIXML_EXPLICIT explicit
53 #elif defined(__GNUC__) && (__GNUC__ >= 3 )
55 #define TIXML_EXPLICIT explicit
57 #define TIXML_EXPLICIT
79 TiXmlString () : rep_(&nullrep_)
84 TiXmlString (
const TiXmlString &
copy) : rep_(0)
87 memcpy(
start(), copy.data(), length());
91 TIXML_EXPLICIT TiXmlString (
const char * copy) : rep_(0)
93 init( static_cast<size_type>( strlen(copy) ));
94 memcpy(
start(), copy, length());
98 TIXML_EXPLICIT TiXmlString (
const char * str,
size_type len) : rep_(0)
101 memcpy(
start(), str, len);
111 TiXmlString& operator = (
const char * copy)
117 TiXmlString& operator = (
const TiXmlString & copy)
119 return assign(copy.start(), copy.length());
126 return append(suffix, static_cast<size_type>( strlen(suffix) ));
132 return append(&single, 1);
136 TiXmlString&
operator += (
const TiXmlString & suffix)
138 return append(suffix.data(), suffix.length());
143 const char * c_str ()
const {
return rep_->str; }
146 const char *
data ()
const {
return rep_->str; }
149 size_type length ()
const {
return rep_->size; }
155 bool empty ()
const {
return rep_->size == 0; }
158 size_type capacity ()
const {
return rep_->capacity; }
164 assert( index < length() );
165 return rep_->str[
index ];
171 assert( index < length() );
172 return rep_->str[
index ];
178 return find(lookup, 0);
184 if (offset >= length())
return npos;
186 for (
const char*
p = c_str() + offset; *
p !=
'\0'; ++
p)
188 if (*
p == tofind)
return static_cast< size_type >(
p - c_str() );
212 void swap (TiXmlString& other)
222 void set_size(
size_type sz) { rep_->str[ rep_->size = sz ] =
'\0'; }
223 char*
start()
const {
return rep_->str; }
224 char* finish()
const {
return rep_->str + rep_->size; }
241 const size_type bytesNeeded =
sizeof(Rep) + cap;
242 const size_type intsNeeded = ( bytesNeeded +
sizeof(int) - 1 ) /
sizeof( int );
243 rep_ =
reinterpret_cast<Rep*
>(
new int[ intsNeeded ] );
245 rep_->str[ rep_->size = sz ] =
'\0';
246 rep_->capacity =
cap;
256 if (rep_ != &nullrep_)
260 delete [] (
reinterpret_cast<int*
>( rep_ ) );
270 inline bool operator == (
const TiXmlString &
a,
const TiXmlString &
b)
272 return ( a.length() == b.length() )
273 && ( strcmp(a.c_str(), b.c_str()) == 0 );
275 inline bool operator < (
const TiXmlString & a,
const TiXmlString & b)
277 return strcmp(a.c_str(), b.c_str()) < 0;
280 inline bool operator != (
const TiXmlString & a,
const TiXmlString & b) {
return !(a ==
b); }
281 inline bool operator > (
const TiXmlString & a,
const TiXmlString & b) {
return b <
a; }
282 inline bool operator <= (
const TiXmlString & a,
const TiXmlString & b) {
return !(b <
a); }
283 inline bool operator >= (
const TiXmlString & a,
const TiXmlString & b) {
return !(a <
b); }
285 inline bool operator == (
const TiXmlString & a,
const char* b) {
return strcmp(a.c_str(),
b) == 0; }
286 inline bool operator == (
const char* a,
const TiXmlString & b) {
return b ==
a; }
287 inline bool operator != (
const TiXmlString & a,
const char* b) {
return !(a ==
b); }
288 inline bool operator != (
const char* a,
const TiXmlString & b) {
return !(b ==
a); }
290 TiXmlString
operator + (
const TiXmlString & a,
const TiXmlString & b);
291 TiXmlString
operator + (
const TiXmlString & a,
const char* b);
292 TiXmlString
operator + (
const char* a,
const TiXmlString & b);
299 class TiXmlOutStream :
public TiXmlString
319 #endif // TIXML_STRING_INCLUDED
320 #endif // TIXML_USE_STL
void swap(ora::Record &rh, ora::Record &lh)
tuple start
Check for commandline option errors.
MatrixMeschach operator+(const MatrixMeschach &mat1, const MatrixMeschach &mat2)
boost::dynamic_bitset append(const boost::dynamic_bitset<> &bs1, const boost::dynamic_bitset<> &bs2)
this method takes two bitsets bs1 and bs2 and returns result of bs2 appended to the end of bs1 ...
bool operator>(l1t::Jet &a, l1t::Jet &b)
bool operator!=(debugging_allocator< X > const &, debugging_allocator< Y > const &)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
bool operator<=(View< T > const &, View< T > const &)
bool operator>=(View< T > const &, View< T > const &)
bool operator<(const FedChannelConnection &, const FedChannelConnection &)
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
bool operator==(const QGLikelihoodParameters &lhs, const QGLikelihoodCategory &rhs)
Test if parameters are compatible with category.
T operator[](int i) const
void assign(const std::vector< float > &vec, float &a, float &b, float &c, float &d)
tuple size
Write out results.
Basic3DVector & operator+=(const Basic3DVector< U > &p)