chromium/third_party/protobuf/src/google/protobuf/parse_context.cc

// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.  All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//     * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <google/protobuf/parse_context.h>

#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/io/zero_copy_stream.h>
#include <google/protobuf/arenastring.h>
#include <google/protobuf/endian.h>
#include <google/protobuf/message_lite.h>
#include <google/protobuf/repeated_field.h>
#include <google/protobuf/stubs/strutil.h>
#include <google/protobuf/wire_format_lite.h>

// Must be included last.
#include <google/protobuf/port_def.inc>

namespace google {
namespace protobuf {
namespace internal {

namespace {

// Only call if at start of tag.
bool ParseEndsInSlopRegion(const char* begin, int overrun, int depth) {}

}  // namespace

const char* EpsCopyInputStream::NextBuffer(int overrun, int depth) {}

const char* EpsCopyInputStream::Next() {}

std::pair<const char*, bool> EpsCopyInputStream::DoneFallback(int overrun,
                                                              int depth) {}

const char* EpsCopyInputStream::SkipFallback(const char* ptr, int size) {}

const char* EpsCopyInputStream::ReadStringFallback(const char* ptr, int size,
                                                   std::string* str) {}

const char* EpsCopyInputStream::AppendStringFallback(const char* ptr, int size,
                                                     std::string* str) {}


const char* EpsCopyInputStream::InitFrom(io::ZeroCopyInputStream* zcis) {}

const char* ParseContext::ReadSizeAndPushLimitAndDepth(const char* ptr,
                                                       int* old_limit) {}

const char* ParseContext::ParseMessage(MessageLite* msg, const char* ptr) {}

inline void WriteVarint(uint64_t val, std::string* s) {}

void WriteVarint(uint32_t num, uint64_t val, std::string* s) {}

void WriteLengthDelimited(uint32_t num, StringPiece val, std::string* s) {}

std::pair<const char*, uint32_t> VarintParseSlow32(const char* p,
                                                   uint32_t res) {}

std::pair<const char*, uint64_t> VarintParseSlow64(const char* p,
                                                   uint32_t res32) {}

std::pair<const char*, uint32_t> ReadTagFallback(const char* p, uint32_t res) {}

std::pair<const char*, int32_t> ReadSizeFallback(const char* p, uint32_t res) {}

const char* StringParser(const char* begin, const char* end, void* object,
                         ParseContext*) {}

// Defined in wire_format_lite.cc
void PrintUTF8ErrorLog(StringPiece message_name,
                       StringPiece field_name, const char* operation_str,
                       bool emit_stacktrace);

bool VerifyUTF8(StringPiece str, const char* field_name) {}

const char* InlineGreedyStringParser(std::string* s, const char* ptr,
                                     ParseContext* ctx) {}


template <typename T, bool sign>
const char* VarintParser(void* object, const char* ptr, ParseContext* ctx) {}

const char* PackedInt32Parser(void* object, const char* ptr,
                              ParseContext* ctx) {}
const char* PackedUInt32Parser(void* object, const char* ptr,
                               ParseContext* ctx) {}
const char* PackedInt64Parser(void* object, const char* ptr,
                              ParseContext* ctx) {}
const char* PackedUInt64Parser(void* object, const char* ptr,
                               ParseContext* ctx) {}
const char* PackedSInt32Parser(void* object, const char* ptr,
                               ParseContext* ctx) {}
const char* PackedSInt64Parser(void* object, const char* ptr,
                               ParseContext* ctx) {}

const char* PackedEnumParser(void* object, const char* ptr, ParseContext* ctx) {}

const char* PackedBoolParser(void* object, const char* ptr, ParseContext* ctx) {}

template <typename T>
const char* FixedParser(void* object, const char* ptr, ParseContext* ctx) {}

const char* PackedFixed32Parser(void* object, const char* ptr,
                                ParseContext* ctx) {}
const char* PackedSFixed32Parser(void* object, const char* ptr,
                                 ParseContext* ctx) {}
const char* PackedFixed64Parser(void* object, const char* ptr,
                                ParseContext* ctx) {}
const char* PackedSFixed64Parser(void* object, const char* ptr,
                                 ParseContext* ctx) {}
const char* PackedFloatParser(void* object, const char* ptr,
                              ParseContext* ctx) {}
const char* PackedDoubleParser(void* object, const char* ptr,
                               ParseContext* ctx) {}

class UnknownFieldLiteParserHelper {};

const char* UnknownGroupLiteParse(std::string* unknown, const char* ptr,
                                  ParseContext* ctx) {}

const char* UnknownFieldParse(uint32_t tag, std::string* unknown,
                              const char* ptr, ParseContext* ctx) {}

}  // namespace internal
}  // namespace protobuf
}  // namespace google

#include <google/protobuf/port_undef.inc>