|
36 | 36 | #include "public/engine/iserverplugin.h" |
37 | 37 | #include "bitbuf.h" |
38 | 38 |
|
| 39 | +#include "utilities/sp_util.h" |
39 | 40 | #include "modules/memory/memory_utilities.h" |
40 | 41 |
|
41 | 42 | #ifdef USE_PROTOBUF |
|
165 | 166 | static bool GetBool(google::protobuf::Message* pMessage, const char* field_name) |
166 | 167 | { return GetField<bool>(pMessage, &google::protobuf::Reflection::GetBool, field_name); } |
167 | 168 |
|
168 | | - static std::string GetString(google::protobuf::Message* pMessage, const char* field_name) |
| 169 | + static str GetString(google::protobuf::Message* pMessage, const char* field_name, const char* szErrors = NULL) |
169 | 170 | { |
170 | 171 | std::string return_value; |
171 | 172 | return_value = pMessage->GetReflection()->GetStringReference(*pMessage, GetFieldDescriptor(pMessage, field_name), &return_value); |
172 | | - return return_value; |
| 173 | + return make_str(return_value.c_str(), szErrors); |
173 | 174 | } |
174 | 175 |
|
175 | 176 | static int GetEnum(google::protobuf::Message* pMessage, const char* field_name) |
|
220 | 221 | static bool GetRepeatedBool(google::protobuf::Message* pMessage, const char* field_name, int index) |
221 | 222 | { return GetRepeatedField<bool>(pMessage, &google::protobuf::Reflection::GetRepeatedBool, field_name, index); } |
222 | 223 |
|
223 | | - static std::string GetRepeatedString(google::protobuf::Message* pMessage, const char* field_name, int index) |
| 224 | + static str GetRepeatedString(google::protobuf::Message* pMessage, const char* field_name, int index, const char* szErrors = NULL) |
224 | 225 | { |
225 | 226 | std::string return_value; |
226 | 227 | return_value = pMessage->GetReflection()->GetRepeatedStringReference(*pMessage, GetFieldDescriptor(pMessage, field_name), index, &return_value); |
227 | | - return return_value; |
| 228 | + return make_str(return_value.c_str(), szErrors); |
228 | 229 | } |
229 | 230 |
|
230 | 231 | static int GetRepeatedEnum(google::protobuf::Message* pMessage, const char* field_name, int index) |
|
0 commit comments