OpenTREP Logo  0.6.0
C++ Open Travel Request Parsing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
StringPartition.hpp
Go to the documentation of this file.
1 #ifndef __OPENTREP_BOM_STRINGPARTITION_HPP
2 #define __OPENTREP_BOM_STRINGPARTITION_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STL
8 #include <string>
9 #include <list>
10 // OpenTrep
14 
15 namespace OPENTREP {
16 
35  struct StringPartition : public StructAbstract {
36  // //////////////// Type definitions //////////////////
40  typedef std::list<StringSet> StringPartition_T;
41 
42  public:
49  void push_back (const StringSet& iStringSet);
50 
54  size_t size() const;
55 
59  bool empty() const;
60 
64  void clear();
65 
70  const std::string& getInitialString() const {
71  return _initialString;
72  }
73 
91 
92 
93  private:
102  void init (const std::string& iStringToBePartitioned);
103 
104 
105  public:
106  // /////////// Display support methods /////////
112  void toStream (std::ostream& ioOut) const;
113 
119  void fromStream (std::istream& ioIn);
120 
125  std::string describeKey() const;
126 
130  std::string describe() const;
131 
132 
133  public:
134  // //////////////// Constructors and Destructors /////////////
140  StringPartition (const std::string& iStringToBePartitioned);
141 
146 
147 
148  public:
149  // //////////////// Attributes ///////////////
153  std::string _initialString;
154 
159  };
160 
161 
162  // //////////////// Type definitions //////////////////
166  typedef std::list<StringPartition> StringPartitionList_T;
167 
168 }
169 #endif // __OPENTREP_BOM_STRINGPARTITION_HPP
std::list< StringSet > StringPartition_T
std::list< StringPartition > StringPartitionList_T
void toStream(std::ostream &ioOut) const
Base class for the light structures.
std::string describe() const
StringPartition_T _partition
void push_back(const StringSet &iStringSet)
std::string describeKey() const
Class holding a set of strings, e.g., {"rio", "de", "janeiro"}.
Definition: StringSet.hpp:19
StringSet calculateUniqueCombinations() const
void fromStream(std::istream &ioIn)
const std::string & getInitialString() const
StringPartition(const std::string &iStringToBePartitioned)