Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

template<typename T>
class Geo::GeoTokenStream

A very simple utility class that wraps some common parsing functionality around a GeoTokenList.

The token list provided in Create is just referenced, not copied, so the token list must out-live this class.

Functions

NameDescription
Create(GeoTokenList< T > &)

Creates a GeoTokenStream which reads from the given GeoTokenList.

GetCurrentTokenIdx()

Gets the index of the current token.

GetLastErrorString()

Gets a textual description of the last parsing error encountered.

HasMoreTokens()

Checks if there are more tokens to read.

Release()

Destroys this GeoTokenStream.

ResetStream()

Resets the stream to the beginning of the token list.

SetCurrentTokenIdx(s32)

Sets the stream position to the given token index.

TokenExtract(GeoString< T > &)

Parses the current token into the appropriate type, and advances the stream if successful.

TokenExtract(float &)

Parses the current token into the appropriate type, and advances the stream if successful.

TokenExtract(v128 &, bool)

Parses the current token into the appropriate type, and advances the stream if successful.

TokenExtract(u16 &)

Parses the current token into the appropriate type, and advances the stream if successful.

TokenExtract(s32 &)

Parses the current token into the appropriate type, and advances the stream if successful.

TokenExtract(bool &)

Parses the current token into the appropriate type, and advances the stream if successful.

TokenExtract(ENUM &, const T **, const T **)

Parses the current token into an enum, and advances the stream if successful.

TokenMatch(const T *, bool)

Checks if the current token matches the given string, and advances the stream if successful.

TokenMatchOption(const T **, s32, bool)

Checks if the current token matches the given string, and advances the stream if successful.


Anchor
af1b1e34a97ae55356f6225817eb2665c
af1b1e34a97ae55356f6225817eb2665c

static GeoTokenStream* Geo::GeoTokenStream< T >::Create

...

public: GeoTokenStream * Create
(
    GeoTokenList< T > & tl
)

...

Creates a GeoTokenStream which reads from the given GeoTokenList.


Anchor
ab06ce39009921abef4ec7b67d0e12969
ab06ce39009921abef4ec7b67d0e12969

s32 Geo::GeoTokenStream< T >::GetCurrentTokenIdx

...

public: s32 GetCurrentTokenIdx() const

...

Gets the index of the current token.


Anchor
a7394696a091b071b215f23934fdcb7b7
a7394696a091b071b215f23934fdcb7b7

const char* Geo::GeoTokenStream< T >::GetLastErrorString

...

public: const char * GetLastErrorString() const

...

Gets a textual description of the last parsing error encountered.


Anchor
a4ee3ef7a53599c3e0c0bb4c4a535fa82
a4ee3ef7a53599c3e0c0bb4c4a535fa82

bool Geo::GeoTokenStream< T >::HasMoreTokens

...

public: bool HasMoreTokens() const

...

Checks if there are more tokens to read.


Anchor
ad2174952645fc26d3b79f5b98ebbc5c1
ad2174952645fc26d3b79f5b98ebbc5c1

void Geo::GeoTokenStream< T >::Release

...

public: void Release()

...

Destroys this GeoTokenStream.


Anchor
a20a4cd9a182f735d39e468713d51008f
a20a4cd9a182f735d39e468713d51008f

void Geo::GeoTokenStream< T >::ResetStream

...

public: void ResetStream()

...

Resets the stream to the beginning of the token list.


Anchor
ad38200091588adb519e3c74d2ecc2df3
ad38200091588adb519e3c74d2ecc2df3

void Geo::GeoTokenStream< T >::SetCurrentTokenIdx

...

public: void SetCurrentTokenIdx
(
    s32 idx
)

...

Sets the stream position to the given token index.


Anchor
a40a7482d8c79b4a0e21c367510e9f7f0
a40a7482d8c79b4a0e21c367510e9f7f0

bool Geo::GeoTokenStream< T >::TokenExtract

...

public: bool TokenExtract
(
    GeoString< T > & outStr
)

...

Parses the current token into the appropriate type, and advances the stream if successful.


Anchor
aeb4ead166f456211414da4640573af9f
aeb4ead166f456211414da4640573af9f

bool Geo::GeoTokenStream< T >::TokenExtract

...

public: bool TokenExtract
(
    float & outFloat
)

...

Parses the current token into the appropriate type, and advances the stream if successful.


Anchor
a5754b58a4bad88affdf24be5a15d6b03
a5754b58a4bad88affdf24be5a15d6b03

bool Geo::GeoTokenStream< T >::TokenExtract

...

public: bool TokenExtract
(
    v128 & outVector,
    bool bDefaultW
)

...

Parses the current token into the appropriate type, and advances the stream if successful.


Anchor
ada7702d18471d2eff9223e3f10aab75d
ada7702d18471d2eff9223e3f10aab75d

bool Geo::GeoTokenStream< T >::TokenExtract

...

public: bool TokenExtract
(
    u16 & outShort
)

...

Parses the current token into the appropriate type, and advances the stream if successful.


Anchor
a09625b01cc16df633fb08b6b706695f4
a09625b01cc16df633fb08b6b706695f4

bool Geo::GeoTokenStream< T >::TokenExtract

...

public: bool TokenExtract
(
    s32 & outInt
)

...

Parses the current token into the appropriate type, and advances the stream if successful.


Anchor
ae0337af59a3aee9f73845d1684f24d18
ae0337af59a3aee9f73845d1684f24d18

bool Geo::GeoTokenStream< T >::TokenExtract

...

public: bool TokenExtract
(
    bool & outBool
)

...

Parses the current token into the appropriate type, and advances the stream if successful.


Anchor
aad2252b9307ecbcf0b8b83856775ddb3
aad2252b9307ecbcf0b8b83856775ddb3

bool Geo::GeoTokenStream< T >::TokenExtract

...

public: bool TokenExtract
(
    ENUM & outEnum,
    const T ** pstrBegin,
    const T ** pstrEnd
)

...

Parses the current token into an enum, and advances the stream if successful.


Anchor
a465e45c73d0d640efac1891e8f6dc312
a465e45c73d0d640efac1891e8f6dc312

bool Geo::GeoTokenStream< T >::TokenMatch

...

public: bool TokenMatch
(
    const T * str,
    bool ignoreCase
)

...

Checks if the current token matches the given string, and advances the stream if successful.


Anchor
a0bfa8a2cfea885100c71640772720df0
a0bfa8a2cfea885100c71640772720df0

s32 Geo::GeoTokenStream< T >::TokenMatchOption

...

public: s32 TokenMatchOption
(
    const T ** optionStr,
    s32 numOptions,
    bool ignoreCase
)

...

Checks if the current token matches the given string, and advances the stream if successful.