|
|||
|
|||
|
#include <hashcomp.h>
Inheritance diagram for irc::tokenstream:


Public Member Functions | |
| tokenstream (const std::string &source) | |
| Create a tokenstream and fill it with the provided data. | |
| ~tokenstream () | |
| Destructor. | |
| bool | GetToken (std::string &token) |
| Fetch the next token from the stream as a std::string. | |
| bool | GetToken (irc::string &token) |
| Fetch the next token from the stream as an irc::string. | |
| bool | GetToken (int &token) |
| Fetch the next token from the stream as an integer. | |
| bool | GetToken (long &token) |
| Fetch the next token from the stream as a long integer. | |
Private Attributes | |
| std::string | tokens |
| Original string. | |
| std::string::iterator | last_starting_position |
| Last position of a seperator token. | |
| std::string::iterator | n |
| Current string position. | |
| bool | last_pushed |
| True if the last value was an ending value. | |
It will split the string into 'tokens' each containing one parameter from the string. For instance, if it is instantiated with the string: "PRIVMSG #test :foo bar baz qux" then each successive call to tokenstream::GetToken() will return "PRIVMSG", "#test", "foo bar baz qux", "". Note that if the whole string starts with a colon this is not taken to mean the string is all one parameter, and the first item in the list will be ":item". This is to allow for parsing 'source' fields from data.
Definition at line 280 of file hashcomp.h.
|
|
Create a tokenstream and fill it with the provided data.
Definition at line 160 of file hashcomp.cpp. References last_starting_position, n, and tokens. |
|
|
Destructor.
Definition at line 167 of file hashcomp.cpp. |
|
|
Fetch the next token from the stream as a long integer.
Definition at line 232 of file hashcomp.cpp. References ConvToInt(), and GetToken(). |
|
|
Fetch the next token from the stream as an integer.
Definition at line 224 of file hashcomp.cpp. References ConvToInt(), and GetToken(). |
|
|
Fetch the next token from the stream as an irc::string.
Definition at line 216 of file hashcomp.cpp. References assign(), and GetToken(). |
|
|
Fetch the next token from the stream as a std::string.
Definition at line 171 of file hashcomp.cpp. References last_pushed, last_starting_position, n, and tokens. Referenced by TreeSocket::Capab(), FilterBase::DecodeFilter(), ModuleAlias::DoCommand(), TreeSocket::ForceJoin(), GetToken(), CommandParser::ProcessCommand(), ModuleXLineDB::ReadDatabase(), and TreeSocket::Split(). |
|
|
True if the last value was an ending value.
Definition at line 298 of file hashcomp.h. Referenced by GetToken(). |
|
|
Last position of a seperator token.
Definition at line 290 of file hashcomp.h. Referenced by GetToken(), and tokenstream(). |
|
|
Current string position.
Definition at line 294 of file hashcomp.h. Referenced by GetToken(), and tokenstream(). |
|
|
Original string.
Definition at line 286 of file hashcomp.h. Referenced by GetToken(), and tokenstream(). |