fixed pw loyalty in oracle, PB code working

This commit is contained in:
Max-Wilhelm Bruker 2012-01-01 18:15:32 +01:00
parent d5c628966f
commit 6344b987de
8 changed files with 67 additions and 51 deletions

View file

@ -0,0 +1,13 @@
#include "get_pb_extension.h"
#include <google/protobuf/message.h>
#include <google/protobuf/descriptor.h>
int getPbExtension(const ::google::protobuf::Message &message)
{
std::vector< const ::google::protobuf::FieldDescriptor * > fieldList;
message.GetReflection()->ListFields(message, &fieldList);
for (unsigned int j = 0; j < fieldList.size(); ++j)
if (fieldList[j]->is_extension())
return fieldList[j]->number();
return -1;
}