| 167 | } |
| 168 | |
| 169 | google::protobuf::Message* ProtobufCodec::createMessage(const std::string& typeName) |
| 170 | { |
| 171 | google::protobuf::Message* message = NULL; |
| 172 | const google::protobuf::Descriptor* descriptor = |
| 173 | google::protobuf::DescriptorPool::generated_pool()->FindMessageTypeByName(typeName); |
| 174 | if (descriptor) |
| 175 | { |
| 176 | const google::protobuf::Message* prototype = |
| 177 | google::protobuf::MessageFactory::generated_factory()->GetPrototype(descriptor); |
| 178 | if (prototype) |
| 179 | { |
| 180 | message = prototype->New(); |
| 181 | } |
| 182 | } |
| 183 | return message; |
| 184 | } |
| 185 | |
| 186 | MessagePtr ProtobufCodec::parse(const char* buf, int len, ErrorCode* error) |
| 187 | { |
nothing calls this directly
no outgoing calls
no test coverage detected