#include <anope.h>
Inherited by commasepstream, and spacesepstream.

Public Member Functions | |
| sepstream (const Anope::string &source, char seperator) | |
| bool | GetToken (Anope::string &token) |
| bool | GetToken (Anope::string &token, int num) |
| template<typename T > | |
| void | GetTokens (T &token) |
| bool | GetTokenRemainder (Anope::string &token, int num) |
| int | NumTokens () |
| const Anope::string | GetRemaining () |
| bool | StreamEnd () |
Private Attributes | |
| Anope::string | tokens |
| Anope::string::iterator | last_starting_position |
| Anope::string::iterator | n |
| char | sep |
sepstream allows for splitting token seperated lists. Each successive call to sepstream::GetToken() returns the next token, until none remain, at which point the method returns an empty string.
Definition at line 544 of file anope.h.
| sepstream::sepstream | ( | const Anope::string & | source, | |
| char | seperator | |||
| ) |
Create a sepstream and fill it with the provided data
Definition at line 77 of file hashcomp.cpp.
References Anope::string::begin(), last_starting_position, n, and tokens.
| const Anope::string sepstream::GetRemaining | ( | ) |
Fetch the entire remaining stream, without tokenizing
Definition at line 136 of file hashcomp.cpp.
References Anope::string::end(), n, and tokens.
Referenced by CommandOSAKill::DoAdd(), GetTokenRemainder(), CommandOSSNLine::OnAdd(), Anope::Process(), MyHTTPClient::Read(), and ReadDatabase().
| bool sepstream::GetToken | ( | Anope::string & | token, | |
| int | num | |||
| ) |
Gets token number 'num' from the stream
| token | The token is placed here | |
| num | The token number to featch |
Definition at line 108 of file hashcomp.cpp.
References GetToken().
| bool sepstream::GetToken | ( | Anope::string & | token | ) |
Fetch the next token from the stream
| token | The next token from the stream is placed here |
Definition at line 82 of file hashcomp.cpp.
References Anope::string::clear(), Anope::string::end(), Anope::string::erase(), last_starting_position, Anope::string::length(), n, Anope::string::rfind(), sep, and tokens.
Referenced by MChanstats::CountSmileys(), CommandOSAKill::DoAdd(), CommandCSMode::DoLock(), DoOperType(), DoServices(), CommandOSMode::Execute(), CommandNSStatus::Execute(), CommandNSList::Execute(), CommandCSList::Execute(), GetToken(), GetTokenRemainder(), MyManager::HandlePacket(), Language::InitLanguages(), NumberList::NumberList(), NumTokens(), CommandOSSNLine::OnAdd(), OSDefcon::OnReload(), MyPacket::PackName(), OSDefcon::ParseModeString(), Anope::Process(), Rewrite::Process(), MyHTTPClient::Read(), ReadDatabase(), Message::Part::Run(), Message::Kick::Run(), Message::Join::Run(), Message::Capab::Run(), IRCDMessageNJoin::Run(), IRCDMessageCapab::Run(), IRCDMessageBMask::Run(), ServerConfig::ServerConfig(), User::SetModes(), Channel::SetModes(), User::SetModesInternal(), Channel::SetModesInternal(), ChannelInfo::Unserialize(), NickCore::Unserialize(), NickAlias::Unserialize(), and ModeManager::UpdateDefaultMLock().
| bool sepstream::GetTokenRemainder | ( | Anope::string & | token, | |
| int | num | |||
| ) |
Gets token number 'num' from the stream and all remaining tokens.
| token | The token is placed here | |
| num | The token number to featch |
Definition at line 123 of file hashcomp.cpp.
References GetRemaining(), GetToken(), sep, and StreamEnd().
| void sepstream::GetTokens | ( | T & | token | ) | [inline] |
| int sepstream::NumTokens | ( | ) |
Determines the number of tokens in this stream.
Definition at line 115 of file hashcomp.cpp.
References GetToken().
| bool sepstream::StreamEnd | ( | ) |
Returns true if the end of the stream has been reached
Definition at line 141 of file hashcomp.cpp.
References Anope::string::end(), n, and tokens.
Referenced by CommandOSAKill::DoAdd(), GetTokenRemainder(), Anope::Process(), and ReadDatabase().
Last position of a seperator token
Definition at line 552 of file anope.h.
Referenced by GetToken(), and sepstream().
Anope::string::iterator sepstream::n [private] |
Current string position
Definition at line 555 of file anope.h.
Referenced by GetRemaining(), GetToken(), sepstream(), and StreamEnd().
char sepstream::sep [private] |
Seperator value
Definition at line 558 of file anope.h.
Referenced by GetToken(), and GetTokenRemainder().
Anope::string sepstream::tokens [private] |
Original string.
Definition at line 549 of file anope.h.
Referenced by GetRemaining(), GetToken(), sepstream(), and StreamEnd().
1.7.1