4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Stefan Bund <g0dil@berlios.de>
8 // This program 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.
13 // This program 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.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief STLSupport internal header */
26 #ifndef IH_SENF_senf_Utils_Console_STLSupport_
27 #define IH_SENF_senf_Utils_Console_STLSupport_ 1
31 ///////////////////////////////ih.p////////////////////////////////////////
37 template <class Collection>
38 struct CollectionArgumentTraitsBase
40 typedef Collection type;
41 static bool const singleToken = false;
43 static std::string description();
44 static std::string str(Collection const & value);
47 template <class Collection, class Adder>
48 struct CollectionArgumentTraits
49 : detail::CollectionArgumentTraitsBase<Collection>
51 static void parse(ParseCommandInfo::TokensRange const & tokens, Collection & out);
54 template <class Collection>
55 struct CollectionReturnValueTraits
57 typedef Collection type;
59 static void format(Collection const & value, std::ostream & os);
62 struct PushBackFunctor
64 template <class Sequence, class ValueType>
65 static void add(Sequence & seq, ValueType const & value);
70 template <class Collection, class ValueType>
71 static void add(Collection & seq, ValueType const & value);
74 template <class Collection>
75 struct MapArgumentTraits
77 typedef Collection type;
78 static bool const singleToken = false;
80 static void parse(ParseCommandInfo::TokensRange const & tokens, Collection & out);
81 static std::string description();
82 static std::string str(Collection const & value);
85 template <class Collection>
86 struct MapReturnValueTraits
88 typedef Collection type;
90 static void format(Collection const & value, std::ostream & os);
95 ///////////////////////////////ih.e////////////////////////////////////////
102 // comment-column: 40
103 // c-file-style: "senf"
104 // indent-tabs-mode: nil
105 // ispell-local-dictionary: "american"
106 // compile-command: "scons -u test"