OLD | NEW |
1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
4 // | 4 // |
5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
7 // met: | 7 // met: |
8 // | 8 // |
9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 LIBPROTOBUF_EXPORT double Infinity(); | 70 LIBPROTOBUF_EXPORT double Infinity(); |
71 LIBPROTOBUF_EXPORT double NaN(); | 71 LIBPROTOBUF_EXPORT double NaN(); |
72 | 72 |
73 // TODO(jieluo): Change to template. We have tried to use template, | 73 // TODO(jieluo): Change to template. We have tried to use template, |
74 // but it causes net/rpc/python:rpcutil_test fail (the empty string will | 74 // but it causes net/rpc/python:rpcutil_test fail (the empty string will |
75 // init twice). It may related to swig. Change to template after we | 75 // init twice). It may related to swig. Change to template after we |
76 // found the solution. | 76 // found the solution. |
77 | 77 |
78 // Default empty string object. Don't use the pointer directly. Instead, call | 78 // Default empty string object. Don't use the pointer directly. Instead, call |
79 // GetEmptyString() to get the reference. | 79 // GetEmptyString() to get the reference. |
80 LIBPROTOBUF_EXPORT extern const ::std::string* cr_empty_string_; | 80 LIBPROTOBUF_EXPORT extern const ::std::string* empty_string_; |
81 LIBPROTOBUF_EXPORT extern ProtobufOnceType cr_empty_string_once_init_; | 81 LIBPROTOBUF_EXPORT extern ProtobufOnceType empty_string_once_init_; |
82 LIBPROTOBUF_EXPORT void InitEmptyString(); | 82 LIBPROTOBUF_EXPORT void InitEmptyString(); |
83 | 83 |
84 | 84 |
85 LIBPROTOBUF_EXPORT inline const ::std::string& GetEmptyStringAlreadyInited() { | 85 LIBPROTOBUF_EXPORT inline const ::std::string& GetEmptyStringAlreadyInited() { |
86 assert(cr_empty_string_ != NULL); | 86 assert(empty_string_ != NULL); |
87 return *cr_empty_string_; | 87 return *empty_string_; |
88 } | 88 } |
89 | 89 |
90 LIBPROTOBUF_EXPORT const ::std::string& GetEmptyString(); | 90 LIBPROTOBUF_EXPORT const ::std::string& GetEmptyString(); |
91 | 91 |
92 LIBPROTOBUF_EXPORT int StringSpaceUsedExcludingSelf(const string& str); | 92 LIBPROTOBUF_EXPORT int StringSpaceUsedExcludingSelf(const string& str); |
93 | 93 |
94 | 94 |
95 // True if IsInitialized() is true for all elements of t. Type is expected | 95 // True if IsInitialized() is true for all elements of t. Type is expected |
96 // to be a RepeatedPtrField<some message type>. It's useful to have this | 96 // to be a RepeatedPtrField<some message type>. It's useful to have this |
97 // helper here to keep the protobuf compiler from ever having to emit loops in | 97 // helper here to keep the protobuf compiler from ever having to emit loops in |
(...skipping 13 matching lines...) Expand all Loading... |
111 // args to be non-NULL. If something goes wrong while reading the data | 111 // args to be non-NULL. If something goes wrong while reading the data |
112 // then NULL is returned (e.g., input does not start with a valid varint). | 112 // then NULL is returned (e.g., input does not start with a valid varint). |
113 ArenaString* ReadArenaString(::google::protobuf::io::CodedInputStream* input, | 113 ArenaString* ReadArenaString(::google::protobuf::io::CodedInputStream* input, |
114 ::google::protobuf::Arena* arena); | 114 ::google::protobuf::Arena* arena); |
115 | 115 |
116 } // namespace internal | 116 } // namespace internal |
117 } // namespace protobuf | 117 } // namespace protobuf |
118 | 118 |
119 } // namespace google | 119 } // namespace google |
120 #endif // GOOGLE_PROTOBUF_GENERATED_MESSAGE_UTIL_H__ | 120 #endif // GOOGLE_PROTOBUF_GENERATED_MESSAGE_UTIL_H__ |
OLD | NEW |