Protocol Buffers - Google's data interchange format (grpc依赖)
https://developers.google.com/protocol-buffers/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
458 B
23 lines
458 B
13 years ago
|
|
||
|
#include <iostream>
|
||
|
#include "upb/def.hpp"
|
||
|
#include "upb/pb/glue.hpp"
|
||
|
|
||
|
static void TestSymbolTable() {
|
||
|
upb::SymbolTable *s = upb::SymbolTable::New();
|
||
|
upb::Status status;
|
||
|
if (!upb::LoadDescriptorFileIntoSymtab(s, "tests/test.proto.pb", &status)) {
|
||
|
std::cerr << "Couldn't load descriptor: " << status;
|
||
|
exit(1);
|
||
|
}
|
||
|
upb::MessageDef *md = s->LookupMessage("A");
|
||
|
assert(md);
|
||
|
|
||
|
s->Unref();
|
||
|
md->Unref();
|
||
|
}
|
||
|
|
||
|
int main() {
|
||
|
TestSymbolTable();
|
||
|
}
|