Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
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/Option.h>
26 #include <elm/data/Vector.h>
27 
28 namespace elm { namespace option {
29 
30 // StringList class
31 class StringList: public Option {
32 public:
33  StringList(const Make& m);
34 
35  // Option overload
36  usage_t usage(void) override;
37  cstring argDescription(void) override;
38  void process(string arg) override;
39 
40  // Operators
41  inline operator bool(void) const { return args; };
42  inline const string& operator[](int index) const { return args[index]; }
43  inline int count(void) const { return args.count(); }
44 
45 private:
46  cstring arg_desc;
47  Vector<string> args;
48 };
49 
50 } } // elm::option
51 
52 #endif // ELM_OPTION_STRING_LIST_H
elm::option::StringList::process
void process(string arg) override
Definition: option_StringList.cpp:55
elm::Vector::count
int count(void) const
Definition: Vector.h:81
elm::option::StringList::operator[]
const string & operator[](int index) const
Definition: StringList.h:42
elm::option::usage_t
usage_t
Definition: Option.h:41
elm::option::StringList::argDescription
cstring argDescription(void) override
Definition: option_StringList.cpp:49
bool
elm::CString
Definition: CString.h:17
elm::option::StringList::StringList
StringList(const Make &m)
Definition: option_StringList.cpp:38
elm::option::Option::Make
Definition: Option.h:52
elm
Definition: adapter.h:26
elm::Vector< string >
elm::option::Option
Definition: Option.h:49
elm::option::StringList
Definition: StringList.h:31
elm::option::StringList::usage
usage_t usage(void) override
Definition: option_StringList.cpp:43
elm::option::StringList::count
int count(void) const
Definition: StringList.h:43