Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StringList.h
1 /*
2  * $Id$
3  * option::StringList class interface
4  *
5  * This file is part of OTAWA
6  * Copyright (c) 2009, IRIT UPS.
7  *
8  * OTAWA is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * OTAWA is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with OTAWA; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 #ifndef ELM_OPTION_STRING_LIST_H
23 #define ELM_OPTION_STRING_LIST_H
24 
25 #include <elm/option/StandardOption.h>
26 #include <elm/genstruct/Vector.h>
27 
28 namespace elm { namespace option {
29 
30 // StringList class
31 class StringList: public StandardOption {
32 public:
33  StringList(
34  Manager& manager,
35  char short_name,
37  cstring arg_description);
38  StringList(
39  Manager& manager,
40  cstring long_name,
41  cstring description,
42  cstring arg_description);
43  StringList(
44  Manager& manager,
45  char short_name,
46  cstring long_name,
47  cstring description,
48  cstring arg_description);
49 
50  // Option overload
51  virtual usage_t usage(void);
52  virtual cstring argDescription(void);
53  virtual void process(string arg);
54 
55  // Operators
56  inline operator bool(void) const { return args; };
57  inline const string& operator[](int index) const { return args[index]; }
58  inline int count(void) const { return args.count(); }
59 
60 private:
61  cstring arg_desc;
63 };
64 
65 } } // elm::option
66 
67 #endif // ELM_OPTION_STRING_LIST_H
Definition: CString.h:17
virtual cstring argDescription(void)
Definition: option_StringList.cpp:94
virtual usage_t usage(void)
Definition: option_StringList.cpp:88
Definition: Manager.h:59
usage_t
Definition: Option.h:35
Definition: StringList.h:31
int count(void) const
Definition: StringList.h:58
Definition: StandardOption.h:31
const string & operator[](int index) const
Definition: StringList.h:57
Definition: Vector.h:35
StringList(Manager &manager, char short_name, cstring description, cstring arg_description)
Definition: option_StringList.cpp:41
virtual cstring description(void)
Definition: option_StandardOption.cpp:85
virtual void process(string arg)
Definition: option_StringList.cpp:100