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 ListNParser inline template implementation */
26 #include "ListNParser.ih"
30 #define prefix_ inline
31 //-/////////////////////////////////////////////////////////////////////////////////////////////////
33 template <class ElementParser, class AuxPolicy>
34 prefix_ senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::ListNParser_Policy()
37 template <class ElementParser, class AuxPolicy>
38 prefix_ senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::
39 ListNParser_Policy(parser_policy const & policy)
43 template <class ElementParser, class AuxPolicy>
46 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::ListNParser_Policy(Arg const & aux)
50 template <class ElementParser, class AuxPolicy>
51 prefix_ typename senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::size_type
52 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::bytes(data_iterator i, state_type s)
55 container_type c (parser_type(*this, i, s));
56 return std::distance(i,c.end().raw());
59 template <class ElementParser, class AuxPolicy>
60 prefix_ typename senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::size_type
61 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::size(data_iterator i, state_type s)
64 return AuxPolicy::aux(i,s);
67 template <class ElementParser, class AuxPolicy>
68 prefix_ void senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::init(data_iterator i,
72 AuxPolicy::aux(0,i,s);
75 template <class ElementParser, class AuxPolicy>
77 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::construct(container_type & c)
81 template <class ElementParser, class AuxPolicy>
83 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::destruct(container_type & c)
87 template <class ElementParser, class AuxPolicy>
89 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::erase(container_type & c,
93 this->aux(this->aux(c.i(),c.state())-1,c.i(),c.state());
96 template <class ElementParser, class AuxPolicy>
98 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::insert(container_type & c,
102 this->aux(this->aux(c.i(),c.state())+1,c.i(),c.state());
105 template <class ElementParser, class AuxPolicy>
107 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::update(container_type const & c)
111 template <class ElementParser, class AuxPolicy>
112 prefix_ typename senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::data_iterator
113 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::setBegin(container_type const & c,
117 d.n_ = this->aux(c.i(),c.state());
118 return d.n_ ? this->adjust(c.i(),c.state()) : c.data().end();
121 template <class ElementParser, class AuxPolicy>
122 prefix_ typename senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::data_iterator
123 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::setEnd(container_type const & c,
128 return c.data().end();
131 template <class ElementParser, class AuxPolicy>
132 prefix_ typename senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::data_iterator
133 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::next(container_type const & c,
138 return d.n_ ? boost::next( container_type::iterator::get(d).i(),
139 senf::bytes(* container_type::iterator::get(d)) )
143 //-/////////////////////////////////////////////////////////////////////////////////////////////////
150 // comment-column: 40
151 // c-file-style: "senf"
152 // indent-tabs-mode: nil
153 // ispell-local-dictionary: "american"
154 // compile-command: "scons -u test"