aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/util/internal/type_info.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/util/internal/type_info.h')
-rw-r--r--src/google/protobuf/util/internal/type_info.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/google/protobuf/util/internal/type_info.h b/src/google/protobuf/util/internal/type_info.h
index 67403fff..e394e8cf 100644
--- a/src/google/protobuf/util/internal/type_info.h
+++ b/src/google/protobuf/util/internal/type_info.h
@@ -44,7 +44,7 @@ namespace util {
namespace converter {
// Internal helper class for type resolving. Note that this class is not
// thread-safe and should only be accessed in one thread.
-class LIBPROTOBUF_EXPORT TypeInfo {
+class TypeInfo {
public:
TypeInfo() {}
virtual ~TypeInfo() {}
@@ -55,24 +55,29 @@ class LIBPROTOBUF_EXPORT TypeInfo {
//
// This TypeInfo class retains the ownership of the returned pointer.
virtual util::StatusOr<const google::protobuf::Type*> ResolveTypeUrl(
- StringPiece type_url) = 0;
+ StringPiece type_url) const = 0;
// Resolves a type url into a Type. Like ResolveTypeUrl() but returns
// NULL if the type url is invalid or the type cannot be found.
//
// This TypeInfo class retains the ownership of the returned pointer.
- virtual const google::protobuf::Type* GetType(StringPiece type_url) = 0;
+ virtual const google::protobuf::Type* GetTypeByTypeUrl(
+ StringPiece type_url) const = 0;
// Resolves a type url for an enum. Returns NULL if the type url is
// invalid or the type cannot be found.
//
// This TypeInfo class retains the ownership of the returned pointer.
- virtual const google::protobuf::Enum* GetEnum(StringPiece type_url) = 0;
+ virtual const google::protobuf::Enum* GetEnumByTypeUrl(
+ StringPiece type_url) const = 0;
// Looks up a field in the specified type given a CamelCase name.
virtual const google::protobuf::Field* FindField(
- const google::protobuf::Type* type, StringPiece camel_case_name) = 0;
+ const google::protobuf::Type* type,
+ StringPiece camel_case_name) const = 0;
+ // Creates a TypeInfo object that looks up type information from a
+ // TypeResolver. Caller takes ownership of the returned pointer.
static TypeInfo* NewTypeInfo(TypeResolver* type_resolver);
private: