Sha256: 8066eaed7a4510bc610ade2aff467b467eb81d705bb3f3156bb56aa495f465b1

Contents?: true

Size: 1.1 KB

Versions: 24

Compression:

Stored size: 1.1 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.byte_in_line = 0;
         }
         else {
            ++iter.byte_in_line;
         }
      }
      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.byte_in_line += count;
   }

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

}  // namespace TAO_JSON_PEGTL_NAMESPACE::internal

#endif

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
couchbase-3.0.0-universal-darwin-19 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.0.0 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.0.0.beta.1-universal-darwin-19 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.0.0.beta.1 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.0.0.alpha.5-x86_64-linux ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.0.0.alpha.5-universal-darwin-19 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.0.0.alpha.5-x86_64-darwin-19 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.0.0.alpha.5 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.0.0.alpha.4-x86_64-linux ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.0.0.alpha.4-x86_64-darwin-19 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.0.0.alpha.4-universal-darwin-19 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.0.0.alpha.4 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.0.0.alpha.3-x86_64-linux ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.0.0.alpha.3-x86_64-darwin-19 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.0.0.alpha.3-universal-darwin-19 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.0.0.alpha.3 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.0.0.alpha.2-x86_64-linux ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.0.0.alpha.2-x86_64-darwin-19 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.0.0.alpha.2-universal-darwin-19 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp
couchbase-3.0.0.alpha.2 ext/third_party/json/include/tao/json/external/pegtl/internal/bump.hpp