![]() |
Leviathan
0.8.0.0
Leviathan game engine
|
Iterator class for getting parts of a string. More...
#include <StringIterator.h>
Public Member Functions | |
DLLEXPORT | StringIterator (std::unique_ptr< StringDataIterator > &&iterator) |
Creates a iterator from the iterating object. More... | |
DLLEXPORT | StringIterator (const std::wstring &text) |
Helper constructor for common string type. More... | |
DLLEXPORT | StringIterator (const std::string &text) |
Helper constructor for common string type. More... | |
DLLEXPORT | StringIterator (const std::wstring *text) |
Helper constructor for common string type. More... | |
DLLEXPORT | StringIterator (const std::string *text) |
Helper constructor for common string type. More... | |
DLLEXPORT | StringIterator () |
Creates an empty iterator. More... | |
virtual DLLEXPORT | ~StringIterator () |
DLLEXPORT void | ReInit (std::unique_ptr< StringDataIterator > &&iterator) |
Changes the current iterator to the new iterator and goes to the beginning. More... | |
DLLEXPORT void | ReInit (const std::wstring &text) |
Helper function for ReInit for common string type. More... | |
DLLEXPORT void | ReInit (const std::string &text) |
Helper function for ReInit for common string type. More... | |
DLLEXPORT void | ReInit (const std::wstring *text) |
Helper function for ReInit for common string type. More... | |
DLLEXPORT void | ReInit (const std::string *text) |
Helper function for ReInit for common string type. More... | |
template<class RStrType > | |
std::unique_ptr< RStrType > | GetStringInQuotes (QUOTETYPE quotes, int specialflags=0) |
Gets the next string in quotes. More... | |
template<class RStrType > | |
std::unique_ptr< RStrType > | GetNextNumber (DECIMALSEPARATORTYPE decimal, int specialflags=0) |
Gets the next number. More... | |
template<class RStrType > | |
std::unique_ptr< RStrType > | GetNextCharacterSequence (int stopcaseflags, int specialflags=0) |
Gets the next sequence of characters according to stopcaseflags. More... | |
template<class RStrType > | |
std::unique_ptr< RStrType > | GetUntilEqualityAssignment (EQUALITYCHARACTER stopcase, int specialflags=0) |
Gets the string that is before the equality assignment. More... | |
template<class RStrType > | |
std::unique_ptr< RStrType > | GetUntilEnd () |
Gets all characters until the end. More... | |
template<class RStrType > | |
std::unique_ptr< RStrType > | GetUntilLineEnd () |
Gets all characters until a line end. More... | |
template<class RStrType > | |
std::unique_ptr< RStrType > | GetUntilNextCharacterOrNothing (int charactertolookfor, int specialflags=0) |
Gets characters until a character or nothing if the specified character is not found. More... | |
template<class RStrType > | |
std::unique_ptr< RStrType > | GetUntilNextCharacterOrAll (int charactertolookfor, int specialflags=0) |
Gets characters until a character or all remaining characters. More... | |
template<class RStrType > | |
std::unique_ptr< RStrType > | GetUntilCharacterSequence (const RStrType &findstr, int specialflags=0) |
Gets all characters until a sequence is matched. More... | |
template<class RStrType > | |
std::unique_ptr< RStrType > | GetStringInBracketsRecursive (int specialflags=0) |
Gets characters inside brackets. More... | |
void | SkipWhiteSpace (int specialflags=0) |
Skips until characters that are not whitespace are found. More... | |
void | SkipCharacters (int chartoskip, int additionalflag=0, int specialflags=0) |
Skips until chartoskip doesn't match the current character. More... | |
size_t | GetPosition () |
Returns the current reading position. More... | |
size_t | GetCurrentLine () |
Returns the current line the processing is happening. More... | |
int | GetCharacter (size_t forward=0) |
Gets the character in the position current + forward. More... | |
bool | IsAtNewLine () |
Returns true if current character is a new line. More... | |
DLLEXPORT int | GetPreviousCharacter () |
Gets the previous character. More... | |
size_t | GetLastValidCharIndex () const |
Returns the last valid index on the iterator. More... | |
bool | MoveToNext () |
Skips the current character and moves to the next. More... | |
DLLEXPORT void | SkipLineEnd () |
Skips characters until the line number changes. More... | |
bool | IsOutOfBounds () |
Returns true when the read position is valid. More... | |
bool | IsInsideString () |
bool | IsInsideComment () |
template<class STRSType > | |
std::unique_ptr< STRSType > | GetSubstringFromIndexes (size_t firstcharacter, size_t lastcharacter) const |
Returns substring from the wanted indexes. More... | |
IteratorFindUntilData | GetPositionsUntilACharacter (int character, int specialflags=0) |
Gets the position of the current character and the specified character. More... | |
Iterator class for getting parts of a string.
Definition at line 135 of file StringIterator.h.
DLLEXPORT Leviathan::StringIterator::StringIterator | ( | std::unique_ptr< StringDataIterator > && | iterator | ) |
Creates a iterator from the iterating object.
Definition at line 10 of file StringIterator.cpp.
DLLEXPORT Leviathan::StringIterator::StringIterator | ( | const std::wstring & | text | ) |
DLLEXPORT Leviathan::StringIterator::StringIterator | ( | const std::string & | text | ) |
DLLEXPORT Leviathan::StringIterator::StringIterator | ( | const std::wstring * | text | ) |
Helper constructor for common string type.
text | Pointer to a string that won't be deleted by this |
Definition at line 24 of file StringIterator.cpp.
DLLEXPORT Leviathan::StringIterator::StringIterator | ( | const std::string * | text | ) |
Helper constructor for common string type.
text | Pointer to a string that won't be deleted by this |
Definition at line 28 of file StringIterator.cpp.
DLLEXPORT StringIterator::StringIterator | ( | ) |
Creates an empty iterator.
Use ReInit to fill with data
Definition at line 8 of file StringIterator.cpp.
|
virtual |
Definition at line 32 of file StringIterator.cpp.
|
inlineprotected |
Definition at line 1049 of file StringIterator.h.
|
inlineprotected |
Definition at line 1585 of file StringIterator.h.
|
inlineprotected |
Definition at line 1167 of file StringIterator.h.
|
inlineprotected |
Definition at line 1253 of file StringIterator.h.
|
inlineprotected |
Definition at line 1330 of file StringIterator.h.
|
inlineprotected |
Definition at line 1546 of file StringIterator.h.
|
inlineprotected |
Definition at line 1639 of file StringIterator.h.
|
inlineprotected |
Definition at line 1458 of file StringIterator.h.
|
inline |
Gets the character in the position current + forward.
Definition at line 501 of file StringIterator.h.
|
inline |
Returns the current line the processing is happening.
Definition at line 494 of file StringIterator.h.
|
inline |
Returns the last valid index on the iterator.
Definition at line 549 of file StringIterator.h.
|
inline |
Gets the next sequence of characters according to stopcaseflags.
stopcaseflags | Specifies until what type of characters this string is read. Should be created by using UNNORMALCHARACTER as bit flags inside the argument int |
Definition at line 238 of file StringIterator.h.
|
inline |
Gets the next number.
This function will skip until it finds a number and returns the number string according to the decimal parameter. If the type is DECIMALSEPARATORTYPE_NONE decimal numbers are only read until the dot
Definition at line 207 of file StringIterator.h.
|
inline |
Returns the current reading position.
Definition at line 487 of file StringIterator.h.
|
inline |
Gets the position of the current character and the specified character.
Definition at line 626 of file StringIterator.h.
DLLEXPORT int Leviathan::StringIterator::GetPreviousCharacter | ( | ) |
Gets the previous character.
Definition at line 82 of file StringIterator.cpp.
|
inline |
Gets characters inside brackets.
This function will skip until it finds a a left bracket '[' and then returns the content inside keeping track of the number of '[' and ']' characters encountered and returns once the top level brackets close
Definition at line 429 of file StringIterator.h.
|
inline |
Gets the next string in quotes.
This function will skip until it finds a quote (either " or ' specified by quotes) and then returns the content inside
Definition at line 180 of file StringIterator.h.
|
inline |
Returns substring from the wanted indexes.
Definition at line 605 of file StringIterator.h.
|
inline |
Gets all characters until a sequence is matched.
Definition at line 394 of file StringIterator.h.
|
inline |
Gets all characters until the end.
Definition at line 297 of file StringIterator.h.
|
inline |
Gets the string that is before the equality assignment.
This function will read until either : or = is encountered specified by stopcase
Definition at line 267 of file StringIterator.h.
|
inline |
Gets all characters until a line end.
This function will read until a new line character and end after it
Definition at line 309 of file StringIterator.h.
|
inline |
Gets characters until a character or all remaining characters.
This function will read until charactertolookfor and return the string without charactertolookfor, or if not found until the end
charactertolookfor | The code point to look for |
Definition at line 368 of file StringIterator.h.
|
inline |
Gets characters until a character or nothing if the specified character is not found.
This function will read until charactertolookfor and return the string without charactertolookfor, or if not found nothing
charactertolookfor | The code point to look for |
Definition at line 344 of file StringIterator.h.
|
inline |
Returns true if current character is a new line.
Definition at line 535 of file StringIterator.h.
|
inline |
Definition at line 597 of file StringIterator.h.
|
inline |
Definition at line 591 of file StringIterator.h.
|
inline |
Returns true when the read position is valid.
Definition at line 584 of file StringIterator.h.
|
inline |
Skips the current character and moves to the next.
Definition at line 558 of file StringIterator.h.
DLLEXPORT void StringIterator::ReInit | ( | std::unique_ptr< StringDataIterator > && | iterator | ) |
Changes the current iterator to the new iterator and goes to the beginning.
Definition at line 40 of file StringIterator.cpp.
DLLEXPORT void Leviathan::StringIterator::ReInit | ( | const std::wstring & | text | ) |
Helper function for ReInit for common string type.
Definition at line 62 of file StringIterator.cpp.
DLLEXPORT void Leviathan::StringIterator::ReInit | ( | const std::string & | text | ) |
Helper function for ReInit for common string type.
Definition at line 67 of file StringIterator.cpp.
DLLEXPORT void Leviathan::StringIterator::ReInit | ( | const std::wstring * | text | ) |
Helper function for ReInit for common string type.
text | Pointer to a string that won't be deleted by this |
Definition at line 72 of file StringIterator.cpp.
DLLEXPORT void Leviathan::StringIterator::ReInit | ( | const std::string * | text | ) |
Helper function for ReInit for common string type.
text | Pointer to a string that won't be deleted by this |
Definition at line 77 of file StringIterator.cpp.
|
inline |
Skips until chartoskip doesn't match the current character.
chartoskip | The code point to skip |
additionalflag | Flag composing of UNNORMALCHARACTER_TYPE which defines additional things to skip |
Definition at line 463 of file StringIterator.h.
DLLEXPORT void Leviathan::StringIterator::SkipLineEnd | ( | ) |
Skips characters until the line number changes.
Definition at line 95 of file StringIterator.cpp.
|
inlineprotected |
Definition at line 1420 of file StringIterator.h.
|
inline |
Skips until characters that are not whitespace are found.
Definition at line 452 of file StringIterator.h.