class for string and substring of char.
class for string and substring of char. The class include head and tail pointer of the string.
If this SubString begins the specified prefix,
then pop the prefix part and move the head pointer to the
next of it.
It returns the position of the first c from the head pointer.
If the char does not exist, it returns -1.
It returns Bool value instead of index value.
It allocates the new area and copy contents from the str.
After this operation, this SubString and the src SubString
share the same head and tail pointer.
After this operation, this SubString becomes a substring of
the src SubString.
After this operation, this SubString becomes a substring of
the src SubString.
In this case, tails of both SubStrings are the same.
The null string is that both of head and tail are the null pointer.
(see isNullStr()).
If forcep==True, then it allocates new are even if
this SubString already has the enough space.
It is same as (tail-head).
It is the same as length()+1.
But, this is not safe that the SubString is not allocated by
null-terminated c-string.
It changes tail pointer to be head+1.
If allocp==True, then it allocates the new area.
If allocp==True, then it allocates the new area.
If t==null, then it copy until the null character appear.
It create a new SubString and copy the contents of this SubString.
It create a new c-string and copy the contents of this SubString.
If maxlen is specified, then it copy maxlen characters in maximum.
It put the null char to the tail.
It checks the SubString contains the null character.
It returns True if this SubString's head and tail is the same.
It is useful for checking overrun as a buffer.
It returns a substring that starts the head and has the length.
It shift the head pointer to the tail of the popped SubString.
It shift the head pointer to the tail of the popped SubString.
SubString(const UInt size)
SubString(char* h, char* t)
SubString(char* h, const UInt l)
SubString(char* str = ITK_NULLPTR)
SubString(const SubString& src)
SubString(const SubString& src, const UInt hidx, const UInt tidx)
SubString& operator= (const SubString& s)
SubString& operator= (char* s)
SubString& operator= (const char * s)
Bool eq(const SubString& r) const
Bool equal(const SubString& r) const
Bool operator== (const SubString& r) const
Bool operator== (const char* ref) const
static Bool less(const SubString & str0, const SubString & str1)
static Bool greater(const SubString & str0, const SubString & str1)
static Bool lessequal(const SubString & str0, const SubString & str1)
static Bool greaterequal(const SubString & str0, const SubString & str1)
Bool operator<(const SubString & ref) const
Bool operator<=(const SubString & ref) const
Bool operator>(const SubString & ref) const
Bool operator>=(const SubString & ref) const
Bool operator<(const char* ref) const
Bool operator<=(const char* ref) const
Bool operator>(const char* ref) const
Bool operator>=(const char* ref) const
Bool isPrefixOf(const SubString& ref) const
Bool isPrefixOf(const char* const ref) const
Bool hasPrefix(const SubString& prefix) const
Bool hasPrefix(const char* const ref) const
Bool checkPopPrefix(const SubString & prefix)
Bool checkPopPrefix(const char * const prefix)
Int index(const char c) const
Bool has(const char c) const
void set(char* h, char* t)
void set(char* h, const UInt l)
void set(char* str = ITK_NULLPTR)
void set(const char * str)
void set(const SubString& src)
void set(const SubString& src, const UInt hidx, const UInt tidx)
void set(const SubString& src, const UInt hidx)
void setNull()
Bool isNullPtr() const
Bool alloc(const UInt l, Bool forcep = True)
UInt length() const
UInt size() const
void setLength(const UInt l)
UInt strlength() const
void adjustLength()
Bool copy(const SubString& src, Bool allocp = False)
Bool copy(char* h, char* t, Bool allocp = False)
Bool copy(const char * h, const char * t = ITK_NULLPTR)
SubString dup() const
char* strdup() const
Bool copyTo(char* dst, Int maxlen = -1) const
operator char* () const
void terminate()
Bool terminatedp() const
Bool isTerminated() const
Bool isNullStr() const
char& first() const
char& last() const
Bool isFirst(const char c) const
Bool tailp() const
Bool nullp() const
char popChar()
char getChar()
void chop()
void ungetChar()
void ignoreChar()
Bool skipNChar(UInt n = 1)
UInt skipWhile(const SubString & charlist)
UInt skipUntil(const SubString & charlist)
SubString sub(UInt length) const
SubString sub(UInt offset, UInt length) const
SubString popSubString(UInt length)
SubString popSubString(UInt offset, UInt length)
SubString shiftedSubString(UInt offset) const
void pushChar(const char c)
void putChar(const char c)
void put(const SubString& str)
void put(const char* str)
void put(const char* str, UInt len)