Pol  Revision:3cfda13
strset.h
Go to the documentation of this file.
1 
7 #ifndef CLIB_STRSET_H
8 #define CLIB_STRSET_H
9 
10 #include <cstddef>
11 #include <set>
12 #include <string>
13 
14 namespace Pol
15 {
16 namespace Clib
17 {
18 class StringSet
19 {
20 public:
21  bool contains( const char* str ) const;
22  void add( const char* str );
23  void remove( const char* str );
24  bool empty() const;
25 
26  void readfrom( const std::string& str );
27  std::string extract() const;
28 
29  typedef std::set<std::string>::iterator iterator;
30  iterator begin();
31  iterator end();
32 
33  typedef std::set<std::string>::const_iterator const_iterator;
34  const_iterator begin() const;
35  const_iterator end() const;
36 
37  size_t estimatedSize() const;
38 
39 private:
40  std::set<std::string> strings_;
41 };
42 }
43 }
44 #endif // CLIB_STRSET_H
std::set< std::string >::iterator iterator
Definition: strset.h:29
void add(const char *str)
Definition: strset.cpp:19
void readfrom(const std::string &str)
Definition: strset.cpp:33
iterator end()
Definition: strset.cpp:62
std::string extract() const
Definition: strset.cpp:46
std::set< std::string > strings_
Definition: strset.h:40
std::set< std::string >::const_iterator const_iterator
Definition: strset.h:33
bool contains(const char *str) const
Definition: strset.cpp:14
bool empty() const
Definition: strset.cpp:28
size_t estimatedSize() const
Definition: strset.cpp:77
Definition: berror.cpp:12
iterator begin()
Definition: strset.cpp:57