Frobby  0.9.5
Classes | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
FrobbyStringStream Class Reference

A replacement for stringstream. More...

#include <FrobbyStringStream.h>

Classes

class  NotAnIntegerException
 

Public Member Functions

FrobbyStringStreamoperator<< (unsigned long long integer)
 
FrobbyStringStreamoperator<< (unsigned long integer)
 
FrobbyStringStreamoperator<< (unsigned int integer)
 
FrobbyStringStreamoperator<< (const mpz_class &integer)
 
FrobbyStringStreamoperator<< (const string &text)
 
FrobbyStringStreamoperator<< (const char *text)
 
FrobbyStringStreamoperator<< (char character)
 This overload actually appends the character to the stream instead of appending a string representation of the number. More...
 
string & str ()
 
const string & str () const
 
 operator const string & () const
 
void clear ()
 

Static Public Member Functions

static void appendIntegerToString (string &str, unsigned long integer)
 
static void appendIntegerToString (string &str, const mpz_class &integer)
 
static void parseInteger (mpz_class &integer, const string &str)
 Throws NotAnIntegerException if str is not the string representation of an integer. More...
 

Private Attributes

string _str
 

Detailed Description

A replacement for stringstream.

See the .cpp file for a motivation to use this instead of the regular stringstream. It should not be used for operations that need to be efficient.

Definition at line 26 of file FrobbyStringStream.h.

Member Function Documentation

◆ appendIntegerToString() [1/2]

void FrobbyStringStream::appendIntegerToString ( string &  str,
const mpz_class &  integer 
)
static

Definition at line 109 of file FrobbyStringStream.cpp.

◆ appendIntegerToString() [2/2]

void FrobbyStringStream::appendIntegerToString ( string &  str,
unsigned long  integer 
)
static

Definition at line 86 of file FrobbyStringStream.cpp.

◆ clear()

void FrobbyStringStream::clear ( )
inline

Definition at line 44 of file FrobbyStringStream.h.

◆ operator const string &()

FrobbyStringStream::operator const string & ( ) const

Definition at line 82 of file FrobbyStringStream.cpp.

◆ operator<<() [1/7]

FrobbyStringStream & FrobbyStringStream::operator<< ( char  character)

This overload actually appends the character to the stream instead of appending a string representation of the number.

This is different from stringstream.

Definition at line 39 of file FrobbyStringStream.cpp.

◆ operator<<() [2/7]

FrobbyStringStream & FrobbyStringStream::operator<< ( const char *  text)

Definition at line 69 of file FrobbyStringStream.cpp.

◆ operator<<() [3/7]

FrobbyStringStream & FrobbyStringStream::operator<< ( const mpz_class &  integer)

Definition at line 59 of file FrobbyStringStream.cpp.

◆ operator<<() [4/7]

FrobbyStringStream & FrobbyStringStream::operator<< ( const string &  text)

Definition at line 64 of file FrobbyStringStream.cpp.

◆ operator<<() [5/7]

FrobbyStringStream & FrobbyStringStream::operator<< ( unsigned int  integer)

Definition at line 54 of file FrobbyStringStream.cpp.

◆ operator<<() [6/7]

FrobbyStringStream & FrobbyStringStream::operator<< ( unsigned long  integer)

Definition at line 49 of file FrobbyStringStream.cpp.

◆ operator<<() [7/7]

FrobbyStringStream & FrobbyStringStream::operator<< ( unsigned long long  integer)

Definition at line 44 of file FrobbyStringStream.cpp.

◆ parseInteger()

void FrobbyStringStream::parseInteger ( mpz_class &  integer,
const string &  str 
)
static

Throws NotAnIntegerException if str is not the string representation of an integer.

Definition at line 114 of file FrobbyStringStream.cpp.

◆ str() [1/2]

string & FrobbyStringStream::str ( )

Definition at line 74 of file FrobbyStringStream.cpp.

◆ str() [2/2]

const string & FrobbyStringStream::str ( ) const

Definition at line 78 of file FrobbyStringStream.cpp.

Member Data Documentation

◆ _str

string FrobbyStringStream::_str
private

Definition at line 58 of file FrobbyStringStream.h.


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