Sha256: 4210963e2fe76345b9a9bd33d44b6fd5e92f98b1e70cab2049da08ddd6700090

Contents?: true

Size: 1.06 KB

Versions: 13

Compression:

Stored size: 1.06 KB

Contents

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

#ifndef TAO_PEGTL_INTERNAL_BUMP_HPP
#define TAO_PEGTL_INTERNAL_BUMP_HPP

#include "../config.hpp"

#include "iterator.hpp"

namespace TAO_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_PEGTL_NAMESPACE::internal

#endif

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
couchbase-3.5.6 ext/cache/json/4c7c23ac69aa1d72b3a9295ac9aceac10d32d9a1/json/external/PEGTL/include/tao/pegtl/internal/bump.hpp
couchbase-3.5.5 ext/cache/json/4c7c23ac69aa1d72b3a9295ac9aceac10d32d9a1/json/external/PEGTL/include/tao/pegtl/internal/bump.hpp
couchbase-3.5.4 ext/cache/json/4c7c23ac69aa1d72b3a9295ac9aceac10d32d9a1/json/external/PEGTL/include/tao/pegtl/internal/bump.hpp
couchbase-3.5.3 ext/cache/json/4c7c23ac69aa1d72b3a9295ac9aceac10d32d9a1/json/external/PEGTL/include/tao/pegtl/internal/bump.hpp
couchbase-3.5.2 ext/cache/json/4c7c23ac69aa1d72b3a9295ac9aceac10d32d9a1/json/external/PEGTL/include/tao/pegtl/internal/bump.hpp
couchbase-3.5.1 ext/cache/json/4c7c23ac69aa1d72b3a9295ac9aceac10d32d9a1/json/external/PEGTL/include/tao/pegtl/internal/bump.hpp
couchbase-3.5.0 ext/cache/json/4c7c23ac69aa1d72b3a9295ac9aceac10d32d9a1/json/external/PEGTL/include/tao/pegtl/internal/bump.hpp
couchbase-3.4.5 ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/bump.hpp
couchbase-3.4.4 ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/bump.hpp
couchbase-3.4.3 ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/bump.hpp
couchbase-3.4.2 ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/bump.hpp
couchbase-3.4.1 ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/bump.hpp
couchbase-3.4.0 ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/bump.hpp