Back to index

nux  3.0.0
Public Types | Public Member Functions | Static Public Attributes
TiXmlOutStream Class Reference

#include <tinystr.h>

Inheritance diagram for TiXmlOutStream:
Inheritance graph
[legend]
Collaboration diagram for TiXmlOutStream:
Collaboration graph
[legend]

List of all members.

Public Types

typedef size_t size_type

Public Member Functions

TiXmlOutStreamoperator<< (const TiXmlString &in)
TiXmlOutStreamoperator<< (const char *in)
TiXmlStringoperator+= (const char *suffix)
TiXmlStringoperator+= (char single)
TiXmlStringoperator+= (const TiXmlString &suffix)
const char * c_str () const
const char * data () const
size_type length () const
size_type size () const
bool empty () const
size_type capacity () const
const char & at (size_type index) const
char & operator[] (size_type index) const
size_type find (char lookup) const
size_type find (char tofind, size_type offset) const
void clear ()
void reserve (size_type cap)
TiXmlStringassign (const char *str, size_type len)
TiXmlStringappend (const char *str, size_type len)
void swap (TiXmlString &other)

Static Public Attributes

static const size_type npos = static_cast< TiXmlString::size_type > (-1)

Detailed Description

Definition at line 375 of file tinystr.h.


Member Typedef Documentation

typedef size_t TiXmlString::size_type [inherited]

Definition at line 93 of file tinystr.h.


Member Function Documentation

TiXmlString & TiXmlString::append ( const char *  str,
size_type  len 
) [inherited]

Definition at line 97 of file tinystr.cpp.

{
  size_type newsize = length() + len;

  if (newsize > capacity() )
  {
    reserve (newsize + capacity() );
  }

  memmove (finish(), str, len);
  set_size (newsize);
  return *this;
}

Here is the call graph for this function:

Here is the caller graph for this function:

TiXmlString & TiXmlString::assign ( const char *  str,
size_type  len 
) [inherited]

Definition at line 76 of file tinystr.cpp.

{
  size_type cap = capacity();

  if (len > cap || cap > 3 * (len + 8) )
  {
    TiXmlString tmp;
    tmp.init (len);
    memcpy (tmp.start(), str, len);
    swap (tmp);
  }
  else
  {
    memmove (start(), str, len);
    set_size (len);
  }

  return *this;
}

Here is the call graph for this function:

Here is the caller graph for this function:

const char& TiXmlString::at ( size_type  index) const [inline, inherited]

Definition at line 201 of file tinystr.h.

  {
    assert ( index < length() );
    return rep_->str[ index ];
  }

Here is the call graph for this function:

const char* TiXmlString::c_str ( ) const [inline, inherited]

Definition at line 164 of file tinystr.h.

  {
    return rep_->str;
  }

Here is the caller graph for this function:

size_type TiXmlString::capacity ( ) const [inline, inherited]

Definition at line 194 of file tinystr.h.

  {
    return rep_->capacity;
  }

Here is the caller graph for this function:

void TiXmlString::clear ( ) [inline, inherited]

Definition at line 233 of file tinystr.h.

  {
    //Lee:
    //The original was just too strange, though correct:
    // TiXmlString().swap(*this);
    //Instead use the quit & re-init:
    quit();
    init (0, 0);
  }

Here is the call graph for this function:

const char* TiXmlString::data ( ) const [inline, inherited]

Definition at line 170 of file tinystr.h.

  {
    return rep_->str;
  }

Here is the caller graph for this function:

bool TiXmlString::empty ( ) const [inline, inherited]

Definition at line 188 of file tinystr.h.

  {
    return rep_->size == 0;
  }
size_type TiXmlString::find ( char  lookup) const [inline, inherited]

Definition at line 215 of file tinystr.h.

  {
    return find (lookup, 0);
  }
size_type TiXmlString::find ( char  tofind,
size_type  offset 
) const [inline, inherited]

Definition at line 221 of file tinystr.h.

  {
    if (offset >= length() ) return npos;

    for (const char *p = c_str() + offset; *p != '\0'; ++p)
    {
      if (*p == tofind) return static_cast< size_type > ( p - c_str() );
    }

    return npos;
  }

Here is the call graph for this function:

size_type TiXmlString::length ( ) const [inline, inherited]

Definition at line 176 of file tinystr.h.

  {
    return rep_->size;
  }

Here is the caller graph for this function:

TiXmlString& TiXmlString::operator+= ( const char *  suffix) [inline, inherited]

Definition at line 145 of file tinystr.h.

  {
    return append (suffix, static_cast<size_type> ( strlen (suffix) ) );
  }

Here is the call graph for this function:

TiXmlString& TiXmlString::operator+= ( char  single) [inline, inherited]

Definition at line 151 of file tinystr.h.

  {
    return append (&single, 1);
  }

Here is the call graph for this function:

TiXmlString& TiXmlString::operator+= ( const TiXmlString suffix) [inline, inherited]

Definition at line 157 of file tinystr.h.

  {
    return append (suffix.data(), suffix.length() );
  }

Here is the call graph for this function:

TiXmlOutStream& TiXmlOutStream::operator<< ( const TiXmlString in) [inline]

Definition at line 380 of file tinystr.h.

  {
    *this += in;
    return *this;
  }
TiXmlOutStream& TiXmlOutStream::operator<< ( const char *  in) [inline]

Definition at line 387 of file tinystr.h.

  {
    *this += in;
    return *this;
  }
char& TiXmlString::operator[] ( size_type  index) const [inline, inherited]

Definition at line 208 of file tinystr.h.

  {
    assert ( index < length() );
    return rep_->str[ index ];
  }

Here is the call graph for this function:

void TiXmlString::reserve ( size_type  cap) [inherited]

Definition at line 64 of file tinystr.cpp.

{
  if (cap > capacity() )
  {
    TiXmlString tmp;
    tmp.init (length(), cap);
    memcpy (tmp.start(), data(), length() );
    swap (tmp);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

size_type TiXmlString::size ( ) const [inline, inherited]

Definition at line 182 of file tinystr.h.

  {
    return rep_->size;
  }
void TiXmlString::swap ( TiXmlString other) [inline, inherited]

Definition at line 252 of file tinystr.h.

  {
    Rep *r = rep_;
    rep_ = other.rep_;
    other.rep_ = r;
  }

Here is the caller graph for this function:


Member Data Documentation

const TiXmlString::size_type TiXmlString::npos = static_cast< TiXmlString::size_type > (-1) [static, inherited]

Definition at line 96 of file tinystr.h.


The documentation for this class was generated from the following file: