forked from matteblair/yaml-cpp
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
2,112 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,23 @@ | ||
#pragma once | ||
|
||
#include <stddef.h> | ||
#include <string> | ||
|
||
#ifdef USE_GOOGLE_PROTOBUF | ||
#include "yaml.pb.h" | ||
#endif | ||
|
||
namespace YAML { | ||
|
||
class Node; | ||
|
||
struct Protobuf { | ||
static proto::Node Dump(const YAML::Node& node); | ||
static YAML::Node Load(const proto::Node& node); | ||
#ifdef USE_GOOGLE_PROTOBUF | ||
static proto::Node GDump(const YAML::Node& node); | ||
static YAML::Node GLoad(const proto::Node& node); | ||
#endif | ||
static std::string Dump(const YAML::Node& node); | ||
static YAML::Node Load(const char* data, size_t length); | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
pbf.hpp copyright (c) Mapbox. | ||
|
||
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. | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#ifndef MAPBOX_UTIL_PBF_COMMON_HPP | ||
#define MAPBOX_UTIL_PBF_COMMON_HPP | ||
|
||
#include <cstdint> | ||
|
||
namespace mapbox { namespace util { | ||
|
||
/** | ||
* The type used for field tags (field numbers). | ||
*/ | ||
typedef uint32_t pbf_tag_type; | ||
|
||
/** | ||
* The type used to encode type information. | ||
* See the table on | ||
* https://developers.google.com/protocol-buffers/docs/encoding | ||
*/ | ||
enum class pbf_wire_type : uint32_t { | ||
varint = 0, // int32/64, uint32/64, sint32/64, bool, enum | ||
fixed64 = 1, // fixed64, sfixed64, double | ||
length_delimited = 2, // string, bytes, embedded messages, | ||
// packed repeated fields | ||
fixed32 = 5, // fixed32, sfixed32, float | ||
unknown = 99 // used for default setting in this library | ||
}; | ||
|
||
/** | ||
* The type used for length values, such as the length of a field. | ||
*/ | ||
typedef uint32_t pbf_length_type; | ||
|
||
}} // end namespace mapbox::util | ||
|
||
#endif // MAPBOX_UTIL_PBF_COMMON_HPP |
Oops, something went wrong.