4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
6 // The contents of this file are subject to the Fraunhofer FOKUS Public License
7 // Version 1.0 (the "License"); you may not use this file except in compliance
8 // with the License. You may obtain a copy of the License at
9 // http://senf.berlios.de/license.html
11 // The Fraunhofer FOKUS Public License Version 1.0 is based on,
12 // but modifies the Mozilla Public License Version 1.1.
13 // See the full license text for the amendments.
15 // Software distributed under the License is distributed on an "AS IS" basis,
16 // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
17 // for the specific language governing rights and limitations under the License.
19 // The Original Code is Fraunhofer FOKUS code.
21 // The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V.
22 // (registered association), Hansastraße 27 c, 80686 Munich, Germany.
23 // All Rights Reserved.
26 // Stefan Bund <g0dil@berlios.de>
29 \brief ListNParser inline template implementation */
31 #include "ListNParser.ih"
35 #define prefix_ inline
36 //-/////////////////////////////////////////////////////////////////////////////////////////////////
38 template <class ElementParser, class AuxPolicy>
39 prefix_ senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::ListNParser_Policy()
42 template <class ElementParser, class AuxPolicy>
43 prefix_ senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::
44 ListNParser_Policy(parser_policy const & policy)
48 template <class ElementParser, class AuxPolicy>
51 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::ListNParser_Policy(Arg const & aux)
55 template <class ElementParser, class AuxPolicy>
56 prefix_ typename senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::size_type
57 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::bytes(data_iterator i, state_type s)
60 container_type c (parser_type(*this, i, s));
61 return std::distance(i,c.end().raw());
64 template <class ElementParser, class AuxPolicy>
65 prefix_ typename senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::size_type
66 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::size(data_iterator i, state_type s)
69 return AuxPolicy::aux(i,s);
72 template <class ElementParser, class AuxPolicy>
73 prefix_ void senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::init(data_iterator i,
77 AuxPolicy::aux(0,i,s);
80 template <class ElementParser, class AuxPolicy>
82 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::construct(container_type & c)
86 template <class ElementParser, class AuxPolicy>
88 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::destruct(container_type & c)
92 template <class ElementParser, class AuxPolicy>
94 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::erase(container_type & c,
98 this->aux(this->aux(c.i(),c.state())-1,c.i(),c.state());
101 template <class ElementParser, class AuxPolicy>
103 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::insert(container_type & c,
107 this->aux(this->aux(c.i(),c.state())+1,c.i(),c.state());
110 template <class ElementParser, class AuxPolicy>
112 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::update(container_type const & c)
116 template <class ElementParser, class AuxPolicy>
117 prefix_ typename senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::data_iterator
118 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::setBegin(container_type const & c,
122 d.n_ = this->aux(c.i(),c.state());
123 return d.n_ ? this->adjust(c.i(),c.state()) : c.data().end();
126 template <class ElementParser, class AuxPolicy>
127 prefix_ typename senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::data_iterator
128 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::setEnd(container_type const & c,
133 return c.data().end();
136 template <class ElementParser, class AuxPolicy>
137 prefix_ typename senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::data_iterator
138 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::next(container_type const & c,
143 return d.n_ ? boost::next( container_type::iterator::get(d).i(),
144 senf::bytes(* container_type::iterator::get(d)) )
148 //-/////////////////////////////////////////////////////////////////////////////////////////////////
155 // comment-column: 40
156 // c-file-style: "senf"
157 // indent-tabs-mode: nil
158 // ispell-local-dictionary: "american"
159 // compile-command: "scons -u test"