chromium/third_party/protobuf/src/google/protobuf/util/internal/utility.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/util/internal/utility.h>

#include <algorithm>
#include <cmath>
#include <cstdint>
#include <limits>

#include <google/protobuf/stubs/callback.h>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/logging.h>
#include <google/protobuf/wrappers.pb.h>
#include <google/protobuf/descriptor.pb.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/stubs/strutil.h>
#include <google/protobuf/util/internal/constants.h>
#include <google/protobuf/stubs/map_util.h>

// clang-format off
#include <google/protobuf/port_def.inc>
// clang-format on

namespace google {
namespace protobuf {
namespace util {
namespace converter {

bool GetBoolOptionOrDefault(
    const RepeatedPtrField<google::protobuf::Option>& options,
    StringPiece option_name, bool default_value) {}

int64_t GetInt64OptionOrDefault(
    const RepeatedPtrField<google::protobuf::Option>& options,
    StringPiece option_name, int64_t default_value) {}

double GetDoubleOptionOrDefault(
    const RepeatedPtrField<google::protobuf::Option>& options,
    StringPiece option_name, double default_value) {}

std::string GetStringOptionOrDefault(
    const RepeatedPtrField<google::protobuf::Option>& options,
    StringPiece option_name, StringPiece default_value) {}

template <typename T>
void ParseFromAny(const std::string& data, T* result) {}

// Returns a boolean value contained in Any type.
// TODO(skarvaje): Add type checking & error messages here.
bool GetBoolFromAny(const google::protobuf::Any& any) {}

int64_t GetInt64FromAny(const google::protobuf::Any& any) {}

double GetDoubleFromAny(const google::protobuf::Any& any) {}

std::string GetStringFromAny(const google::protobuf::Any& any) {}

const StringPiece GetTypeWithoutUrl(StringPiece type_url) {}

const std::string GetFullTypeWithUrl(StringPiece simple_type) {}

const google::protobuf::Option* FindOptionOrNull(
    const RepeatedPtrField<google::protobuf::Option>& options,
    StringPiece option_name) {}

const google::protobuf::Field* FindFieldInTypeOrNull(
    const google::protobuf::Type* type, StringPiece field_name) {}

const google::protobuf::Field* FindJsonFieldInTypeOrNull(
    const google::protobuf::Type* type, StringPiece json_name) {}

const google::protobuf::Field* FindFieldInTypeByNumberOrNull(
    const google::protobuf::Type* type, int32_t number) {}

const google::protobuf::EnumValue* FindEnumValueByNameOrNull(
    const google::protobuf::Enum* enum_type, StringPiece enum_name) {}

const google::protobuf::EnumValue* FindEnumValueByNumberOrNull(
    const google::protobuf::Enum* enum_type, int32_t value) {}

const google::protobuf::EnumValue* FindEnumValueByNameWithoutUnderscoreOrNull(
    const google::protobuf::Enum* enum_type, StringPiece enum_name) {}

std::string EnumValueNameToLowerCamelCase(StringPiece input) {}

std::string ToCamelCase(StringPiece input) {}

std::string ToSnakeCase(StringPiece input) {}

std::set<std::string>* well_known_types_ =;
PROTOBUF_NAMESPACE_ID::internal::once_flag well_known_types_init_;
const char* well_known_types_name_array_[] =;

void DeleteWellKnownTypes() {}

void InitWellKnownTypes() {}

bool IsWellKnownType(const std::string& type_name) {}

bool IsValidBoolString(StringPiece bool_string) {}

bool IsMap(const google::protobuf::Field& field,
           const google::protobuf::Type& type) {}

bool IsMessageSetWireFormat(const google::protobuf::Type& type) {}

std::string DoubleAsString(double value) {}

std::string FloatAsString(float value) {}

bool SafeStrToFloat(StringPiece str, float* value) {}

}  // namespace converter
}  // namespace util
}  // namespace protobuf
}  // namespace google