#include <string_cursor.hpp>
A simple cursor class to traverse forward through a character array.
◆ string_cursor()
matador::string_cursor::string_cursor |
( |
const char * |
str | ) |
|
|
explicit |
Initializes the cursor with the given string
- Parameters
-
str | String to initialize the cursor with |
◆ current_char()
char matador::string_cursor::current_char |
( |
| ) |
const |
Returns the current character of the string
- Returns
- The current character
◆ is_null()
bool matador::string_cursor::is_null |
( |
| ) |
const |
|
inline |
Checks if the current cursor is a nullptr
- Returns
- True if current cursor position is nullptr
◆ next_char()
char matador::string_cursor::next_char |
( |
| ) |
|
Increments cursor position and returns this character.
- Returns
- Next character in string
◆ operator()()
const char * matador::string_cursor::operator() |
( |
| ) |
const |
|
inline |
Returns the current cursor
- Returns
- The current cursor
◆ operator=()
string_cursor & matador::string_cursor::operator= |
( |
const char * |
str | ) |
|
Assign a string to the cursor class
- Parameters
-
- Returns
- The assigned cursor
◆ operator[]()
char matador::string_cursor::operator[] |
( |
int |
i | ) |
const |
|
inline |
Gets the character at position i
- Parameters
-
i | Requested character position |
- Returns
- The requested character
◆ skip_whitespace()
char matador::string_cursor::skip_whitespace |
( |
| ) |
|
Skips whitespace for the cursor and returns the first character not a whitespace
- Returns
- First character not a whitespace
◆ sync_cursor()
void matador::string_cursor::sync_cursor |
( |
const char * |
cursor | ) |
|
|
inline |
Syncs the cursor with the new given cursor
- Parameters
-
The documentation for this class was generated from the following file:
- matador/utils/string_cursor.hpp