Sha256: 96fd71c30426df17f3d1afd54a99c3eaa7696340e51ae6240eb97d3da4781136

Contents?: true

Size: 1.08 KB

Versions: 10

Compression:

Stored size: 1.08 KB

Contents

// Copyright (c) 2017-2020 Dr. Colin Hirsch and Daniel Frey
// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/

#ifndef TAO_JSON_PEGTL_INTERNAL_BUMP_HPP
#define TAO_JSON_PEGTL_INTERNAL_BUMP_HPP

#include "../config.hpp"

#include "iterator.hpp"

namespace TAO_JSON_PEGTL_NAMESPACE::internal
{
   inline void bump( iterator& iter, const std::size_t count, const int ch ) noexcept
   {
      for( std::size_t i = 0; i < count; ++i ) {
         if( iter.data[ i ] == ch ) {
            ++iter.line;
            iter.column = 1;
         }
         else {
            ++iter.column;
         }
      }
      iter.byte += count;
      iter.data += count;
   }

   inline void bump_in_this_line( iterator& iter, const std::size_t count ) noexcept
   {
      iter.data += count;
      iter.byte += count;
      iter.column += count;
   }

   inline void bump_to_next_line( iterator& iter, const std::size_t count ) noexcept
   {
      ++iter.line;
      iter.byte += count;
      iter.column = 1;
      iter.data += count;
   }

}  // namespace TAO_JSON_PEGTL_NAMESPACE::internal

#endif

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
couchbase-3.2.0-universal-darwin-20 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.2.0 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.1.1 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.1.1-universal-darwin-20 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.1.0 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.0.3 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.0.3-universal-darwin-20 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.0.2 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.0.1-universal-darwin-19 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.0.1 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp