]> Creatis software - clitk.git/blob - cmake/gengetopt/acceptedvalues.h
Added FindGengetopt.cmake which compiles gengetopt if not installed.
[clitk.git] / cmake / gengetopt / acceptedvalues.h
1 //
2 // C++ Interface: acceptedvalues
3 //
4 // Description:
5 //
6 //
7 // Author: Lorenzo Bettini <http://www.lorenzobettini.it>, (C) 2004
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12 #ifndef ACCEPTEDVALUES_H
13 #define ACCEPTEDVALUES_H
14
15 #include <list>
16 #include <set>
17 #include <string>
18
19 /**
20 the values that can be passed to an option
21
22 @author Lorenzo Bettini
23 */
24 class AcceptedValues : protected std::list<std::string>
25 {
26   private:
27     typedef std::set<std::string> value_set;
28     value_set values;
29   
30   public:
31     using std::list<std::string>::const_iterator;
32     using std::list<std::string>::begin;
33     using std::list<std::string>::end;
34
35     void insert(const std::string &s);
36     const std::string toString(bool escape = true) const;
37     bool contains(const std::string &s) const;
38 };
39
40 #endif