Jameo Core Library
Loading...
Searching...
No Matches
Public Member Functions | List of all members
jm::StringTokenizer Class Reference

The StringTokenizer class is used to tokenize a string based on specified delimiters. It splits the string into individual pieces. More...

Inheritance diagram for jm::StringTokenizer:
jm::Object

Public Member Functions

 StringTokenizer (const String &str, const String &delimiter, bool retDelim)
 Constructor.
 
bool hasNext ()
 Returns whether there are more tokens in the string.
 
String next ()
 Returns the next token.
 
- Public Member Functions inherited from jm::Object
 Object () noexcept
 Constructor.
 
virtual ~Object () noexcept
 Destructor.
 
void release () noexcept
 Decreases the reference counter and releases the object immediately when the reference counter becomes 0.
 
Objectretain () noexcept
 Increases the reference counter of this object by 1.
 
Objectautorelease () noexcept
 Same function as release(), but releases the object with a delay if the reference counter is 0. AutoreleasePool::drain() must be called in the to release the object.
 
int32 referenceCount () const noexcept
 Returns the value of the reference counter.
 
virtual bool equals (const Object *other) const
 Comparison of objects.
 
virtual String displayName () const
 Returns the display name of the object intended to present to a user.
 
virtual void printDiffInfo (DiffOperation operation, Object *other) const
 Output method for outputting the diff results for the diff algorithm.
 
void setHighBit (bool status) noexcept
 
bool highBit () const noexcept
 

Detailed Description

The StringTokenizer class is used to tokenize a string based on specified delimiters. It splits the string into individual pieces.

Constructor & Destructor Documentation

◆ StringTokenizer()

jm::StringTokenizer::StringTokenizer ( const String str,
const String delimiter,
bool  retDelim 
)

Constructor.

Parameters
strThe string to be analyzed.
delimiterThe delimiters used to split the string. Each character is considered as a delimiter.
retDelimStatus indicating whether the delimiters should be treated as separate tokens and returned or not.

Member Function Documentation

◆ hasNext()

bool jm::StringTokenizer::hasNext ( )

Returns whether there are more tokens in the string.

◆ next()

String jm::StringTokenizer::next ( )

Returns the next token.

Exceptions
Exceptionif no token is available.