OpenTREP Logo  0.6.0
C++ Open Travel Request Parsing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OPENTREP::StringSet Struct Reference

Class holding a set of strings, e.g., {"rio", "de", "janeiro"}. More...

#include <opentrep/bom/StringSet.hpp>

+ Inheritance diagram for OPENTREP::StringSet:

Public Types

typedef std::list< std::string > StringSet_T
 

Public Member Functions

void push_back (const std::string &)
 
void push_back (const StringSet &)
 
size_t size () const
 
bool empty () const
 
void clear ()
 
std::string getFirstString () const
 
void toStream (std::ostream &) const
 
void fromStream (std::istream &)
 
std::string describeKey () const
 
std::string describe () const
 
 StringSet ()
 
 StringSet (const StringSet &)
 
 StringSet (const std::string &)
 
 ~StringSet ()
 

Public Attributes

StringSet_T _set
 

Detailed Description

Class holding a set of strings, e.g., {"rio", "de", "janeiro"}.

Definition at line 19 of file StringSet.hpp.

Member Typedef Documentation

typedef std::list<std::string> OPENTREP::StringSet::StringSet_T

List of strings.

Definition at line 25 of file StringSet.hpp.

Constructor & Destructor Documentation

OPENTREP::StringSet::StringSet ( )

Default constructor.

Definition at line 14 of file StringSet.cpp.

OPENTREP::StringSet::StringSet ( const StringSet iStringSet)

Default copy constructor.

Definition at line 18 of file StringSet.cpp.

References _set.

OPENTREP::StringSet::StringSet ( const std::string &  iString)

Main constructor.

Definition at line 23 of file StringSet.cpp.

References _set.

OPENTREP::StringSet::~StringSet ( )

Default destructor.

Definition at line 30 of file StringSet.cpp.

Member Function Documentation

void OPENTREP::StringSet::push_back ( const std::string &  iString)

Add an item (string) into the list.

Note
When the given string is empty (zero-length), it is (obviously) not added to the list

Definition at line 49 of file StringSet.cpp.

References _set.

Referenced by OPENTREP::StringPartition::calculateUniqueCombinations(), OPENTREP::ResultHolder::getCorrectedStringSet(), and push_back().

void OPENTREP::StringSet::push_back ( const StringSet iStringSet)

Add all the items (string) into the list.

Definition at line 54 of file StringSet.cpp.

References _set, and push_back().

size_t OPENTREP::StringSet::size ( ) const

Return the size of the list.

Definition at line 34 of file StringSet.cpp.

References _set.

bool OPENTREP::StringSet::empty ( ) const

Return whether or not the list is empty.

Definition at line 39 of file StringSet.cpp.

References _set.

Referenced by OPENTREP::StringPartition::push_back().

void OPENTREP::StringSet::clear ( )

Empty the list.

Definition at line 44 of file StringSet.cpp.

References _set.

std::string OPENTREP::StringSet::getFirstString ( ) const

Get the first string of the underlying list/set.

Definition at line 64 of file StringSet.cpp.

References _set.

void OPENTREP::StringSet::toStream ( std::ostream &  ioOut) const

Dump the structure into an output stream.

Parameters
ostream&the output stream.

Definition at line 117 of file StringSet.cpp.

References describe().

void OPENTREP::StringSet::fromStream ( std::istream &  ioIn)
virtual

Read a structure from an input stream.

Parameters
istream&the input stream.

Reimplemented from OPENTREP::StructAbstract.

Definition at line 122 of file StringSet.cpp.

std::string OPENTREP::StringSet::describeKey ( ) const

Get a string describing the whole key (differentiating two objects at any level).

Definition at line 81 of file StringSet.cpp.

Referenced by describe().

std::string OPENTREP::StringSet::describe ( ) const
virtual

Get the serialised version of the structure.

Implements OPENTREP::StructAbstract.

Definition at line 88 of file StringSet.cpp.

References _set, and describeKey().

Referenced by OPENTREP::searchString(), and toStream().

Member Data Documentation

StringSet_T OPENTREP::StringSet::_set

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