diff options
Diffstat (limited to 'src/google/protobuf/util/internal/datapiece.h')
-rw-r--r-- | src/google/protobuf/util/internal/datapiece.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/google/protobuf/util/internal/datapiece.h b/src/google/protobuf/util/internal/datapiece.h index 074fde69..556c0ec4 100644 --- a/src/google/protobuf/util/internal/datapiece.h +++ b/src/google/protobuf/util/internal/datapiece.h @@ -37,6 +37,8 @@ #include <google/protobuf/stubs/stringpiece.h> #include <google/protobuf/stubs/statusor.h> +#include <google/protobuf/port_def.inc> + namespace google { namespace protobuf { class Enum; @@ -58,7 +60,7 @@ class ProtoWriter; // Just like StringPiece, the DataPiece class does not own the storage for // the actual string or Cord, so it is the user's responsiblity to guarantee // that the underlying storage is still valid when the DataPiece is accessed. -class LIBPROTOBUF_EXPORT DataPiece { +class PROTOBUF_EXPORT DataPiece { public: // Identifies data type of the value. // These are the types supported by DataPiece. @@ -121,7 +123,7 @@ class LIBPROTOBUF_EXPORT DataPiece { bool use_strict_base64_decoding() { return use_strict_base64_decoding_; } StringPiece str() const { - GOOGLE_LOG_IF(DFATAL, type_ != TYPE_STRING) << "Not a string type."; + GOOGLE_LOG_IF(DFATAL, type_ != TYPE_STRING) << "Not a std::string type."; return str_; } @@ -148,13 +150,13 @@ class LIBPROTOBUF_EXPORT DataPiece { util::StatusOr<bool> ToBool() const; // Parses, casts or converts the value stored in the DataPiece into a string. - util::StatusOr<string> ToString() const; + util::StatusOr<std::string> ToString() const; // Tries to convert the value contained in this datapiece to string. If the // conversion fails, it returns the default_string. - string ValueAsStringOrDefault(StringPiece default_string) const; + std::string ValueAsStringOrDefault(StringPiece default_string) const; - util::StatusOr<string> ToBytes() const; + util::StatusOr<std::string> ToBytes() const; // Converts a value into protocol buffer enum number. If the value is a // string, first attempts conversion by name, trying names as follows: @@ -198,7 +200,7 @@ class LIBPROTOBUF_EXPORT DataPiece { To*)) const; // Decodes a base64 string. Returns true on success. - bool DecodeBase64(StringPiece src, string* dest) const; + bool DecodeBase64(StringPiece src, std::string* dest) const; // Helper function to initialize this DataPiece with 'other'. void InternalCopy(const DataPiece& other); @@ -229,4 +231,6 @@ class LIBPROTOBUF_EXPORT DataPiece { } // namespace protobuf } // namespace google +#include <google/protobuf/port_undef.inc> + #endif // GOOGLE_PROTOBUF_UTIL_CONVERTER_DATAPIECE_H__ |