mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-05-29 07:25:55 +02:00
Merge pull request #239 from redboltz/add_msgpack_prefix_to_erb
Added msgpack prefix to erb template files.
This commit is contained in:
commit
156a4403ab
@ -90,7 +90,7 @@ struct define<> {
|
|||||||
}
|
}
|
||||||
void msgpack_unpack(msgpack::object const& o)
|
void msgpack_unpack(msgpack::object const& o)
|
||||||
{
|
{
|
||||||
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
|
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
|
||||||
}
|
}
|
||||||
void msgpack_object(msgpack::object* o, msgpack::zone&) const
|
void msgpack_object(msgpack::object* o, msgpack::zone&) const
|
||||||
{
|
{
|
||||||
@ -115,7 +115,7 @@ struct define<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> {
|
|||||||
}
|
}
|
||||||
void msgpack_unpack(msgpack::object const& o)
|
void msgpack_unpack(msgpack::object const& o)
|
||||||
{
|
{
|
||||||
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
|
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
|
||||||
const size_t size = o.via.array.size;
|
const size_t size = o.via.array.size;
|
||||||
if(size > 0) {
|
if(size > 0) {
|
||||||
msgpack::object *ptr = o.via.array.ptr;
|
msgpack::object *ptr = o.via.array.ptr;
|
||||||
|
@ -139,7 +139,7 @@ inline tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_tuple(typename tuple_type<
|
|||||||
inline msgpack::object const& operator>> (
|
inline msgpack::object const& operator>> (
|
||||||
msgpack::object const& o,
|
msgpack::object const& o,
|
||||||
type::tuple<>&) {
|
type::tuple<>&) {
|
||||||
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
|
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
<%0.upto(GENERATION_LIMIT) {|i|%>
|
<%0.upto(GENERATION_LIMIT) {|i|%>
|
||||||
@ -147,8 +147,8 @@ template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
|
|||||||
inline msgpack::object const& operator>> (
|
inline msgpack::object const& operator>> (
|
||||||
msgpack::object const& o,
|
msgpack::object const& o,
|
||||||
type::tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>& v) {
|
type::tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>& v) {
|
||||||
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
|
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
|
||||||
if(o.via.array.size < <%=i+1%>) { throw type_error(); }
|
if(o.via.array.size < <%=i+1%>) { throw msgpack::type_error(); }
|
||||||
<%0.upto(i) {|j|%>
|
<%0.upto(i) {|j|%>
|
||||||
o.via.array.ptr[<%=j%>].convert<typename type::tuple_type<A<%=j%>>::type>(v.template get<<%=j%>>());<%}%>
|
o.via.array.ptr[<%=j%>].convert<typename type::tuple_type<A<%=j%>>::type>(v.template get<<%=j%>>());<%}%>
|
||||||
return o;
|
return o;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user