A input token. More...
Public Member Functions | |
Token () | |
Token () | |
Token (Kind iType) | |
Token (Kind iType) | |
Token (Kind iType, const char *iString, size_t iLength) | |
Token (Kind iType, const char *iString, size_t iLength) | |
Token (const Token &iOther) | |
Token (const Token &iOther) | |
~Token () | |
~Token () | |
void | Append (const char *iString, size_t iLength) |
Append a string to this token. More... | |
void | Append (const char *iString, size_t iLength) |
Append a string to this token. More... | |
void | Append (const Token &iOther) |
Append a token to this token. More... | |
void | Append (const Token &iOther) |
Append a token to this token. More... | |
void | AppendNL (int iCount) |
Append given number of newlines to this token. More... | |
void | AppendNL (int iCount) |
Append given number of newlines to this token. More... | |
int | CountNL () |
Count number of newlines in this token. More... | |
int | CountNL () |
Count number of newlines in this token. More... | |
bool | GetValue (long &oValue) const |
Get the numeric value of the token. More... | |
bool | GetValue (long &oValue) const |
Get the numeric value of the token. More... | |
Token & | operator= (const Token &iOther) |
Assignment operator. More... | |
Token & | operator= (const Token &iOther) |
Assignment operator. More... | |
bool | operator== (const Token &iOther) |
Test two tokens for equality. More... | |
bool | operator== (const Token &iOther) |
Test two tokens for equality. More... | |
void | SetValue (long iValue) |
Set the numeric value of the token. More... | |
void | SetValue (long iValue) |
Set the numeric value of the token. More... | |
Public Attributes | |
union { | |
char * Buffer | |
A memory-allocated string. More... | |
const char * String | |
A pointer somewhere into the input buffer. More... | |
}; | |
union { | |
char * Buffer | |
A memory-allocated string. More... | |
const char * String | |
A pointer somewhere into the input buffer. More... | |
}; | |
size_t | Allocated |
True if string was allocated (and must be freed) More... | |
size_t | Length |
Token length in bytes. More... | |
Kind | Type |
Token type. More... | |
A input token.
For performance reasons most tokens will point to portions of the input stream, so no unneeded memory allocation is done. However, in some cases we must allocate different memory for token storage, in this case this is signalled by setting the Allocated member to non-zero in which case the destructor will know that it must free memory on object destruction.
Again for performance reasons we use malloc/realloc/free here because C++-style new[] lacks the realloc() counterpart.
Definition at line 76 of file Plus/src/GLSL/include/OgreGLSLPreprocessor.h.
Definition at line 79 of file Plus/src/GLSL/include/OgreGLSLPreprocessor.h.
Definition at line 79 of file OgreGLSLESPreprocessor.h.
Ogre::CPreprocessor::Token::Token | ( | ) |
Definition at line 110 of file Plus/src/GLSL/include/OgreGLSLPreprocessor.h.
Referenced by operator==().
Ogre::CPreprocessor::Token::Token | ( | Kind | iType | ) |
Definition at line 113 of file Plus/src/GLSL/include/OgreGLSLPreprocessor.h.
Ogre::CPreprocessor::Token::Token | ( | Kind | iType, |
const char * | iString, | ||
size_t | iLength | ||
) |
Definition at line 116 of file Plus/src/GLSL/include/OgreGLSLPreprocessor.h.
Ogre::CPreprocessor::Token::Token | ( | const Token & | iOther | ) |
Ogre::CPreprocessor::Token::~Token | ( | ) |
Definition at line 129 of file Plus/src/GLSL/include/OgreGLSLPreprocessor.h.
References Buffer.
Ogre::CPreprocessor::Token::Token | ( | ) |
Definition at line 110 of file OgreGLSLESPreprocessor.h.
Ogre::CPreprocessor::Token::Token | ( | Kind | iType | ) |
Definition at line 113 of file OgreGLSLESPreprocessor.h.
Ogre::CPreprocessor::Token::Token | ( | Kind | iType, |
const char * | iString, | ||
size_t | iLength | ||
) |
Definition at line 116 of file OgreGLSLESPreprocessor.h.
Ogre::CPreprocessor::Token::Token | ( | const Token & | iOther | ) |
Definition at line 120 of file OgreGLSLESPreprocessor.h.
Ogre::CPreprocessor::Token::~Token | ( | ) |
Definition at line 129 of file OgreGLSLESPreprocessor.h.
References Buffer.
void Ogre::CPreprocessor::Token::Append | ( | const char * | iString, |
size_t | iLength | ||
) |
Append a string to this token.
Referenced by operator=().
void Ogre::CPreprocessor::Token::Append | ( | const char * | iString, |
size_t | iLength | ||
) |
Append a string to this token.
void Ogre::CPreprocessor::Token::Append | ( | const Token & | iOther | ) |
Append a token to this token.
void Ogre::CPreprocessor::Token::Append | ( | const Token & | iOther | ) |
Append a token to this token.
void Ogre::CPreprocessor::Token::AppendNL | ( | int | iCount | ) |
Append given number of newlines to this token.
Referenced by operator=().
void Ogre::CPreprocessor::Token::AppendNL | ( | int | iCount | ) |
Append given number of newlines to this token.
int Ogre::CPreprocessor::Token::CountNL | ( | ) |
Count number of newlines in this token.
Referenced by operator=().
int Ogre::CPreprocessor::Token::CountNL | ( | ) |
Count number of newlines in this token.
bool Ogre::CPreprocessor::Token::GetValue | ( | long & | oValue | ) | const |
Get the numeric value of the token.
Referenced by operator=(), and Ogre::CPreprocessor::Macro::~Macro().
bool Ogre::CPreprocessor::Token::GetValue | ( | long & | oValue | ) | const |
Get the numeric value of the token.
Assignment operator.
Definition at line 133 of file Plus/src/GLSL/include/OgreGLSLPreprocessor.h.
References Allocated, Append(), AppendNL(), Buffer, CountNL(), GetValue(), Length, SetValue(), String, and Type.
Assignment operator.
Definition at line 133 of file OgreGLSLESPreprocessor.h.
References Append(), AppendNL(), Buffer, CountNL(), GetValue(), and SetValue().
bool Ogre::CPreprocessor::Token::operator== | ( | const Token & | iOther | ) |
Test two tokens for equality.
Definition at line 163 of file OgreGLSLESPreprocessor.h.
References Token().
bool Ogre::CPreprocessor::Token::operator== | ( | const Token & | iOther | ) |
Test two tokens for equality.
Definition at line 163 of file Plus/src/GLSL/include/OgreGLSLPreprocessor.h.
void Ogre::CPreprocessor::Token::SetValue | ( | long | iValue | ) |
Set the numeric value of the token.
Referenced by operator=().
void Ogre::CPreprocessor::Token::SetValue | ( | long | iValue | ) |
Set the numeric value of the token.
union { ... } |
union { ... } |
|
mutable |
True if string was allocated (and must be freed)
Definition at line 99 of file Plus/src/GLSL/include/OgreGLSLPreprocessor.h.
Referenced by operator=(), and Token().
char* Ogre::CPreprocessor::Token::Buffer |
A memory-allocated string.
Definition at line 105 of file Plus/src/GLSL/include/OgreGLSLPreprocessor.h.
Referenced by operator=(), and ~Token().
size_t Ogre::CPreprocessor::Token::Length |
Token length in bytes.
Definition at line 108 of file Plus/src/GLSL/include/OgreGLSLPreprocessor.h.
Referenced by operator=(), operator==(), and Token().
const char* Ogre::CPreprocessor::Token::String |
A pointer somewhere into the input buffer.
Definition at line 103 of file Plus/src/GLSL/include/OgreGLSLPreprocessor.h.
Referenced by operator=(), operator==(), and Token().
Kind Ogre::CPreprocessor::Token::Type |
Token type.
Definition at line 97 of file Plus/src/GLSL/include/OgreGLSLPreprocessor.h.
Referenced by operator=(), and Token().
Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Sun Oct 22 2017 04:04:15