libcopp
2.2.0
atframework
cmake-toolset
ports
grpc
crosscompiling-upb-host
client-main.cpp
Go to the documentation of this file.
1
// Copyright 2021 atframework
2
3
#include <iostream>
4
5
#include "upb/def.hpp"
6
#include "upb/json_decode.h"
7
#include "upb/json_encode.h"
8
#include "upb/upb.hpp"
9
10
#include "helloworld.upb.h"
11
#include "helloworld.upbdefs.h"
12
13
int
main
() {
14
upb::Arena arena;
15
helloworld_HelloRequest* test_msg = helloworld_HelloRequest_new(arena.ptr());
16
helloworld_HelloRequest_set_name(test_msg, upb_StringView_FromString(
"hello world!"
));
17
size_t
size
;
18
helloworld_HelloRequest_serialize(test_msg, arena.ptr(), &
size
);
19
std::cout <<
size
<< std::endl;
20
return
0;
21
}
main
int main(int argc, char **argv)
Definition:
client-main.cpp:52
gsl::size
constexpr auto size(TCONTAINER &&container) -> decltype(container.size())
Definition:
span.h:44
Generated by
1.9.1