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 ///////////////////////////////cti.p///////////////////////////////////////
33 template <class ElementParser, class AuxPolicy>
34 prefix_ senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::ListNParser_Policy()
37 template <class ElementParser, class AuxPolicy>
40 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::ListNParser_Policy(Arg const & aux)
44 template <class ElementParser, class AuxPolicy>
45 prefix_ typename senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::size_type
46 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::bytes(data_iterator i, state_type s)
49 container_type c (parser_type(*this, i, s));
50 return std::distance(i,c.end().raw());
53 template <class ElementParser, class AuxPolicy>
54 prefix_ typename senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::size_type
55 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::size(data_iterator i, state_type s)
58 return AuxPolicy::aux(i,s);
61 template <class ElementParser, class AuxPolicy>
62 prefix_ void senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::init(data_iterator i,
66 AuxPolicy::aux(0,i,s);
69 template <class ElementParser, class AuxPolicy>
71 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::erase(container_type & c,
75 this->aux(this->aux(c.i(),c.state())-1,c.i(),c.state());
78 template <class ElementParser, class AuxPolicy>
80 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::insert(container_type & c,
84 this->aux(this->aux(c.i(),c.state())+1,c.i(),c.state());
87 template <class ElementParser, class AuxPolicy>
89 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::update(container_type const & c)
93 template <class ElementParser, class AuxPolicy>
94 prefix_ typename senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::data_iterator
95 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::setBegin(container_type const & c,
99 d.n_ = this->aux(c.i(),c.state());
100 return d.n_ ? this->adjust(c.i(),c.state()) : c.data().end();
103 template <class ElementParser, class AuxPolicy>
104 prefix_ typename senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::data_iterator
105 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::setEnd(container_type const & c,
110 return c.data().end();
113 template <class ElementParser, class AuxPolicy>
114 prefix_ typename senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::data_iterator
115 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::next(container_type const & c,
120 return d.n_ ? boost::next( container_type::iterator::get(d).i(),
121 senf::bytes(* container_type::iterator::get(d)) )
125 ///////////////////////////////cti.e///////////////////////////////////////
132 // comment-column: 40
133 // c-file-style: "senf"
134 // indent-tabs-mode: nil
135 // ispell-local-dictionary: "american"
136 // compile-command: "scons -u test"