Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
StringSplit Class Reference

#include <elm/string/Split.h>

Public Member Functions

 StringSplit (void)
 
 StringSplit (const String &str, char chr)
 
 StringSplit (const String &str, String sub)
 
bool ended (void) const
 
String item (void) const
 
void next (void)
 
bool equals (const StringSplit &sp) const
 
 operator bool () const
 
 operator String () const
 
String operator* () const
 
StringSplitoperator++ ()
 
StringSplit operator++ (int)
 
bool operator== (const StringSplit &sp) const
 
bool operator!= (const StringSplit &sp) const
 

Detailed Description

This is an helper class to split a string in sub-parts using a separator (character or string). At each iteration, the next separated part is provided.

Notice that the split of an empty string iterates exactly once and its unique value is the empty string.

Constructor & Destructor Documentation

◆ StringSplit() [1/3]

StringSplit ( void  )
inline

◆ StringSplit() [2/3]

StringSplit ( const String str,
char  chr 
)
inline

◆ StringSplit() [3/3]

StringSplit ( const String str,
String  sub 
)
inline

Member Function Documentation

◆ ended()

bool ended ( void  ) const
inline

References String::length().

Referenced by StringSplit::operator bool().

◆ equals()

bool equals ( const StringSplit sp) const
inline

◆ item()

String item ( void  ) const
inline

◆ next()

void next ( void  )
inline

References String::length().

Referenced by StringSplit::operator++().

◆ operator bool()

operator bool ( ) const
inline

References StringSplit::ended().

◆ operator String()

operator String ( ) const
inline

References StringSplit::item().

◆ operator!=()

bool operator!= ( const StringSplit sp) const
inline

References StringSplit::equals().

◆ operator*()

String operator* ( ) const
inline

References StringSplit::item().

◆ operator++() [1/2]

StringSplit& operator++ ( )
inline

References StringSplit::next().

◆ operator++() [2/2]

StringSplit operator++ ( int  )
inline

References StringSplit::next().

◆ operator==()

bool operator== ( const StringSplit sp) const
inline

References StringSplit::equals().


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