2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
15 \brief ListNParser non-inline template implementation */
17 #include "ListNParser.ih"
20 #include <senf/Utils/senfassert.hh>
23 //-/////////////////////////////////////////////////////////////////////////////////////////////////
25 template <class ElementParser, class AuxPolicy>
27 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::setFromPosition(container_type const & c,
32 if (p == c.data().end()) {
36 d.n_ = this->aux(c.i(),c.state());
37 data_iterator j (this->adjust(c.i(),c.state()));
38 for (; d.n_; --d.n_, j += ElementParser(j,c.state()).bytes())
41 SENF_ASSERT( false, "setFromPosition: position does not point to any list element" );
44 template <class ElementParser, class AuxPolicy>
45 prefix_ typename senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::data_iterator
46 senf::detail::ListNParser_Policy<ElementParser,AuxPolicy>::raw(container_type const & c,
47 iterator_data const & d)
50 if (container_type::iterator::get(d).i() != c.data().end())
51 return container_type::iterator::get(d).i();
52 size_type n (this->aux(c.i(),c.state()));
53 data_iterator j (this->adjust(c.i(),c.state()));
55 j += ElementParser(j,c.state()).bytes();
59 //-/////////////////////////////////////////////////////////////////////////////////////////////////
67 // c-file-style: "senf"
68 // indent-tabs-mode: nil
69 // ispell-local-dictionary: "american"
70 // compile-command: "scons -u test"