FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
msgpack-c/uvis2.cpp at cpp_master · msgpack/msgpack-c · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
msgpack
/
msgpack-c
Public
Notifications
You must be signed in to change notification settings
Fork
936
Star
3.3k
Code
Issues
92
Pull requests
11
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
msgpack-c
/
uvis2.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
23 lines (23 loc) · 1.34 KB
Breadcrumbs
msgpack-c
/
uvis2.cpp
Copy path
File metadata and controls
23 lines (23 loc) · 1.34 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#
include
<
msgpack.hpp
>
#
include
<
cstddef
>
#
include
<
cstdint
>
//
A standalone visitor: does NOT derive from msgpack::null_visitor.
struct
standalone_visitor
{
bool
visit_nil
(){
return
true
;}
bool
visit_boolean
(
bool
){
return
true
;}
bool
visit_positive_integer
(
uint64_t
){
return
true
;}
bool
visit_negative_integer
(
int64_t
){
return
true
;}
bool
visit_float32
(
float
){
return
true
;}
bool
visit_float64
(
double
){
return
true
;}
bool
visit_str
(
const
char
*,
uint32_t
){
return
true
;}
bool
visit_bin
(
const
char
*,
uint32_t
){
return
true
;}
bool
visit_ext
(
const
char
*, std::
size_t
){
return
true
;}
//
implements visit_ext, no null_visitor base
bool
start_array
(
uint32_t
){
return
true
;}
bool
start_array_item
(){
return
true
;}
bool
end_array_item
(){
return
true
;}
bool
end_array
(){
return
true
;}
bool
start_map
(
uint32_t
){
return
true
;}
bool
start_map_key
(){
return
true
;}
bool
end_map_key
(){
return
true
;}
bool
start_map_value
(){
return
true
;}
bool
end_map_value
(){
return
true
;}
bool
end_map
(){
return
true
;}
void
parse_error
(std::
size_t
,std::
size_t
){}
void
insufficient_bytes
(std::
size_t
,std::
size_t
){}
};
int
main
(){
msgpack::sbuffer sb;
char
d[]={
9
}; msgpack::packer<msgpack::sbuffer>
pk
(&sb);
pk.
pack_ext
(
1
,
7
); pk.
pack_ext_body
(d,
1
);
standalone_visitor v; std::
size_t
off=
0
;
return
msgpack::v2::parse
(sb.
data
(), sb.
size
(), off, v) ?
0
:
1
;
}
Back
|
FazBrowse Home
|
New Git URL