The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

irc::sepstream Class Reference

irc::sepstream allows for splitting token seperated lists. More...

#include <hashcomp.h>

Inheritance diagram for irc::sepstream:

Inheritance graph
[legend]
Collaboration diagram for irc::sepstream:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 sepstream (const std::string &source, char seperator)
 Create a sepstream and fill it with the provided data.
virtual ~sepstream ()
virtual bool GetToken (std::string &token)
 Fetch the next token from the stream.
virtual const std::string GetRemaining ()
 Fetch the entire remaining stream, without tokenizing.
virtual bool StreamEnd ()
 Returns true if the end of the stream has been reached.

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.
char sep
 Seperator value.

Detailed Description

irc::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 320 of file hashcomp.h.


Constructor & Destructor Documentation

irc::sepstream::sepstream const std::string source,
char  seperator
 

Create a sepstream and fill it with the provided data.

Definition at line 240 of file hashcomp.cpp.

References last_starting_position, n, and tokens.

irc::sepstream::~sepstream  )  [virtual]
 

Definition at line 283 of file hashcomp.cpp.


Member Function Documentation

const std::string irc::sepstream::GetRemaining  )  [virtual]
 

Fetch the entire remaining stream, without tokenizing.

Returns:
The remaining part of the stream

Definition at line 273 of file hashcomp.cpp.

References n, and tokens.

bool irc::sepstream::GetToken std::string token  )  [virtual]
 

Fetch the next token from the stream.

Parameters:
token The next token from the stream is placed here
Returns:
True if tokens still remain, false if there are none left

Definition at line 246 of file hashcomp.cpp.

References last_starting_position, n, sep, and tokens.

Referenced by LogManager::AddLogTypes(), callerid_data::callerid_data(), CloakUser::Cloak4(), ModuleAlias::DoAlias(), CommandAccept::EncodeParameter(), irc::portparser::GetToken(), ModuleAlias::GetVar(), CommandSamode::Handle(), CommandHelpop::Handle(), CommandCAP::Handle(), TreeSocket::HasItem(), TreeSocket::ListDifference(), CommandParser::LoopCall(), ModuleHTTPAccessList::OnEvent(), ModulePermanentChannels::OnRehash(), ModuleAlias::OnUserPreMessage(), ServerConfig::Read(), IdentRequestSocket::ReadResponse(), TreeSocket::SendCapabilities(), ProtocolInterface::SendModeStr(), Channel::SetDefaultModes(), and CommandParser::TranslateUIDs().

bool irc::sepstream::StreamEnd  )  [virtual]
 

Returns true if the end of the stream has been reached.

Returns:
True if the end of the stream has been reached, otherwise false

Definition at line 278 of file hashcomp.cpp.

References n, and tokens.


Member Data Documentation

std::string::iterator irc::sepstream::last_starting_position [private]
 

Last position of a seperator token.

Definition at line 328 of file hashcomp.h.

Referenced by GetToken(), and sepstream().

std::string::iterator irc::sepstream::n [private]
 

Current string position.

Definition at line 331 of file hashcomp.h.

Referenced by GetRemaining(), GetToken(), sepstream(), and StreamEnd().

char irc::sepstream::sep [private]
 

Seperator value.

Definition at line 334 of file hashcomp.h.

Referenced by GetToken().

std::string irc::sepstream::tokens [private]
 

Original string.

Definition at line 325 of file hashcomp.h.

Referenced by GetRemaining(), GetToken(), sepstream(), and StreamEnd().


The documentation for this class was generated from the following files: