Actin®  Version 5.2.0
Software for Robotics Simulation and Control
EcToken Class Reference

An EcString-like class that holds a tag and a namespace. More...

#include <ecToken.h>

Public Member Functions

 EcToken ()
 default constructor
 
 EcToken (const EcString &token)
 constructor from EcString reference (implicit construction okay)
 
 EcToken (const char *token)
 constructor from char* (implicit construction okay)
 
 EcToken (const EcString &xmlNamespace, const EcString &token)
 constructor from namespace/EcString pair
 
 ~EcToken ()
 destructor
 
 EcToken (const EcToken &orig)
 copy constructor
 
EcTokenoperator= (const EcToken &orig)
 assignment operator
 
EcBoolean operator== (const EcToken &orig) const
 equality operator
 
EcBoolean operator!= (const EcToken &orig) const
 inequality operator
 
EcBoolean operator< (const EcToken &orig) const
 less-than operator
 
const EcStringxmlNamespace () const
 get namespace
 
const EcStringtoken () const
 get token
 
EcString namespaceAndToken () const
 get namespace/token pair
 
void strip ()
 Remove leading and trailing whitespace.
 
EcTokenoperator= (const EcString &token)
 operator=
 
EcTokenoperator+= (const EcString &token)
 operator+=
 
EcBoolean operator== (const EcString &orig) const
 operator==
 
EcSizeT size () const
 return length of sequence
 
EcSizeT length () const
 return length of sequence
 
void resize (EcSizeT n)
 resizes the token string to size n
 
void clear ()
 clears the token string
 
EcBoolean empty () const
 returns true if string is empty
 
EcStringappend (const EcString &str)
 Appends a copy of string str. More...
 
EcStringappend (const EcString &str, EcSizeT pos, EcSizeT n)
 Appends a copy of string str to the token at the position. More...
 
EcStringappend (const char *s, EcSizeT n)
 Appends a copy of the first n characters in the array of characters pointed by s. More...
 
void assign (const EcString &)
 Assigns a new value to the string, replacing its current contents.
 
EcStringerase (EcSizeT pos=0, EcSizeT n=EcString::npos)
 Erases part of the string.
 
EcSizeT copy (char *s, EcSizeT n, EcSizeT pos=0)
 Copies part of the string.
 
void swap (EcString &str)
 Swaps the string.
 
const char * c_str () const
 returns const pointer to the character array for the string
 
EcSizeT find (const EcString &str, EcSizeT pos=0) const
 find EcString& str More...
 
EcSizeT find (const char *s, EcSizeT pos, EcSizeT n) const
 find const char* s More...
 
EcSizeT find (const char *s, EcSizeT pos=0) const
 find const char* s More...
 
EcSizeT find (char c, EcSizeT pos=0) const
 find const char c More...
 
EcString substr (EcSizeT pos=0, EcSizeT n=EcString::npos) const
 substr More...
 
 operator const EcString & () const
 Provide implicit type-casting from EcToken to EcString.
 

Protected Attributes

EcString m_Token
 The token string.
 
EcString m_XmlNamespace
 The XML namespace string.
 

Detailed Description

An EcString-like class that holds a tag and a namespace.

Examples:
ecCirclePathExampleDirectionEditor.cpp, ecTimedWaitExampleDirectionEditor.cpp, and ecXmlMain.cpp.

Definition at line 41 of file ecToken.h.

Member Function Documentation

EcString& EcToken::append ( const EcString str)

Appends a copy of string str.

Parameters
str
Returns
*this
EcString& EcToken::append ( const EcString str,
EcSizeT  pos,
EcSizeT  n 
)

Appends a copy of string str to the token at the position.

Parameters
stranother string object, whose value is appended
posposition of the first character in str that is copied to the object as a substring
nnumber of characters to copy
Returns
*this
EcString& EcToken::append ( const char *  s,
EcSizeT  n 
)

Appends a copy of the first n characters in the array of characters pointed by s.

Parameters
spointer to an array of characters
nnumber of characters to copy
Returns
*this
EcSizeT EcToken::find ( const EcString str,
EcSizeT  pos = 0 
) const

find EcString& str

Parameters
[in]stranother string
[in]posPosition of the first character in the string to be considered in the search
Returns
The position of the first character of the first match
EcSizeT EcToken::find ( const char *  s,
EcSizeT  pos,
EcSizeT  n 
) const

find const char* s

Parameters
[in]sanother string
[in]posPosition of the first character in the string to be considered in the search
[in]nLength of sequence of characters to match
Returns
The position of the first character of the first match
EcSizeT EcToken::find ( const char *  s,
EcSizeT  pos = 0 
) const

find const char* s

Parameters
[in]sanother string
[in]posPosition of the first character in the string to be considered in the search
Returns
The position of the first character of the first match
EcSizeT EcToken::find ( char  c,
EcSizeT  pos = 0 
) const

find const char c

Parameters
[in]canother string
[in]posPosition of the first character in the string to be considered in the search
Returns
The position of the first character of the first match
EcString EcToken::substr ( EcSizeT  pos = 0,
EcSizeT  n = EcString::npos 
) const

substr

Parameters
posPosition of the first character to be copied as a substring
nNumber of characters to include in the substring
Returns
A string object with a substring of this object.

The documentation for this class was generated from the following file:
Created by Energid Technologies www.energid.com
Copyright © 2016 Energid. All trademarks mentioned in this document are property of their respective owners.