root/lang/c/msgpack/trunk/cpp/unpack_inline.cpp @ 18838

Revision 18782, 2.8 kB (checked in by frsyuki, 5 years ago)

lang/c/msgpack: added license notifications

Line 
1//
2// MessagePack for C++ deserializing routine
3//
4// Copyright (C) 2008 FURUHASHI Sadayuki
5//
6//    Licensed under the Apache License, Version 2.0 (the "License");
7//    you may not use this file except in compliance with the License.
8//    You may obtain a copy of the License at
9//
10//        http://www.apache.org/licenses/LICENSE-2.0
11//
12//    Unless required by applicable law or agreed to in writing, software
13//    distributed under the License is distributed on an "AS IS" BASIS,
14//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15//    See the License for the specific language governing permissions and
16//    limitations under the License.
17//
18#include "unpack_context.hpp"
19
20
21extern "C" {
22using namespace msgpack;
23
24
25static inline object_class* msgpack_unpack_init(zone** z)
26{ return NULL; }
27
28static inline object_class* msgpack_unpack_unsigned_int_8(zone** z, uint8_t d)
29{ return (*z)->nu8(d); }
30
31static inline object_class* msgpack_unpack_unsigned_int_16(zone** z, uint16_t d)
32{ return (*z)->nu16(d); }
33
34static inline object_class* msgpack_unpack_unsigned_int_32(zone** z, uint32_t d)
35{ return (*z)->nu32(d); }
36
37static inline object_class* msgpack_unpack_unsigned_int_64(zone** z, uint64_t d)
38{ return (*z)->nu64(d); }
39
40static inline object_class* msgpack_unpack_signed_int_8(zone** z, int8_t d)
41{ return (*z)->ni8(d); }
42
43static inline object_class* msgpack_unpack_signed_int_16(zone** z, int16_t d)
44{ return (*z)->ni16(d); }
45
46static inline object_class* msgpack_unpack_signed_int_32(zone** z, int32_t d)
47{ return (*z)->ni32(d); }
48
49static inline object_class* msgpack_unpack_signed_int_64(zone** z, int64_t d)
50{ return (*z)->ni64(d); }
51
52static inline object_class* msgpack_unpack_float(zone** z, float d)
53{ return (*z)->nfloat(d); }
54
55static inline object_class* msgpack_unpack_double(zone** z, double d)
56{ return (*z)->ndouble(d); }
57
58static inline object_class* msgpack_unpack_nil(zone** z)
59{ return (*z)->nnil(); }
60
61static inline object_class* msgpack_unpack_true(zone** z)
62{ return (*z)->ntrue(); }
63
64static inline object_class* msgpack_unpack_false(zone** z)
65{ return (*z)->nfalse(); }
66
67static inline object_class* msgpack_unpack_array_start(zone** z, unsigned int n)
68{ return (*z)->narray(n); }
69
70static inline void msgpack_unpack_array_item(zone** z, object_class* c, object_class* o)
71{ reinterpret_cast<object_array*>(c)->push_back(o); }
72
73static inline object_class* msgpack_unpack_map_start(zone** z, unsigned int n)
74{ return (*z)->narray(); }
75
76static inline void msgpack_unpack_map_item(zone** z, object_class* c, object_class* k, object_class* v)
77{ reinterpret_cast<object_map*>(c)->store(k, v); }
78
79static inline object_class* msgpack_unpack_raw(zone** z, const void* b, const void* p, size_t l)
80{ return (*z)->nraw_ref(p, l); }
81
82
83}  // extern "C"
84
85#include "msgpack/unpack/inline_impl.h"
86
Note: See TracBrowser for help on using the browser.