mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-21 07:45:02 +02:00
Compare commits
78 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e59f6e67a5 | ||
![]() |
9a8405bcd7 | ||
![]() |
9eca5a9ff6 | ||
![]() |
8388ced33f | ||
![]() |
0dcab0b2b1 | ||
![]() |
7df967142d | ||
![]() |
437400c6fe | ||
![]() |
ae8de13ab6 | ||
![]() |
39433e8588 | ||
![]() |
94c9bc2ddc | ||
![]() |
1088aa55af | ||
![]() |
66a5fcf8f1 | ||
![]() |
bb0617bd47 | ||
![]() |
f642b70e6a | ||
![]() |
3f4ffb9386 | ||
![]() |
cabd8a8a03 | ||
![]() |
8640754417 | ||
![]() |
7d1be40e10 | ||
![]() |
3c271892e3 | ||
![]() |
83ab53ecd4 | ||
![]() |
ba73841240 | ||
![]() |
13afc54ccc | ||
![]() |
2865a96ba5 | ||
![]() |
79222b65a3 | ||
![]() |
83f0429db8 | ||
![]() |
6c035f7d2b | ||
![]() |
ed5a4123b5 | ||
![]() |
b8530e30df | ||
![]() |
8bf2f33782 | ||
![]() |
356fbcf187 | ||
![]() |
1adf90e9df | ||
![]() |
c2f523e463 | ||
![]() |
1e8f5d0d67 | ||
![]() |
0a8d25cd35 | ||
![]() |
72e0d1a424 | ||
![]() |
c06d4d70ef | ||
![]() |
69f588dd36 | ||
![]() |
65b47fa032 | ||
![]() |
22fd249b12 | ||
![]() |
96831350b8 | ||
![]() |
5da3c031fd | ||
![]() |
71eba2406d | ||
![]() |
892fa8c2bd | ||
![]() |
42e332bb8c | ||
![]() |
40604c3d40 | ||
![]() |
e183efcce2 | ||
![]() |
772e4e01a3 | ||
![]() |
3660b495c3 | ||
![]() |
7a02f03a82 | ||
![]() |
953077b73f | ||
![]() |
ba15089d86 | ||
![]() |
b8ee27c672 | ||
![]() |
ee65a319ba | ||
![]() |
46502480e9 | ||
![]() |
50e1c23941 | ||
![]() |
b76c8aeb83 | ||
![]() |
b5599ef3fc | ||
![]() |
39e7856c48 | ||
![]() |
1a7aa5e5ec | ||
![]() |
aad5b96083 | ||
![]() |
dea3190d36 | ||
![]() |
c001a52582 | ||
![]() |
f58eb11fd5 | ||
![]() |
134beee0cd | ||
![]() |
434dae8424 | ||
![]() |
d8dd77884b | ||
![]() |
ea991d5a01 | ||
![]() |
6a127eb24f | ||
![]() |
5e57dc5da7 | ||
![]() |
d23a649427 | ||
![]() |
12ae60fd77 | ||
![]() |
282b0b5927 | ||
![]() |
0a261fca42 | ||
![]() |
20104301f3 | ||
![]() |
428780db53 | ||
![]() |
6bf5160bf2 | ||
![]() |
ef45359d81 | ||
![]() |
3202bb6a2e |
42
.travis.yml
42
.travis.yml
@@ -36,14 +36,14 @@ install:
|
||||
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then unzip -q gtest-1.7.0.zip && cd gtest-1.7.0 && sudo cp -r include/gtest /usr/local/include && clang++ src/gtest-all.cc -I. -Iinclude -c && g++ src/gtest_main.cc -I. -Iinclude -c && ar -rv libgtest.a gtest-all.o && ar -rv libgtest_main.a gtest_main.o && sudo mv *.a /usr/local/lib && cd ..; fi
|
||||
|
||||
env:
|
||||
- ACTION="ci/build_autotools.sh" VERSION="cpp03" ARCH="64" LIBPATH="/usr/local/lib" BOOST="boost" BOOST_INC="/usr/local/boost"
|
||||
- ACTION="ci/build_autotools.sh" VERSION="cpp03" ARCH="32" LIBPATH="/usr/local/lib32" BOOST="" BOOST_INC=""
|
||||
- ACTION="ci/build_cmake.sh" VERSION="cpp11" ARCH="64" LIBPATH="/usr/local/lib" BOOST="boost" BOOST_INC="/usr/local/boost"
|
||||
- ACTION="ci/build_cmake.sh" VERSION="cpp11" ARCH="32" LIBPATH="/usr/local/lib32" BOOST="" BOOST_INC="" SHARED="OFF"
|
||||
- ACTION="ci/build_autotools.sh" VERSION="cpp11" ARCH="64" LIBPATH="/usr/local/lib" BOOST="" BOOST_INC=""
|
||||
- ACTION="ci/build_autotools.sh" VERSION="cpp11" ARCH="32" LIBPATH="/usr/local/lib32" BOOST="boost" BOOST_INC="/usr/local/boost"
|
||||
- ACTION="ci/build_cmake.sh" VERSION="cpp03" ARCH="64" LIBPATH="/usr/local/lib" BOOST="" BOOST_INC=""
|
||||
- ACTION="ci/build_cmake.sh" VERSION="cpp03" ARCH="32" LIBPATH="/usr/local/lib32" BOOST="boost" BOOST_INC="/usr/local/boost" SHARED="OFF"
|
||||
- ACTION="ci/build_autotools.sh" VERSION="cpp03" ARCH="64" LIBPATH="/usr/local/lib" BOOST="boost" BOOST_INC="/usr/local/boost" CHAR_SIGN="unsigned"
|
||||
- ACTION="ci/build_autotools.sh" VERSION="cpp03" ARCH="32" LIBPATH="/usr/local/lib32" BOOST="" BOOST_INC="" CHAR_SIGN="signed"
|
||||
- ACTION="ci/build_cmake.sh" VERSION="cpp11" ARCH="64" LIBPATH="/usr/local/lib" BOOST="boost" BOOST_INC="/usr/local/boost" CHAR_SIGN="signed"
|
||||
- ACTION="ci/build_cmake.sh" VERSION="cpp11" ARCH="32" LIBPATH="/usr/local/lib32" BOOST="" BOOST_INC="" SHARED="OFF" CHAR_SIGN="unsigned"
|
||||
- ACTION="ci/build_autotools.sh" VERSION="cpp11" ARCH="64" LIBPATH="/usr/local/lib" BOOST="" BOOST_INC="" CHAR_SIGN="signed"
|
||||
- ACTION="ci/build_autotools.sh" VERSION="cpp11" ARCH="32" LIBPATH="/usr/local/lib32" BOOST="boost" BOOST_INC="/usr/local/boost" CHAR_SIGN="unsigned"
|
||||
- ACTION="ci/build_cmake.sh" VERSION="cpp03" ARCH="64" LIBPATH="/usr/local/lib" BOOST="" BOOST_INC="" CHAR_SIGN="unsigned"
|
||||
- ACTION="ci/build_cmake.sh" VERSION="cpp03" ARCH="32" LIBPATH="/usr/local/lib32" BOOST="boost" BOOST_INC="/usr/local/boost" SHARED="OFF" CHAR_SIGN="signed"
|
||||
|
||||
before_script:
|
||||
- export PATH=/usr/local/bin:$PATH && rm -rf install
|
||||
@@ -53,39 +53,39 @@ matrix:
|
||||
- os: osx
|
||||
compiler: gcc
|
||||
- os: osx
|
||||
env: ACTION="ci/build_autotools.sh" VERSION="cpp03" ARCH="32" LIBPATH="/usr/local/lib32" BOOST="" BOOST_INC=""
|
||||
env: ACTION="ci/build_autotools.sh" VERSION="cpp03" ARCH="32" LIBPATH="/usr/local/lib32" BOOST="" BOOST_INC="" CHAR_SIGN="signed"
|
||||
- os: osx
|
||||
env: ACTION="ci/build_cmake.sh" VERSION="cpp11" ARCH="32" LIBPATH="/usr/local/lib32" BOOST="" BOOST_INC="" SHARED="OFF"
|
||||
env: ACTION="ci/build_cmake.sh" VERSION="cpp11" ARCH="32" LIBPATH="/usr/local/lib32" BOOST="" BOOST_INC="" SHARED="OFF" CHAR_SIGN="unsigned"
|
||||
- os: osx
|
||||
env: ACTION="ci/build_autotools.sh" VERSION="cpp11" ARCH="32" LIBPATH="/usr/local/lib32" BOOST="boost" BOOST_INC="/usr/local/boost"
|
||||
env: ACTION="ci/build_autotools.sh" VERSION="cpp11" ARCH="32" LIBPATH="/usr/local/lib32" BOOST="boost" BOOST_INC="/usr/local/boost" CHAR_SIGN="unsigned"
|
||||
- os: osx
|
||||
env: ACTION="ci/build_cmake.sh" VERSION="cpp03" ARCH="32" LIBPATH="/usr/local/lib32" BOOST="boost" BOOST_INC="/usr/local/boost" SHARED="OFF"
|
||||
env: ACTION="ci/build_cmake.sh" VERSION="cpp03" ARCH="32" LIBPATH="/usr/local/lib32" BOOST="boost" BOOST_INC="/usr/local/boost" SHARED="OFF" CHAR_SIGN="signed"
|
||||
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: ACTION="ci/build_autotools.sh" VERSION="cpp03" ARCH="64" LIBPATH="/usr/local/lib" BOOST="boost" BOOST_INC="/usr/local/boost"
|
||||
env: ACTION="ci/build_autotools.sh" VERSION="cpp03" ARCH="64" LIBPATH="/usr/local/lib" BOOST="boost" BOOST_INC="/usr/local/boost" CHAR_SIGN="unsigned"
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: ACTION="ci/build_autotools.sh" VERSION="cpp03" ARCH="32" LIBPATH="/usr/local/lib32" BOOST="" BOOST_INC=""
|
||||
env: ACTION="ci/build_autotools.sh" VERSION="cpp03" ARCH="32" LIBPATH="/usr/local/lib32" BOOST="" BOOST_INC="" CHAR_SIGN="signed"
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: ACTION="ci/build_cmake.sh" VERSION="cpp11" ARCH="64" LIBPATH="/usr/local/lib" BOOST="boost" BOOST_INC="/usr/local/boost"
|
||||
env: ACTION="ci/build_cmake.sh" VERSION="cpp11" ARCH="64" LIBPATH="/usr/local/lib" BOOST="boost" BOOST_INC="/usr/local/boost" CHAR_SIGN="signed"
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: ACTION="ci/build_cmake.sh" VERSION="cpp11" ARCH="32" LIBPATH="/usr/local/lib32" BOOST="" BOOST_INC="" SHARED="OFF"
|
||||
env: ACTION="ci/build_cmake.sh" VERSION="cpp11" ARCH="32" LIBPATH="/usr/local/lib32" BOOST="" BOOST_INC="" SHARED="OFF" CHAR_SIGN="unsigned"
|
||||
|
||||
- os: linux
|
||||
compiler: clang
|
||||
env: ACTION="ci/build_autotools.sh" VERSION="cpp11" ARCH="64" LIBPATH="/usr/local/lib" BOOST="" BOOST_INC=""
|
||||
env: ACTION="ci/build_autotools.sh" VERSION="cpp11" ARCH="64" LIBPATH="/usr/local/lib" BOOST="" BOOST_INC="" CHAR_SIGN="signed"
|
||||
- os: linux
|
||||
compiler: clang
|
||||
env: ACTION="ci/build_autotools.sh" VERSION="cpp11" ARCH="32" LIBPATH="/usr/local/lib32" BOOST="boost" BOOST_INC="/usr/local/boost"
|
||||
env: ACTION="ci/build_autotools.sh" VERSION="cpp11" ARCH="32" LIBPATH="/usr/local/lib32" BOOST="boost" BOOST_INC="/usr/local/boost" CHAR_SIGN="unsigned"
|
||||
- os: linux
|
||||
compiler: clang
|
||||
env: ACTION="ci/build_cmake.sh" VERSION="cpp03" ARCH="64" LIBPATH="/usr/local/lib" BOOST="" BOOST_INC=""
|
||||
env: ACTION="ci/build_cmake.sh" VERSION="cpp03" ARCH="64" LIBPATH="/usr/local/lib" BOOST="" BOOST_INC="" CHAR_SIGN="unsigned"
|
||||
- os: linux
|
||||
compiler: clang
|
||||
env: ACTION="ci/build_cmake.sh" VERSION="cpp03" ARCH="32" LIBPATH="/usr/local/lib32" BOOST="boost" BOOST_INC="/usr/local/boost" SHARED="OFF"
|
||||
env: ACTION="ci/build_cmake.sh" VERSION="cpp03" ARCH="32" LIBPATH="/usr/local/lib32" BOOST="boost" BOOST_INC="/usr/local/boost" SHARED="OFF" CHAR_SIGN="signed"
|
||||
|
||||
script:
|
||||
- git clean -xdf && CMAKE_LIBRARY_PATH=${LIBPATH} ${ACTION} ${VERSION} ${ARCH} ${BOOST} ${BOOST_INC}
|
||||
- git clean -xdf && CMAKE_LIBRARY_PATH=${LIBPATH} ${ACTION} ${VERSION} ${ARCH} ${BOOST} ${BOOST_INC} ${CHAR_SIGN}
|
||||
|
106
CHANGELOG.md
106
CHANGELOG.md
@@ -1,9 +1,74 @@
|
||||
2015-09-04 version 1.2.0
|
||||
<< breaking change >>
|
||||
# 2016-05-26 version 1.4.2
|
||||
* Fix C++03 msgpack::zone::clear() memory access violation bug (#467)
|
||||
|
||||
# 2016-03-06 version 1.4.1
|
||||
|
||||
* Fix TARGET_OS_IPHONE checking (#436, #438)
|
||||
* Fix invalid front() call for empty container (#435. #437)
|
||||
* Fix compile error on g++6 (C++11 only) (#426, #428)
|
||||
* Fix zone size expansion logic (#423, #427)
|
||||
|
||||
# 2016-01-22 version 1.4.0
|
||||
|
||||
## << recommended changes >>
|
||||
|
||||
* Define [MSGPACK_DISABLE_LEGACY_NIL](https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_configure#msgpack_disable_legacy_nil-since-140), then `msgpack::type::nil` is replaced by with `msgpack::type::nil_t` (#408, #411, #412).
|
||||
Replace `msgpack::type::nil` with `msgpack::type::nil_t` in client codes.
|
||||
`msgpack::type::nil` will be removed on the version 2.0.0.
|
||||
* Define [MSGPACK_DISABLE_LEGACY_CONVERT](https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_configure#msgpack_disable_legacy_convert-since-140), then `msgpack::object::convert(T*)` is removed (#410).
|
||||
Replace calling `msgpack::bojectconvert(T*)` with `msgpack::bojectconvert(T&)` in client codes as follows:
|
||||
|
||||
```C++
|
||||
int i;
|
||||
obj.convert(&i); // before
|
||||
```
|
||||
|
||||
```C++
|
||||
int i;
|
||||
obj.convert(i); // after
|
||||
```
|
||||
|
||||
`msgpack::object::convert(T*)` will be removed on the version 2.0.0.
|
||||
|
||||
Define the macros above as follows when you compile C++ codes that use msgpack-c:
|
||||
|
||||
```
|
||||
g++ -Ipath_to_msgpack/include -DMSGPACK_DISABLE_LEGACY_NIL -DMSGPACK_DISABLE_LEGACY_CONVERT your_code.cpp
|
||||
|
||||
```
|
||||
|
||||
You can compile existing codes without defining macros above but I recommend defining them and updating your codes to fix the issues #408, #411, #412, #399, and #410. It is also a good preparation for the version 2.0.0.
|
||||
|
||||
## << other updates >>
|
||||
|
||||
* Improve documents (#387, #407)
|
||||
* Remove C++ version library (#394, #402)
|
||||
* Add Doxyfile and ChangeLog to the distribution package (#397)
|
||||
* Add signed/unsigned char test to travis-ci (#398)
|
||||
* Remove some warnings (#400, #401, #409)
|
||||
* Fix endian checking. (#404)
|
||||
|
||||
# 2015-11-21 version 1.3.0
|
||||
|
||||
* Change the license from the Apache License Version 2.0 to the
|
||||
Boost Software License, Version 1.0.(#386)
|
||||
* Remove some warnings (#365)
|
||||
* Add std::reference_wrapper support(#373, #384)
|
||||
* Improve tests (#375, #378, #379, #380)
|
||||
* Fix msvc specific problem (#376, #383)
|
||||
* Fix typos (#381)
|
||||
|
||||
# 2015-09-04 version 1.2.0
|
||||
|
||||
## << breaking changes >>
|
||||
|
||||
* Change std::vector<unsigned char> and std::array<unsigned char>
|
||||
mapped to BIN instead of ARRAY (#243)
|
||||
* Remove redundant copy (#285)
|
||||
|
||||
|
||||
## << other updates >>
|
||||
|
||||
* Add array_ref to map to ARRAY (#243)
|
||||
* Add variant type and adaptor (#349)
|
||||
* Add object::convert_if_not_nil() (#357)
|
||||
@@ -41,8 +106,11 @@
|
||||
* Add base class serialization. (#265, #277)
|
||||
* Add and improve examples. (#264, #310, #311, #341, #342, #344)
|
||||
* Fix wiki URL. (#263)
|
||||
2015-04-03 version 1.1.0
|
||||
<< breaking change >>
|
||||
|
||||
# 2015-04-03 version 1.1.0
|
||||
|
||||
## << breaking changes >>
|
||||
|
||||
* Remove msgpack_fwd.hpp
|
||||
* Improve user types adaptation mechanism (#262)
|
||||
Since version 1.0.0, users need to obey the correct include order.
|
||||
@@ -51,18 +119,24 @@
|
||||
care about include order. Migration guide from 1.0.x to 1.1.0 has
|
||||
been written. See https://github.com/msgpack/msgpack-c/wiki
|
||||
|
||||
|
||||
## << other updates >>
|
||||
|
||||
* Fix vector<bool> size check (#251)
|
||||
* Fix inttypes.h inclusion on MSVC (#257)
|
||||
* Support documents generation by Doxygen (#259)
|
||||
* Remove C99 style variable declaration (#253)
|
||||
* Improve documents (https://github.com/msgpack/msgpack-c/wiki)
|
||||
2015-03-22 version 1.0.1:
|
||||
|
||||
# 2015-03-22 version 1.0.1:
|
||||
|
||||
* Fix compilation error on Mac 10.9 (#244)
|
||||
* Fix typos in documents (#240)
|
||||
* Update CHANGELOG.md for version 1.0.0 (#242)
|
||||
* Fix erb templates for the next code generation (#239)
|
||||
|
||||
2015-03-10 version 1.0.0:
|
||||
# 2015-03-10 version 1.0.0:
|
||||
|
||||
* Support msgpack v5 format (str, bin, and ext) https://github.com/msgpack/msgpack/blob/master/spec.md (#142)
|
||||
* Support std::tuple, std::forward_list, std::array, std::unordered_set, std::unordered_map on C++11. tr1 unordered containers are still supported (#53, #130, #137, #154, #169)
|
||||
* Update msgpack-c as a header-only library on C++ (#142)
|
||||
@@ -88,7 +162,7 @@
|
||||
* Improve documents (https://github.com/msgpack/msgpack-c/wiki)
|
||||
* Other bug fixes and refactoring: #62, #91, #95, #97, #107, #109, #113, #117, #119, #121, #122, #123, #126, #131, #136, #138, #140, #143, #145, #146, #150, #151, #152, #156, #157, #158, #161, #165, #170, #172, #179, #180, #181, #182, #183, #192, #195, #199, #200, #207, #211, #212, #219, #222, #224, #230, #231, #232, #233, #234, #235
|
||||
|
||||
2014-07-02 version 0.5.9:
|
||||
# 2014-07-02 version 0.5.9:
|
||||
|
||||
* Support std::tr1 unordered containers by default (#51, #63, #68, #69)
|
||||
* Remove some warnings (#56)
|
||||
@@ -102,7 +176,7 @@
|
||||
* Add FILE* buffer (#40)
|
||||
* Other bug fixes and refactoring: #39, #73, #77, #79, #80, #81, #84, #90
|
||||
|
||||
2013-12-23 version 0.5.8:
|
||||
# 2013-12-23 version 0.5.8:
|
||||
|
||||
* Move to the new github repository msgpack/msgpack-c
|
||||
* Support the new deserialization specification
|
||||
@@ -110,38 +184,38 @@
|
||||
* Other bug fixes and refactoring: #46, #41, #36, #35, #33, #32, #30, #29, #28, #27, #26, #25, #8, #3
|
||||
* Update of documents: #23, #18, #17
|
||||
|
||||
2011-08-08 version 0.5.7:
|
||||
# 2011-08-08 version 0.5.7:
|
||||
|
||||
* fixes compile error problem with llvm-gcc and Mac OS X Lion
|
||||
|
||||
2011-04-24 version 0.5.6:
|
||||
# 2011-04-24 version 0.5.6:
|
||||
|
||||
* #42 fixes double-free problem on msgpack_unpacker_release_zone
|
||||
|
||||
2011-02-24 version 0.5.5:
|
||||
# 2011-02-24 version 0.5.5:
|
||||
|
||||
* eliminates dependency of winsock2.h header
|
||||
* fixes msgpack_vc.postbuild.bat file
|
||||
* fixes some implicit cast warnings
|
||||
|
||||
2010-08-29 version 0.5.4:
|
||||
# 2010-08-29 version 0.5.4:
|
||||
|
||||
* includes msgpack_vc2008.vcproj file in source package
|
||||
* fixes type::fix_int types
|
||||
|
||||
2010-08-27 version 0.5.3:
|
||||
# 2010-08-27 version 0.5.3:
|
||||
|
||||
* adds type::fix_{u,}int{8,16,32,64} types
|
||||
* adds msgpack_pack_fix_{u,}int{8,16,32,64} functions
|
||||
* adds packer<Stream>::pack_fix_{u,}int{8,16,32,64} functions
|
||||
* fixes include paths
|
||||
|
||||
2010-07-14 version 0.5.2:
|
||||
# 2010-07-14 version 0.5.2:
|
||||
|
||||
* type::raw::str(), operator==, operator!=, operator< and operator> are now const
|
||||
* generates version.h using AC_OUTPUT macro in ./configure
|
||||
|
||||
2010-07-06 version 0.5.1:
|
||||
# 2010-07-06 version 0.5.1:
|
||||
|
||||
* Add msgpack_vrefbuffer_new and msgpack_vrefbuffer_free
|
||||
* Add msgpack_sbuffer_new and msgpack_sbuffer_free
|
||||
@@ -151,7 +225,7 @@
|
||||
* Add msgpack_version{,_major,_minor} functions to check library version
|
||||
* ./configure supports --disable-cxx option not to build C++ API
|
||||
|
||||
2010-04-29 version 0.5.0:
|
||||
# 2010-04-29 version 0.5.0:
|
||||
|
||||
* msgpack_object_type is changed. MSGPACK_OBJECT_NIL is now 0x00.
|
||||
* New safe streaming deserializer API.
|
||||
|
@@ -14,11 +14,16 @@ SET (prefix ${CMAKE_INSTALL_PREFIX})
|
||||
SET (exec_prefix "\${prefix}")
|
||||
SET (libdir "\${exec_prefix}/lib")
|
||||
SET (includedir "\${prefix}/include")
|
||||
SET (GNUCXX_STD_SUPPORT_VERSION "4.3")
|
||||
SET (GNUCXX_NO_MISMATCHED_TAGS_SUPPORT_VERSION "4.4")
|
||||
|
||||
OPTION (MSGPACK_CXX11 "Using c++11 compiler" OFF)
|
||||
OPTION (MSGPACK_32BIT "32bit compile" OFF)
|
||||
OPTION (MSGPACK_BOOST "Using boost libraries" OFF)
|
||||
|
||||
SET (CMAKE_CXX_FLAGS "-DMSGPACK_DISABLE_LEGACY_NIL ${CMAKE_CXX_FLAGS}")
|
||||
SET (CMAKE_CXX_FLAGS "-DMSGPACK_DISABLE_LEGACY_CONVERT ${CMAKE_CXX_FLAGS}")
|
||||
|
||||
IF (APPLE)
|
||||
SET(CMAKE_MACOSX_RPATH ON)
|
||||
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
@@ -43,7 +48,10 @@ IF (MSGPACK_CXX11)
|
||||
ENDIF ()
|
||||
ELSE ()
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
SET (CMAKE_CXX_FLAGS "-std=c++03 ${CMAKE_CXX_FLAGS}")
|
||||
IF ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER ${GNUCXX_STD_SUPPORT_VERSION}) OR
|
||||
(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL ${GNUCXX_STD_SUPPORT_VERSION}))
|
||||
SET (CMAKE_CXX_FLAGS "-std=c++03 ${CMAKE_CXX_FLAGS}")
|
||||
ENDIF ()
|
||||
ELSEIF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
SET (CMAKE_CXX_FLAGS "-std=c++03 ${CMAKE_CXX_FLAGS}")
|
||||
ELSEIF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
@@ -76,6 +84,11 @@ IF (MSGPACK_BOOST)
|
||||
)
|
||||
ENDIF ()
|
||||
|
||||
IF (MSGPACK_CHAR_SIGN)
|
||||
SET (CMAKE_C_FLAGS "-f${MSGPACK_CHAR_SIGN}-char ${CMAKE_C_FLAGS}")
|
||||
SET (CMAKE_CXX_FLAGS "-f${MSGPACK_CHAR_SIGN}-char ${CMAKE_CXX_FLAGS}")
|
||||
ENDIF ()
|
||||
|
||||
FILE (GLOB_RECURSE PREDEF_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/external/boost/predef/include/boost ${CMAKE_CURRENT_SOURCE_DIR}/external/boost/predef/include/boost/*.h)
|
||||
FOREACH (F ${PREDEF_FILES})
|
||||
SET(M "Converting ${F}")
|
||||
@@ -119,14 +132,8 @@ int main(int argc, char * argv[])
|
||||
}
|
||||
" MSGPACK_ENABLE_GCC_CXX_ATOMIC)
|
||||
|
||||
IF (MSGPACK_ENABLE_GCC_CXX_ATOMIC)
|
||||
LIST (APPEND msgpack_SOURCES
|
||||
src/gcc_atomic.cpp
|
||||
)
|
||||
ENDIF ()
|
||||
|
||||
|
||||
LIST (APPEND msgpack_SOURCES
|
||||
LIST (APPEND msgpackc_SOURCES
|
||||
src/unpack.c
|
||||
src/objectc.c
|
||||
src/version.c
|
||||
@@ -134,7 +141,7 @@ LIST (APPEND msgpack_SOURCES
|
||||
src/zone.c
|
||||
)
|
||||
|
||||
LIST (APPEND msgpack_HEADERS
|
||||
LIST (APPEND msgpackc_HEADERS
|
||||
include/msgpack/pack_define.h
|
||||
include/msgpack/pack_template.h
|
||||
include/msgpack/unpack_define.h
|
||||
@@ -157,8 +164,8 @@ LIST (APPEND msgpack_HEADERS
|
||||
|
||||
FILE (GLOB_RECURSE PREDEF_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include/msgpack/predef/*.h)
|
||||
|
||||
LIST (APPEND msgpack_HEADERS ${PREDEF_FILES})
|
||||
LIST (APPEND msgpack_HEADERS include/msgpack/predef.h)
|
||||
LIST (APPEND msgpackc_HEADERS ${PREDEF_FILES})
|
||||
LIST (APPEND msgpackc_HEADERS include/msgpack/predef.h)
|
||||
|
||||
IF (MSGPACK_ENABLE_CXX)
|
||||
LIST (APPEND msgpack_HEADERS
|
||||
@@ -176,6 +183,7 @@ IF (MSGPACK_ENABLE_CXX)
|
||||
include/msgpack/adaptor/cpp11/array_char.hpp
|
||||
include/msgpack/adaptor/cpp11/array_unsigned_char.hpp
|
||||
include/msgpack/adaptor/cpp11/forward_list.hpp
|
||||
include/msgpack/adaptor/cpp11/reference_wrapper.hpp
|
||||
include/msgpack/adaptor/cpp11/shared_ptr.hpp
|
||||
include/msgpack/adaptor/cpp11/tuple.hpp
|
||||
include/msgpack/adaptor/cpp11/unique_ptr.hpp
|
||||
@@ -228,8 +236,8 @@ IF (MSGPACK_ENABLE_CXX)
|
||||
)
|
||||
FILE (GLOB_RECURSE PREPROCESSOR_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include/msgpack/preprocessor/*.hpp)
|
||||
|
||||
LIST (APPEND msgpack_HEADERS ${PREPROCESSOR_FILES})
|
||||
LIST (APPEND msgpack_HEADERS include/msgpack/preprocessor.hpp)
|
||||
LIST (APPEND msgpackc_HEADERS ${PREPROCESSOR_FILES})
|
||||
LIST (APPEND msgpackc_HEADERS include/msgpack/preprocessor.hpp)
|
||||
ENDIF ()
|
||||
|
||||
EXECUTE_PROCESS (
|
||||
@@ -249,21 +257,21 @@ INCLUDE_DIRECTORIES (
|
||||
)
|
||||
|
||||
IF (MSGPACK_ENABLE_SHARED)
|
||||
ADD_LIBRARY (msgpack SHARED
|
||||
${msgpack_SOURCES}
|
||||
${msgpack_HEADERS}
|
||||
ADD_LIBRARY (msgpackc SHARED
|
||||
${msgpackc_SOURCES}
|
||||
${msgpackc_HEADERS}
|
||||
)
|
||||
ENDIF ()
|
||||
|
||||
ADD_LIBRARY (msgpack-static STATIC
|
||||
${msgpack_SOURCES}
|
||||
${msgpack_HEADERS}
|
||||
ADD_LIBRARY (msgpackc-static STATIC
|
||||
${msgpackc_SOURCES}
|
||||
${msgpackc_HEADERS}
|
||||
)
|
||||
|
||||
SET_TARGET_PROPERTIES (msgpack-static PROPERTIES OUTPUT_NAME "msgpack")
|
||||
SET_TARGET_PROPERTIES (msgpackc-static PROPERTIES OUTPUT_NAME "msgpackc")
|
||||
IF (MSGPACK_ENABLE_SHARED)
|
||||
SET_TARGET_PROPERTIES (msgpack PROPERTIES IMPORT_SUFFIX "_import.lib")
|
||||
SET_TARGET_PROPERTIES (msgpack PROPERTIES SOVERSION 3 VERSION 4.0.0)
|
||||
SET_TARGET_PROPERTIES (msgpackc PROPERTIES IMPORT_SUFFIX "_import.lib")
|
||||
SET_TARGET_PROPERTIES (msgpackc PROPERTIES SOVERSION 2 VERSION 2.0.0)
|
||||
ENDIF ()
|
||||
|
||||
IF (MSGPACK_BUILD_TESTS)
|
||||
@@ -277,10 +285,22 @@ ENDIF ()
|
||||
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
IF (MSGPACK_ENABLE_SHARED)
|
||||
SET_PROPERTY (TARGET msgpack APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Wno-mismatched-tags -Werror -g -O3 -DPIC")
|
||||
SET_PROPERTY (TARGET msgpackc APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Werror -g -O3 -DPIC")
|
||||
ENDIF ()
|
||||
SET_PROPERTY (TARGET msgpack-static APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Wno-mismatched-tags -Werror -g -O3" )
|
||||
SET_PROPERTY (TARGET msgpackc-static APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Werror -g -O3" )
|
||||
ENDIF ()
|
||||
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
SET_PROPERTY (TARGET msgpackc APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
|
||||
ENDIF ()
|
||||
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
IF ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER ${GNUCXX_NO_MISMATCHED_TAGS_SUPPORT_VERSION}) OR
|
||||
(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL ${GNUCXX_NO_MISMATCHED_TAGS_SUPPORT_VERSION}))
|
||||
SET_PROPERTY (TARGET msgpackc APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
|
||||
ENDIF ()
|
||||
ENDIF ()
|
||||
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
IF (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
||||
STRING(REGEX REPLACE "/W[0-4]" "/W3 /WX" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
@@ -290,7 +310,7 @@ IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
ENDIF ()
|
||||
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC90" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC10")
|
||||
SET_SOURCE_FILES_PROPERTIES(${msgpack_SOURCES} PROPERTIES LANGUAGE CXX)
|
||||
SET_SOURCE_FILES_PROPERTIES(${msgpackc_SOURCES} PROPERTIES LANGUAGE CXX)
|
||||
ENDIF()
|
||||
|
||||
IF (NOT DEFINED CMAKE_INSTALL_LIBDIR)
|
||||
@@ -302,9 +322,9 @@ IF (MSGPACK_BUILD_EXAMPLES)
|
||||
ENDIF ()
|
||||
|
||||
IF (MSGPACK_ENABLE_SHARED)
|
||||
SET (MSGPACK_INSTALLTARGETS msgpack msgpack-static)
|
||||
SET (MSGPACK_INSTALLTARGETS msgpackc msgpackc-static)
|
||||
ELSE()
|
||||
SET (MSGPACK_INSTALLTARGETS msgpack-static)
|
||||
SET (MSGPACK_INSTALLTARGETS msgpackc-static)
|
||||
ENDIF ()
|
||||
|
||||
INSTALL (TARGETS ${MSGPACK_INSTALLTARGETS} DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
|
17
COPYING
17
COPYING
@@ -1,14 +1,5 @@
|
||||
Copyright (C) 2008-2010 FURUHASHI Sadayuki
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
Copyright (C) 2008-2015 FURUHASHI Sadayuki
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
38
CROSSLANG.md
38
CROSSLANG.md
@@ -1,38 +0,0 @@
|
||||
MessagePack cross-language test cases
|
||||
=====================================
|
||||
|
||||
## cases
|
||||
|
||||
Valid serialized data are stored in "cases.mpac" and "cases_compact.mpac".
|
||||
These files describe same objects. And "cases.json" describes an array of the described objects.
|
||||
|
||||
Thus you can verify your implementations as comparing the objects.
|
||||
|
||||
|
||||
## crosslang
|
||||
|
||||
The *crosslang* tool reads serialized data from stdin and writes re-serialize data to stdout.
|
||||
|
||||
There are C++ and Ruby implementation of crosslang tool. You can verify your implementation
|
||||
as comparing that implementations.
|
||||
|
||||
### C++ version
|
||||
|
||||
$ cd ../cpp && ./configure && make && make install
|
||||
or
|
||||
$ port install msgpack # MacPorts
|
||||
|
||||
$ g++ -Wall crosslang.cc -lmsgpack -o crosslang
|
||||
|
||||
$ ./crosslang
|
||||
Usage: ./crosslang [in-file] [out-file]
|
||||
|
||||
### Ruby version
|
||||
|
||||
$ gem install msgpack
|
||||
or
|
||||
$ port install rb_msgpack # MacPorts
|
||||
|
||||
$ ruby crosslang.rb
|
||||
Usage: crosslang.rb [in-file] [out-file]
|
||||
|
202
LICENSE
202
LICENSE
@@ -1,202 +0,0 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
23
LICENSE_1_0.txt
Normal file
23
LICENSE_1_0.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
execute, and transmit the Software, and to prepare derivative works of the
|
||||
Software, and to permit third-parties to whom the Software is furnished to
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
the above license grant, this restriction and the following disclaimer,
|
||||
must be included in all copies of the Software, in whole or in part, and
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
@@ -1,8 +1,9 @@
|
||||
SUBDIRS = src test
|
||||
|
||||
DOC_FILES = \
|
||||
Doxyfile \
|
||||
README.md \
|
||||
LICENSE \
|
||||
LICENSE_1_0.txt \
|
||||
NOTICE \
|
||||
msgpack_vc8.vcproj \
|
||||
msgpack_vc8.sln
|
||||
|
34
NOTICE
34
NOTICE
@@ -1,5 +1,9 @@
|
||||
This product bundles Boost Predef, which is available under a
|
||||
Boost Software License - Version 1.0. For details, see the following files
|
||||
This product bundles Boost Predef and Boost Preprocessor.
|
||||
They are distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
For details, see the following files:
|
||||
|
||||
external/boost/predef
|
||||
include/msgpack/predef.h
|
||||
@@ -8,29 +12,3 @@ include/msgpack/predef/*
|
||||
external/boost/preprocessor
|
||||
include/msgpack/preprocessor.hpp
|
||||
include/msgpack/preprocessor/*
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
execute, and transmit the Software, and to prepare derivative works of the
|
||||
Software, and to permit third-parties to whom the Software is furnished to
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
the above license grant, this restriction and the following disclaimer,
|
||||
must be included in all copies of the Software, in whole or in part, and
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
---------------------------------------------------------------------------
|
||||
|
@@ -36,9 +36,9 @@ On Gentoo Linux, you can use emerge. Install [dev-libs/msgpack|http://gentoo-por
|
||||
On the other UNIX-like platforms, download source package from [Releases|http://msgpack.org/releases/cpp/] and run `./configure && make && make install`.
|
||||
|
||||
```
|
||||
$ wget http://msgpack.org/releases/cpp/msgpack-0.5.5.tar.gz
|
||||
$ tar zxvf msgpack-0.5.5.tar.gz
|
||||
$ cd msgpack-0.5.5
|
||||
$ wget http://msgpack.org/releases/cpp/msgpack-1.3.0.tar.gz
|
||||
$ tar zxvf msgpack-1.3.0.tar.gz
|
||||
$ cd msgpack-1.3.0
|
||||
$ ./configure
|
||||
$ make
|
||||
$ sudo make install
|
||||
@@ -88,10 +88,10 @@ int main(void) {
|
||||
|
||||
/* serializes ["Hello", "MessagePack"]. */
|
||||
msgpack_pack_array(pk, 2);
|
||||
msgpack_pack_raw(pk, 5);
|
||||
msgpack_pack_raw_body(pk, "Hello", 5);
|
||||
msgpack_pack_raw(pk, 11);
|
||||
msgpack_pack_raw_body(pk, "MessagePack", 11);
|
||||
msgpack_pack_bin(pk, 5);
|
||||
msgpack_pack_bin_body(pk, "Hello", 5);
|
||||
msgpack_pack_bin(pk, 11);
|
||||
msgpack_pack_bin_body(pk, "MessagePack", 11);
|
||||
|
||||
/* deserializes it. */
|
||||
msgpack_unpacked msg;
|
||||
@@ -119,7 +119,7 @@ int main(void) {
|
||||
/* creates buffer and serializer instance. */
|
||||
msgpack_sbuffer* buffer = msgpack_sbuffer_new();
|
||||
msgpack_packer* pk = msgpack_packer_new(buffer, msgpack_sbuffer_write);
|
||||
|
||||
|
||||
int j;
|
||||
|
||||
for(j = 0; j<23; j++) {
|
||||
@@ -128,10 +128,10 @@ int main(void) {
|
||||
|
||||
/* serializes ["Hello", "MessagePack"]. */
|
||||
msgpack_pack_array(pk, 3);
|
||||
msgpack_pack_raw(pk, 5);
|
||||
msgpack_pack_raw_body(pk, "Hello", 5);
|
||||
msgpack_pack_raw(pk, 11);
|
||||
msgpack_pack_raw_body(pk, "MessagePack", 11);
|
||||
msgpack_pack_bin(pk, 5);
|
||||
msgpack_pack_bin_body(pk, "Hello", 5);
|
||||
msgpack_pack_bin(pk, 11);
|
||||
msgpack_pack_bin_body(pk, "MessagePack", 11);
|
||||
msgpack_pack_int(pk, j);
|
||||
|
||||
/* deserializes it. */
|
||||
@@ -184,7 +184,7 @@ int main(void) {
|
||||
}
|
||||
|
||||
/* results:
|
||||
* $ gcc stream.cc -lmsgpack -o stream
|
||||
* $ gcc stream.cc -lmsgpackc -o stream
|
||||
* $ ./stream
|
||||
* 1
|
||||
* 2
|
||||
|
@@ -40,18 +40,20 @@ int main(void) {
|
||||
|
||||
// convert it into statically typed object.
|
||||
std::vector<std::string> rvec;
|
||||
obj.convert(&rvec);
|
||||
obj.convert(rvec);
|
||||
}
|
||||
```
|
||||
|
||||
Compile it as follows:
|
||||
|
||||
```
|
||||
$ g++ hello.cc -lmsgpack -o hello
|
||||
$ g++ -Ipath_to_msgpack/include -DMSGPACK_DISABLE_LEGACY_NIL -DMSGPACK_DISABLE_LEGACY_CONVERT hello.cc -o hello
|
||||
$ ./hello
|
||||
["Hello", "MessagePack"]
|
||||
```
|
||||
|
||||
See [MSGPACK_DISABLE_LEGACY_NIL](https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_configure#msgpack_disable_legacy_nil-since-140) and [MSGPACK_DISABLE_LEGACY_CONVERT](https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_configure#msgpack_disable_legacy_convert-since-140).
|
||||
|
||||
## Streaming feature
|
||||
|
||||
```cpp
|
||||
@@ -83,7 +85,7 @@ int main(void) {
|
||||
}
|
||||
|
||||
// results:
|
||||
// $ g++ stream.cc -lmsgpack -o stream
|
||||
// $ g++ -Ipath_to_msgpack/include -DMSGPACK_DISABLE_LEGACY_NIL -DMSGPACK_DISABLE_LEGACY_CONVERT stream.cc -o stream
|
||||
// $ ./stream
|
||||
// "Log message ... 1"
|
||||
// "Log message ... 2"
|
||||
@@ -91,6 +93,8 @@ int main(void) {
|
||||
}
|
||||
```
|
||||
|
||||
See [MSGPACK_DISABLE_LEGACY_NIL](https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_configure#msgpack_disable_legacy_nil-since-140) and [MSGPACK_DISABLE_LEGACY_CONVERT](https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_configure#msgpack_disable_legacy_convert-since-140).
|
||||
|
||||
### Streaming into an array or map
|
||||
|
||||
```cpp
|
||||
@@ -154,6 +158,6 @@ int main(void) {
|
||||
|
||||
// you can convert object to myclass directly
|
||||
std::vector<myclass> rvec;
|
||||
obj.convert(&rvec);
|
||||
obj.convert(rvec);
|
||||
}
|
||||
```
|
||||
|
12
README.md
12
README.md
@@ -1,7 +1,7 @@
|
||||
`msgpack` for C/C++
|
||||
===================
|
||||
|
||||
Version 1.2.0 [](https://travis-ci.org/msgpack/msgpack-c) [](https://ci.appveyor.com/project/redboltz/msgpack-c/branch/master)
|
||||
Version 1.4.2 [](https://travis-ci.org/msgpack/msgpack-c) [](https://ci.appveyor.com/project/redboltz/msgpack-c/branch/master)
|
||||
|
||||
It's like JSON but small and fast.
|
||||
|
||||
@@ -96,7 +96,7 @@ int main(void)
|
||||
// convert msgpack::object instance into the original type.
|
||||
// if the type is mismatched, it throws msgpack::type_error exception.
|
||||
msgpack::type::tuple<int, bool, std::string> dst;
|
||||
deserialized.convert(&dst);
|
||||
deserialized.convert(dst);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -112,7 +112,9 @@ Usage
|
||||
When you use msgpack on C++03 and C++11, you can just add
|
||||
msgpack-c/include to your include path:
|
||||
|
||||
g++ -I msgpack-c/include your_source_file.cpp
|
||||
g++ -I msgpack-c/include -DMSGPACK_DISABLE_LEGACY_NIL -DMSGPACK_DISABLE_LEGACY_CONVERT your_source_file.cpp
|
||||
|
||||
See [MSGPACK_DISABLE_LEGACY_NIL](https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_configure#msgpack_disable_legacy_nil-since-140) and [MSGPACK_DISABLE_LEGACY_CONVERT](https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_configure#msgpack_disable_legacy_convert-since-140).
|
||||
|
||||
If you want to use C version of msgpack, you need to build it. You can
|
||||
also install the C and C++ versions of msgpack.
|
||||
@@ -215,5 +217,5 @@ Here's the list of [great contributors](https://github.com/msgpack/msgpack-c/gra
|
||||
License
|
||||
-------
|
||||
|
||||
`msgpack-c` is licensed under the Apache License Version 2.0. See
|
||||
the [`LICENSE`](./LICENSE) file for details.
|
||||
`msgpack-c` is licensed under the Boost Software License, Version 1.0. See
|
||||
the [`LICENSE_1_0.txt`](./LICENSE_1_0.txt) file for details.
|
||||
|
@@ -34,7 +34,7 @@ fi
|
||||
mkdir -p ac
|
||||
test -f AUTHORS || touch AUTHORS
|
||||
test -f COPYING || touch COPYING
|
||||
test -f ChangeLog || touch ChangeLog
|
||||
test -f ChangeLog || cp -f CHANGELOG.md ChangeLog
|
||||
test -f NEWS || touch NEWS
|
||||
test -f NOTICE || touch NOTICE
|
||||
test -f README || cp -f README.md README
|
||||
|
@@ -1 +0,0 @@
|
||||
[false,true,null,0,0,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,127,127,255,65535,4294967295,-32,-32,-128,-32768,-2147483648,0.0,-0.0,1.0,-1.0,"a","a","a","","","",[0],[0],[0],[],[],[],{},{},{},{"a":97},{"a":97},{"a":97},[[]],[["a"]]]
|
99
cases_gen.rb
99
cases_gen.rb
@@ -1,99 +0,0 @@
|
||||
#
|
||||
# MessagePack format test case
|
||||
#
|
||||
begin
|
||||
require 'rubygems'
|
||||
rescue LoadError
|
||||
end
|
||||
require 'msgpack'
|
||||
require 'json'
|
||||
|
||||
source = <<EOF
|
||||
c2 # false
|
||||
c3 # true
|
||||
c0 # nil
|
||||
00 # 0 Positive FixNum
|
||||
cc 00 # 0 uint8
|
||||
cd 00 00 # 0 uint16
|
||||
ce 00 00 00 00 # 0 uint32
|
||||
cf 00 00 00 00 00 00 00 00 # 0 uint64
|
||||
d0 00 # 0 int8
|
||||
d1 00 00 # 0 int16
|
||||
d2 00 00 00 00 # 0 int32
|
||||
d3 00 00 00 00 00 00 00 00 # 0 int64
|
||||
ff # -1 Negative FixNum
|
||||
d0 ff # -1 int8
|
||||
d1 ff ff # -1 int16
|
||||
d2 ff ff ff ff # -1 int32
|
||||
d3 ff ff ff ff ff ff ff ff # -1 int64
|
||||
7f # 127 Positive FixNum
|
||||
cc 7f # 127 uint8
|
||||
cd 00 ff # 255 uint16
|
||||
ce 00 00 ff ff # 65535 uint32
|
||||
cf 00 00 00 00 ff ff ff ff # 4294967295 uint64
|
||||
e0 # -32 Negative FixNum
|
||||
d0 e0 # -32 int8
|
||||
d1 ff 80 # -128 int16
|
||||
d2 ff ff 80 00 # -32768 int32
|
||||
d3 ff ff ff ff 80 00 00 00 # -2147483648 int64
|
||||
#ca 00 00 00 00 # 0.0 float
|
||||
cb 00 00 00 00 00 00 00 00 # 0.0 double
|
||||
#ca 80 00 00 00 # -0.0 float
|
||||
cb 80 00 00 00 00 00 00 00 # -0.0 double
|
||||
cb 3f f0 00 00 00 00 00 00 # 1.0 double
|
||||
cb bf f0 00 00 00 00 00 00 # -1.0 double
|
||||
a1 61 # "a" FixRaw
|
||||
da 00 01 61 # "a" raw 16
|
||||
db 00 00 00 01 61 # "a" raw 32
|
||||
a0 # "" FixRaw
|
||||
da 00 00 # "" raw 16
|
||||
db 00 00 00 00 # "" raw 32
|
||||
91 00 # [0] FixArray
|
||||
dc 00 01 00 # [0] array 16
|
||||
dd 00 00 00 01 00 # [0] array 32
|
||||
90 # [] FixArray
|
||||
dc 00 00 # [] array 16
|
||||
dd 00 00 00 00 # [] array 32
|
||||
80 # {} FixMap
|
||||
de 00 00 # {} map 16
|
||||
df 00 00 00 00 # {} map 32
|
||||
81 a1 61 61 # {"a"=>97} FixMap
|
||||
de 00 01 a1 61 61 # {"a"=>97} map 16
|
||||
df 00 00 00 01 a1 61 61 # {"a"=>97} map 32
|
||||
91 90 # [[]]
|
||||
91 91 a1 61 # [["a"]]
|
||||
EOF
|
||||
|
||||
source.gsub!(/\#.+$/,'')
|
||||
bytes = source.strip.split(/\s+/).map {|x| x.to_i(16) }.pack('C*')
|
||||
|
||||
objs = []
|
||||
compact_bytes = ""
|
||||
|
||||
pac = MessagePack::Unpacker.new
|
||||
pac.feed(bytes)
|
||||
pac.each {|obj|
|
||||
p obj
|
||||
objs << obj
|
||||
compact_bytes << obj.to_msgpack
|
||||
}
|
||||
|
||||
json = objs.to_json
|
||||
|
||||
# self check
|
||||
cpac = MessagePack::Unpacker.new
|
||||
cpac.feed(compact_bytes)
|
||||
cpac.each {|cobj|
|
||||
obj = objs.shift
|
||||
if obj != cobj
|
||||
puts "** SELF CHECK FAILED **"
|
||||
puts "expected: #{obj.inspect}"
|
||||
puts "actual: #{cobj.inspect}"
|
||||
exit 1
|
||||
end
|
||||
}
|
||||
|
||||
File.open("cases.mpac","w") {|f| f.write(bytes) }
|
||||
File.open("cases_compact.mpac","w") {|f| f.write(compact_bytes) }
|
||||
File.open("cases.json","w") {|f| f.write(json) }
|
||||
|
@@ -28,7 +28,7 @@ else
|
||||
boost=""
|
||||
fi
|
||||
|
||||
./configure CFLAGS="$bit32" CXXFLAGS="$bit32 $cpp11 $boost -I$4"
|
||||
./configure CFLAGS="$bit32 -f${CHAR_SIGN}-char" CXXFLAGS="$bit32 -f${CHAR_SIGN}-char $cpp11 $boost -I$4"
|
||||
|
||||
ret=$?
|
||||
if [ $ret -ne 0 ]
|
||||
|
@@ -51,7 +51,7 @@ else
|
||||
shared=""
|
||||
fi
|
||||
|
||||
cmake $cpp11 $bit32 $boost $boost_dir $shared ..
|
||||
cmake $cpp11 $bit32 $boost $boost_dir $shared -DMSGPACK_CHAR_SIGN=${CHAR_SIGN} ..
|
||||
|
||||
ret=$?
|
||||
if [ $ret -ne 0 ]
|
||||
|
133
crosslang.cc
133
crosslang.cc
@@ -1,133 +0,0 @@
|
||||
//
|
||||
// MessagePack cross-language test tool
|
||||
//
|
||||
// $ cd ../cpp && ./configure && make && make install
|
||||
// or
|
||||
// $ port install msgpack # MacPorts
|
||||
//
|
||||
// $ g++ -Wall crosslang.cc -lmsgpack
|
||||
//
|
||||
#include <msgpack.hpp>
|
||||
#include <iostream>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static int run(int infd, int outfd)
|
||||
try {
|
||||
msgpack::unpacker pac;
|
||||
|
||||
while(true) {
|
||||
pac.reserve_buffer(32*1024);
|
||||
|
||||
ssize_t count =
|
||||
read(infd, pac.buffer(), pac.buffer_capacity());
|
||||
|
||||
if(count <= 0) {
|
||||
if(count == 0) {
|
||||
return 0;
|
||||
}
|
||||
if(errno == EAGAIN || errno == EINTR) {
|
||||
continue;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
pac.buffer_consumed(count);
|
||||
|
||||
msgpack::unpacked result;
|
||||
while(pac.next(&result)) {
|
||||
msgpack::sbuffer sbuf;
|
||||
msgpack::pack(sbuf, result.get());
|
||||
|
||||
const char* p = sbuf.data();
|
||||
const char* const pend = p + sbuf.size();
|
||||
while(p < pend) {
|
||||
ssize_t bytes = write(outfd, p, pend-p);
|
||||
|
||||
if(bytes <= 0) {
|
||||
if(count == 0) {
|
||||
return 0;
|
||||
}
|
||||
if(errno == EAGAIN || errno == EINTR) {
|
||||
continue;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
p += bytes;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
} catch (std::exception& e) {
|
||||
std::cerr << e.what() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void usage(const char* prog)
|
||||
{
|
||||
printf(
|
||||
"Usage: %s [in-file] [out-file]\n"
|
||||
"\n"
|
||||
"This tool is for testing of MessagePack implementation.\n"
|
||||
"This does following behavior:\n"
|
||||
"\n"
|
||||
" 1. Reads objects serialized by MessagePack from <in-file> (default: stdin)\n"
|
||||
" 2. Re-serializes the objects using C++ implementation of MessagePack (Note that C++ implementation is considered valid)\n"
|
||||
" 3. Writes the re-serialized objects into <out-file> (default: stdout)\n"
|
||||
"\n"
|
||||
, prog);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int infd = 0;
|
||||
int outfd = 1;
|
||||
|
||||
if(argc < 1 || argc > 3) {
|
||||
usage(argv[0]);
|
||||
}
|
||||
|
||||
for(int i=1; i < argc; ++i) {
|
||||
if(strlen(argv[i]) > 1 && argv[i][0] == '-') {
|
||||
usage(argv[0]);
|
||||
}
|
||||
}
|
||||
|
||||
if(argc >= 2) {
|
||||
const char* fname = argv[1];
|
||||
if(strcmp(fname, "-") != 0) {
|
||||
infd = open(fname, O_RDONLY);
|
||||
if(infd < 0) {
|
||||
perror("can't open input file");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(argc >= 3) {
|
||||
const char* fname = argv[2];
|
||||
if(strcmp(fname, "-") != 0) {
|
||||
outfd = open(fname, O_WRONLY | O_CREAT| O_TRUNC, 0666);
|
||||
if(outfd < 0) {
|
||||
perror("can't open output file");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int code = run(infd, outfd);
|
||||
|
||||
close(infd);
|
||||
close(outfd);
|
||||
|
||||
return code;
|
||||
}
|
||||
|
88
crosslang.rb
88
crosslang.rb
@@ -1,88 +0,0 @@
|
||||
#
|
||||
# MessagePack cross-language test tool
|
||||
#
|
||||
# $ gem install msgpack
|
||||
# or
|
||||
# $ port install rb_msgpack # MacPorts
|
||||
#
|
||||
begin
|
||||
require 'rubygems'
|
||||
rescue LoadError
|
||||
end
|
||||
require 'msgpack'
|
||||
|
||||
def run(inio, outio)
|
||||
pac = MessagePack::Unpacker.new(inio)
|
||||
|
||||
begin
|
||||
pac.each {|obj|
|
||||
outio.write MessagePack.pack(obj)
|
||||
outio.flush
|
||||
}
|
||||
rescue EOFError
|
||||
return 0
|
||||
rescue
|
||||
$stderr.puts $!
|
||||
return 1
|
||||
end
|
||||
|
||||
return 0
|
||||
end
|
||||
|
||||
def usage
|
||||
puts <<EOF
|
||||
Usage: #{$0} [in-file] [out-file]
|
||||
|
||||
This tool is for testing of MessagePack implementation.
|
||||
This does following behavior:
|
||||
|
||||
1. Reads objects serialized by MessagePack from <in-file> (default: stdin)
|
||||
2. Re-serializes the objects using Ruby implementation of MessagePack (Note that Ruby implementation is considered valid)
|
||||
3. Writes the re-serialized objects into <out-file> (default: stdout)
|
||||
|
||||
EOF
|
||||
exit 1
|
||||
end
|
||||
|
||||
inio = $stdin
|
||||
outio = $stdout
|
||||
|
||||
if ARGV.length > 2
|
||||
usage
|
||||
end
|
||||
|
||||
ARGV.each {|str|
|
||||
if str.size > 1 && str[0] == ?-
|
||||
usage
|
||||
end
|
||||
}
|
||||
|
||||
if fname = ARGV[0]
|
||||
unless fname == "-"
|
||||
begin
|
||||
inio = File.open(fname)
|
||||
rescue
|
||||
puts "can't open output file: #{$!}"
|
||||
exit 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if fname = ARGV[1]
|
||||
unless fname == "-"
|
||||
begin
|
||||
outio = File.open(fname, "w")
|
||||
rescue
|
||||
puts "can't open output file: #{$!}"
|
||||
exit 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
code = run(inio, outio)
|
||||
|
||||
inio.close
|
||||
outio.close
|
||||
|
||||
exit code
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_CPP03_DEFINE_ARRAY_HPP
|
||||
#define MSGPACK_CPP03_DEFINE_ARRAY_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_CPP03_DEFINE_MAP_HPP
|
||||
#define MSGPACK_CPP03_DEFINE_MAP_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2013 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_CPP03_MSGPACK_TUPLE_HPP
|
||||
#define MSGPACK_CPP03_MSGPACK_TUPLE_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2010 FURUHASHI Sadayuki
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_CPP03_ZONE_HPP
|
||||
#define MSGPACK_CPP03_ZONE_HPP
|
||||
@@ -133,6 +125,7 @@ class zone {
|
||||
::free(c);
|
||||
c = n;
|
||||
} else {
|
||||
m_head = c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -12,8 +12,20 @@ FOREACH (source_file ${exec_PROGRAMS})
|
||||
${source_file}
|
||||
)
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Werror -Wno-mismatched-tags -g -O3")
|
||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Werror -g -O3")
|
||||
ENDIF ()
|
||||
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
|
||||
ENDIF ()
|
||||
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
IF ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER ${GNUCXX_NO_MISMATCHED_TAGS_SUPPORT_VERSION}) OR
|
||||
(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL ${GNUCXX_NO_MISMATCHED_TAGS_SUPPORT_VERSION}))
|
||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
|
||||
ENDIF ()
|
||||
ENDIF ()
|
||||
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
IF (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
||||
STRING(REGEX REPLACE "/W[0-4]" "/W3 /WX" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
|
@@ -2,17 +2,9 @@
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <string>
|
||||
|
@@ -2,17 +2,9 @@
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <string>
|
||||
|
@@ -17,11 +17,23 @@ FOREACH (source_file ${exec_PROGRAMS})
|
||||
${source_file}
|
||||
)
|
||||
TARGET_LINK_LIBRARIES (${source_file_we}
|
||||
msgpack
|
||||
msgpackc
|
||||
)
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Werror -Wno-mismatched-tags -g -O3")
|
||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Werror -g -O3")
|
||||
ENDIF ()
|
||||
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
|
||||
ENDIF ()
|
||||
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
IF ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER ${GNUCXX_NO_MISMATCHED_TAGS_SUPPORT_VERSION}) OR
|
||||
(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL ${GNUCXX_NO_MISMATCHED_TAGS_SUPPORT_VERSION}))
|
||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
|
||||
ENDIF ()
|
||||
ENDIF ()
|
||||
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
IF (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
||||
STRING(REGEX REPLACE "/W[0-4]" "/W3 /WX" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
|
@@ -33,7 +33,7 @@ FOREACH (source_file ${exec_PROGRAMS})
|
||||
${source_file}
|
||||
)
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Werror -Wno-mismatched-tags -g -O3")
|
||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Werror -g -O3")
|
||||
ENDIF ()
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
IF (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
||||
@@ -54,7 +54,7 @@ FOREACH (source_file ${with_pthread_PROGRAMS})
|
||||
pthread
|
||||
)
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Werror -Wno-mismatched-tags -g -O3 -pthread")
|
||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Werror -g -O3 -pthread")
|
||||
ENDIF ()
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
IF (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
||||
@@ -86,9 +86,22 @@ FOREACH (source_file ${with_boost_lib_PROGRAMS})
|
||||
rt
|
||||
)
|
||||
ENDIF ()
|
||||
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Werror -Wno-mismatched-tags -g -O3")
|
||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Werror -O3")
|
||||
ENDIF ()
|
||||
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
|
||||
ENDIF ()
|
||||
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
IF ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER ${GNUCXX_NO_MISMATCHED_TAGS_SUPPORT_VERSION}) OR
|
||||
(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL ${GNUCXX_NO_MISMATCHED_TAGS_SUPPORT_VERSION}))
|
||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
|
||||
ENDIF ()
|
||||
ENDIF ()
|
||||
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
IF (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
||||
STRING(REGEX REPLACE "/W[0-4]" "/W3 /WX" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
|
@@ -2,17 +2,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2015 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <string>
|
||||
|
@@ -2,17 +2,9 @@
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <string>
|
||||
|
@@ -2,17 +2,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2015 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <string>
|
||||
|
@@ -2,17 +2,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2015 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <msgpack.hpp>
|
||||
@@ -52,7 +44,7 @@ int main(void)
|
||||
msgpack::unpack(result, sbuf.str().data(), sbuf.str().size());
|
||||
msgpack::object obj = result.get();
|
||||
|
||||
obj.convert(&nc);
|
||||
obj.convert(nc);
|
||||
|
||||
std::cout << obj << " value=" << nc.value << " flag=" << nc.flag << std::endl;
|
||||
}
|
||||
@@ -68,7 +60,7 @@ int main(void)
|
||||
msgpack::unpack(result, sbuf.str().data(), sbuf.str().size());
|
||||
msgpack::object obj = result.get();
|
||||
|
||||
obj.convert(&oc);
|
||||
obj.convert(oc);
|
||||
|
||||
std::cout << obj << " value=" << oc.value << std::endl;
|
||||
}
|
||||
|
@@ -2,17 +2,9 @@
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <sstream>
|
||||
|
@@ -2,17 +2,9 @@
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <string>
|
||||
|
@@ -2,17 +2,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2015 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <msgpack.hpp>
|
||||
|
@@ -2,17 +2,9 @@
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <msgpack.hpp>
|
||||
|
@@ -2,17 +2,9 @@
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
|
@@ -2,17 +2,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2015 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <msgpack.hpp>
|
||||
@@ -48,7 +40,7 @@ int main(void)
|
||||
// convert msgpack::object instance into the original type.
|
||||
// if the type is mismatched, it throws msgpack::type_error exception.
|
||||
msgpack::type::tuple<int, bool, std::string> dst;
|
||||
deserialized.convert(&dst);
|
||||
deserialized.convert(dst);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -2,17 +2,9 @@
|
||||
//
|
||||
// Copyright (C) 2013-2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
// g++ -std=c++11 -O3 -g -Ipath_to_msgpack_src -Ipath_to_boost speed_test.cc -Lpath_to_boost_lib -lboost_timer -lboost_system
|
||||
@@ -58,7 +50,7 @@ void test_map_pack_unpack() {
|
||||
std::cout << "Start converting..." << std::endl;
|
||||
{
|
||||
boost::timer::cpu_timer timer;
|
||||
unpacked.get().convert(&m2);
|
||||
unpacked.get().convert(m2);
|
||||
std::string result = timer.format();
|
||||
std::cout << result << std::endl;
|
||||
}
|
||||
|
@@ -2,17 +2,9 @@
|
||||
//
|
||||
// Copyright (C) 2013-2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
// g++ -std=c++11 -O3 -g -Ipath_to_msgpack_src -Ipath_to_boost speed_test.cc -Lpath_to_boost_lib -lboost_timer -lboost_system
|
||||
@@ -81,7 +73,7 @@ void test_array_of_array() {
|
||||
std::cout << "Start converting..." << std::endl;
|
||||
{
|
||||
boost::timer::cpu_timer timer;
|
||||
unpacked.get().convert(&v2);
|
||||
unpacked.get().convert(v2);
|
||||
std::string result = timer.format();
|
||||
std::cout << result << std::endl;
|
||||
}
|
||||
|
@@ -2,17 +2,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2015 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <msgpack.hpp>
|
||||
|
@@ -15,8 +15,20 @@ IF (MSGPACK_CXX11)
|
||||
${source_file}
|
||||
)
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Werror -Wno-mismatched-tags -g -O3")
|
||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Werror -g -O3 ")
|
||||
ENDIF ()
|
||||
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
|
||||
ENDIF ()
|
||||
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
IF ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER ${GNUCXX_NO_MISMATCHED_TAGS_SUPPORT_VERSION}) OR
|
||||
(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL ${GNUCXX_NO_MISMATCHED_TAGS_SUPPORT_VERSION}))
|
||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
|
||||
ENDIF ()
|
||||
ENDIF ()
|
||||
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
IF (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
||||
STRING(REGEX REPLACE "/W[0-4]" "/W3 /WX" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
|
@@ -2,17 +2,9 @@
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
|
@@ -2,17 +2,9 @@
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <cassert>
|
||||
|
@@ -3,17 +3,9 @@
|
||||
*
|
||||
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
/**
|
||||
* @defgroup msgpack MessagePack C
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#include "msgpack/object.hpp"
|
||||
#include "msgpack/iterator.hpp"
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_ADAPTOR_BASE_HPP
|
||||
#define MSGPACK_ADAPTOR_BASE_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_ARRAY_REF_HPP
|
||||
#define MSGPACK_TYPE_ARRAY_REF_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_BOOL_HPP
|
||||
#define MSGPACK_TYPE_BOOL_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_BOOST_FUSION_HPP
|
||||
#define MSGPACK_TYPE_BOOST_FUSION_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_BOOST_MSGPACK_VARIANT_HPP
|
||||
#define MSGPACK_TYPE_BOOST_MSGPACK_VARIANT_HPP
|
||||
@@ -51,7 +43,7 @@ namespace type {
|
||||
template <typename STR, typename BIN, typename EXT>
|
||||
struct basic_variant :
|
||||
boost::variant<
|
||||
nil, // NIL
|
||||
nil_t, // NIL
|
||||
bool, // BOOL
|
||||
int64_t, // NEGATIVE_INTEGER
|
||||
uint64_t, // POSITIVE_INTEGER
|
||||
@@ -70,7 +62,7 @@ struct basic_variant :
|
||||
>,
|
||||
private boost::totally_ordered<basic_variant<STR, BIN, EXT> > {
|
||||
typedef boost::variant<
|
||||
nil, // NIL
|
||||
nil_t, // NIL
|
||||
bool, // BOOL
|
||||
int64_t, // NEGATIVE_INTEGER
|
||||
uint64_t, // POSITIVE_INTEGER
|
||||
@@ -112,7 +104,7 @@ struct basic_variant :
|
||||
basic_variant(unsigned long long v):base(uint64_t(v)) {}
|
||||
|
||||
bool is_nil() const {
|
||||
return boost::get<nil>(this);
|
||||
return boost::get<msgpack::type::nil_t>(this);
|
||||
}
|
||||
bool is_bool() const {
|
||||
return boost::get<bool>(this);
|
||||
@@ -276,7 +268,7 @@ struct as<msgpack::type::basic_variant<STR, BIN, EXT> > {
|
||||
msgpack::type::basic_variant<STR, BIN, EXT> operator()(msgpack::object const& o) const {
|
||||
switch(o.type) {
|
||||
case type::NIL:
|
||||
return o.as<msgpack::type::nil>();
|
||||
return o.as<msgpack::type::nil_t>();
|
||||
case type::BOOLEAN:
|
||||
return o.as<bool>();
|
||||
case type::POSITIVE_INTEGER:
|
||||
@@ -312,7 +304,7 @@ struct convert<msgpack::type::basic_variant<STR, BIN, EXT> > {
|
||||
msgpack::type::basic_variant<STR, BIN, EXT>& v) const {
|
||||
switch(o.type) {
|
||||
case type::NIL:
|
||||
v = o.as<msgpack::type::nil>();
|
||||
v = o.as<msgpack::type::nil_t>();
|
||||
break;
|
||||
case type::BOOLEAN:
|
||||
v = o.as<bool>();
|
||||
@@ -374,8 +366,8 @@ struct pack<msgpack::type::basic_variant<STR, BIN, EXT> > {
|
||||
namespace detail {
|
||||
|
||||
struct object_imp : boost::static_visitor<void> {
|
||||
void operator()(msgpack::type::nil const& v) const {
|
||||
object<msgpack::type::nil>()(o_, v);
|
||||
void operator()(msgpack::type::nil_t const& v) const {
|
||||
object<msgpack::type::nil_t>()(o_, v);
|
||||
}
|
||||
void operator()(bool const& v) const {
|
||||
object<bool>()(o_, v);
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_BOOST_OPTIONAL_HPP
|
||||
#define MSGPACK_TYPE_BOOST_OPTIONAL_HPP
|
||||
@@ -22,7 +14,7 @@
|
||||
#include "msgpack/adaptor/adaptor_base.hpp"
|
||||
#include "msgpack/adaptor/check_container_size.hpp"
|
||||
|
||||
// To supress warning on Boost.1.58.0
|
||||
// To suppress warning on Boost.1.58.0
|
||||
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) || defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_BOOST_STRING_REF_HPP
|
||||
#define MSGPACK_TYPE_BOOST_STRING_REF_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2014-2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_CHAR_PTR_HPP
|
||||
#define MSGPACK_TYPE_CHAR_PTR_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_CHECK_CONTAINER_SIZE_HPP
|
||||
#define MSGPACK_CHECK_CONTAINER_SIZE_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2014-2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_CPP11_ARRAY_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2014-2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_ARRAY_CHAR_HPP
|
||||
#define MSGPACK_TYPE_ARRAY_CHAR_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2014-2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_ARRAY_UNSIGNED_CHAR_HPP
|
||||
#define MSGPACK_TYPE_ARRAY_UNSIGNED_CHAR_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2014 KONDO-2015 Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_CPP11_FORWARD_LIST_HPP
|
||||
|
68
include/msgpack/adaptor/cpp11/reference_wrapper.hpp
Normal file
68
include/msgpack/adaptor/cpp11/reference_wrapper.hpp
Normal file
@@ -0,0 +1,68 @@
|
||||
//
|
||||
// MessagePack for C++ static resolution routine
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_CPP11_REFERENCE_WRAPPER_HPP
|
||||
#define MSGPACK_CPP11_REFERENCE_WRAPPER_HPP
|
||||
|
||||
#include "msgpack/versioning.hpp"
|
||||
#include "msgpack/adaptor/adaptor_base.hpp"
|
||||
#include "msgpack/adaptor/check_container_size.hpp"
|
||||
|
||||
#include <memory>
|
||||
#include <type_traits>
|
||||
|
||||
namespace msgpack {
|
||||
|
||||
/// @cond
|
||||
MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
/// @endcond
|
||||
|
||||
namespace adaptor {
|
||||
|
||||
template <typename T>
|
||||
struct convert<std::reference_wrapper<T>> {
|
||||
msgpack::object const& operator()(msgpack::object const& o, std::reference_wrapper<T>& v) const {
|
||||
msgpack::adaptor::convert<T>()(o, v.get());
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct pack<std::reference_wrapper<T>> {
|
||||
template <typename Stream>
|
||||
msgpack::packer<Stream>& operator()(msgpack::packer<Stream>& o, const std::reference_wrapper<T>& v) const {
|
||||
o.pack(v.get());
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct object<std::reference_wrapper<T> > {
|
||||
void operator()(msgpack::object& o, const std::reference_wrapper<T>& v) const {
|
||||
msgpack::adaptor::object<typename std::remove_const<T>::type>()(o, v.get());
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct object_with_zone<std::reference_wrapper<T>> {
|
||||
void operator()(msgpack::object::with_zone& o, const std::reference_wrapper<T>& v) const {
|
||||
msgpack::adaptor::object_with_zone<typename std::remove_const<T>::type>()(o, v.get());
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace adaptor
|
||||
|
||||
/// @cond
|
||||
} // MSGPACK_API_VERSION_NAMESPACE(v1)
|
||||
/// @endcond
|
||||
|
||||
} // namespace msgpack
|
||||
|
||||
#endif // MSGPACK_CPP11_REFERENCE_WRAPPER_HPP
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_CPP11_SHARED_PTR_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2015 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_CPP11_TUPLE_HPP
|
||||
#define MSGPACK_CPP11_TUPLE_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_CPP11_UNIQUE_PTR_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2014-2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_UNORDERED_MAP_HPP
|
||||
#define MSGPACK_TYPE_UNORDERED_MAP_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2014-2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_UNORDERED_SET_HPP
|
||||
#define MSGPACK_TYPE_UNORDERED_SET_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2014 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_DEFINE_HPP
|
||||
#define MSGPACK_DEFINE_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2015 FURUHASHI Sadayuki
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_DEQUE_HPP
|
||||
#define MSGPACK_TYPE_DEQUE_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_CPP03_DEFINE_ARRAY_HPP
|
||||
#define MSGPACK_CPP03_DEFINE_ARRAY_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_CPP03_DEFINE_MAP_HPP
|
||||
#define MSGPACK_CPP03_DEFINE_MAP_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2013 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_CPP03_MSGPACK_TUPLE_HPP
|
||||
#define MSGPACK_CPP03_MSGPACK_TUPLE_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2013 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_CPP11_DEFINE_ARRAY_HPP
|
||||
#define MSGPACK_CPP11_DEFINE_ARRAY_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2013 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_CPP11_DEFINE_MAP_HPP
|
||||
#define MSGPACK_CPP11_DEFINE_MAP_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2015 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_CPP11_MSGPACK_TUPLE_HPP
|
||||
#define MSGPACK_CPP11_MSGPACK_TUPLE_HPP
|
||||
@@ -44,12 +36,13 @@ namespace type {
|
||||
public:
|
||||
using base = std::tuple<Types...>;
|
||||
|
||||
using base::base;
|
||||
|
||||
tuple() = default;
|
||||
tuple(tuple const&) = default;
|
||||
tuple(tuple&&) = default;
|
||||
|
||||
template<typename... OtherTypes>
|
||||
tuple(OtherTypes&&... other):base(std::forward<OtherTypes>(other)...) {}
|
||||
|
||||
template<typename... OtherTypes>
|
||||
tuple(tuple<OtherTypes...> const& other):base(static_cast<std::tuple<OtherTypes...> const&>(other)) {}
|
||||
template<typename... OtherTypes>
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_EXT_HPP
|
||||
#define MSGPACK_TYPE_EXT_HPP
|
||||
@@ -99,7 +91,7 @@ template <>
|
||||
struct pack<msgpack::type::ext> {
|
||||
template <typename Stream>
|
||||
msgpack::packer<Stream>& operator()(msgpack::packer<Stream>& o, const msgpack::type::ext& v) const {
|
||||
// size limit has aleady been checked at ext's constructor
|
||||
// size limit has already been checked at ext's constructor
|
||||
uint32_t size = v.size();
|
||||
o.pack_ext(size, v.type());
|
||||
o.pack_ext_body(v.data(), size);
|
||||
@@ -110,7 +102,7 @@ struct pack<msgpack::type::ext> {
|
||||
template <>
|
||||
struct object_with_zone<msgpack::type::ext> {
|
||||
void operator()(msgpack::object::with_zone& o, const msgpack::type::ext& v) const {
|
||||
// size limit has aleady been checked at ext's constructor
|
||||
// size limit has already been checked at ext's constructor
|
||||
uint32_t size = v.size();
|
||||
o.type = msgpack::type::EXT;
|
||||
char* ptr = static_cast<char*>(o.zone.allocate_align(size + 1));
|
||||
@@ -131,7 +123,7 @@ public:
|
||||
// A default constructed ext_ref object::m_ptr doesn't have the buffer to point to.
|
||||
// In order to avoid nullptr checking branches, m_ptr points to m_size.
|
||||
// So type() returns unspecified but valid value. It might be a zero because m_size
|
||||
// is initialized as zero, but shoudn't assume that.
|
||||
// is initialized as zero, but shouldn't assume that.
|
||||
ext_ref() : m_ptr(static_cast<char*>(static_cast<void*>(&m_size))), m_size(0) {}
|
||||
ext_ref(const char* p, uint32_t s) :
|
||||
m_ptr(s == 0 ? static_cast<char*>(static_cast<void*>(&m_size)) : p),
|
||||
@@ -139,7 +131,7 @@ public:
|
||||
detail::check_container_size_for_ext<sizeof(std::size_t)>(s);
|
||||
}
|
||||
|
||||
// size limit has aleady been checked at ext's constructor
|
||||
// size limit has already been checked at ext's constructor
|
||||
ext_ref(ext const& x) : m_ptr(&x.m_data[0]), m_size(x.size()) {}
|
||||
|
||||
const char* data() const {
|
||||
@@ -184,7 +176,7 @@ private:
|
||||
};
|
||||
|
||||
inline ext::ext(ext_ref const& x) {
|
||||
// size limit has aleady been checked at ext_ref's constructor
|
||||
// size limit has already been checked at ext_ref's constructor
|
||||
m_data.reserve(x.size() + 1);
|
||||
|
||||
m_data.push_back(x.type());
|
||||
@@ -208,7 +200,7 @@ template <>
|
||||
struct pack<msgpack::type::ext_ref> {
|
||||
template <typename Stream>
|
||||
msgpack::packer<Stream>& operator()(msgpack::packer<Stream>& o, const msgpack::type::ext_ref& v) const {
|
||||
// size limit has aleady been checked at ext_ref's constructor
|
||||
// size limit has already been checked at ext_ref's constructor
|
||||
uint32_t size = v.size();
|
||||
o.pack_ext(size, v.type());
|
||||
o.pack_ext_body(v.data(), size);
|
||||
@@ -219,7 +211,7 @@ struct pack<msgpack::type::ext_ref> {
|
||||
template <>
|
||||
struct object<msgpack::type::ext_ref> {
|
||||
void operator()(msgpack::object& o, const msgpack::type::ext_ref& v) const {
|
||||
// size limit has aleady been checked at ext_ref's constructor
|
||||
// size limit has already been checked at ext_ref's constructor
|
||||
uint32_t size = v.size();
|
||||
o.type = msgpack::type::EXT;
|
||||
o.via.ext.ptr = v.m_ptr;
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2020 FURUHASHI Sadayuki
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_FIXINT_HPP
|
||||
#define MSGPACK_TYPE_FIXINT_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_FLOAT_HPP
|
||||
#define MSGPACK_TYPE_FLOAT_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_INT_HPP
|
||||
#define MSGPACK_TYPE_INT_HPP
|
||||
@@ -35,7 +27,7 @@ namespace detail {
|
||||
|
||||
template <typename T>
|
||||
struct convert_integer_sign<T, true> {
|
||||
static inline T convert(msgpack::object const& o) {
|
||||
static T convert(msgpack::object const& o) {
|
||||
if(o.type == msgpack::type::POSITIVE_INTEGER) {
|
||||
if(o.via.u64 > static_cast<uint64_t>(std::numeric_limits<T>::max()))
|
||||
{ throw msgpack::type_error(); }
|
||||
@@ -51,7 +43,7 @@ namespace detail {
|
||||
|
||||
template <typename T>
|
||||
struct convert_integer_sign<T, false> {
|
||||
static inline T convert(msgpack::object const& o) {
|
||||
static T convert(msgpack::object const& o) {
|
||||
if(o.type == msgpack::type::POSITIVE_INTEGER) {
|
||||
if(o.via.u64 > static_cast<uint64_t>(std::numeric_limits<T>::max()))
|
||||
{ throw msgpack::type_error(); }
|
||||
@@ -77,7 +69,9 @@ namespace detail {
|
||||
|
||||
template <>
|
||||
struct object_char_sign<true> {
|
||||
static inline void make(msgpack::object& o, char v) {
|
||||
template <typename T>
|
||||
static typename msgpack::enable_if<msgpack::is_same<T, char>::value>::type
|
||||
make(msgpack::object& o, T v) {
|
||||
if (v < 0) {
|
||||
o.type = msgpack::type::NEGATIVE_INTEGER;
|
||||
o.via.i64 = v;
|
||||
@@ -91,7 +85,7 @@ namespace detail {
|
||||
|
||||
template <>
|
||||
struct object_char_sign<false> {
|
||||
static inline void make(msgpack::object& o, char v) {
|
||||
static void make(msgpack::object& o, char v) {
|
||||
o.type = msgpack::type::POSITIVE_INTEGER, o.via.u64 = v;
|
||||
}
|
||||
};
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2015 FURUHASHI Sadayuki
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_LIST_HPP
|
||||
#define MSGPACK_TYPE_LIST_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2015 FURUHASHI Sadayuki
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_MAP_HPP
|
||||
#define MSGPACK_TYPE_MAP_HPP
|
||||
@@ -80,14 +72,16 @@ struct convert<type::assoc_vector<K, V, Compare, Alloc> > {
|
||||
msgpack::object const& operator()(msgpack::object const& o, type::assoc_vector<K, V, Compare, Alloc>& v) const {
|
||||
if (o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
|
||||
v.resize(o.via.map.size);
|
||||
msgpack::object_kv* p = o.via.map.ptr;
|
||||
msgpack::object_kv* const pend = o.via.map.ptr + o.via.map.size;
|
||||
std::pair<K, V>* it(&v.front());
|
||||
for (; p < pend; ++p, ++it) {
|
||||
p->key.convert(it->first);
|
||||
p->val.convert(it->second);
|
||||
if (o.via.map.size != 0) {
|
||||
msgpack::object_kv* p = o.via.map.ptr;
|
||||
msgpack::object_kv* const pend = o.via.map.ptr + o.via.map.size;
|
||||
std::pair<K, V>* it(&v.front());
|
||||
for (; p < pend; ++p, ++it) {
|
||||
p->key.convert(it->first);
|
||||
p->val.convert(it->second);
|
||||
}
|
||||
std::sort(v.begin(), v.end(), type::detail::pair_first_less<K, V, Compare, Alloc>());
|
||||
}
|
||||
std::sort(v.begin(), v.end(), type::detail::pair_first_less<K, V, Compare, Alloc>());
|
||||
return o;
|
||||
}
|
||||
};
|
||||
@@ -202,14 +196,22 @@ struct object_with_zone<std::map<K, V, Compare, Alloc> > {
|
||||
}
|
||||
else {
|
||||
uint32_t size = checked_get_container_size(v.size());
|
||||
|
||||
msgpack::object_kv* p = static_cast<msgpack::object_kv*>(o.zone.allocate_align(sizeof(msgpack::object_kv)*size));
|
||||
msgpack::object_kv* const pend = p + size;
|
||||
o.via.map.ptr = p;
|
||||
o.via.map.size = size;
|
||||
typename std::map<K, V, Compare, Alloc>::const_iterator it(v.begin());
|
||||
do {
|
||||
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
#endif // (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined(__clang__)
|
||||
p->key = msgpack::object(it->first, o.zone);
|
||||
p->val = msgpack::object(it->second, o.zone);
|
||||
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif // (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined(__clang__)
|
||||
++p;
|
||||
++it;
|
||||
} while(p < pend);
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2014 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_MSGPACK_TUPLE_HPP
|
||||
#define MSGPACK_MSGPACK_TUPLE_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_NIL_HPP
|
||||
#define MSGPACK_TYPE_NIL_HPP
|
||||
@@ -29,13 +21,19 @@ MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
|
||||
namespace type {
|
||||
|
||||
struct nil { };
|
||||
struct nil_t { };
|
||||
|
||||
inline bool operator<(nil const& lhs, nil const& rhs) {
|
||||
#if !defined(MSGPACK_DISABLE_LEGACY_NIL)
|
||||
|
||||
typedef nil_t nil;
|
||||
|
||||
#endif // !defined(MSGPACK_DISABLE_LEGACY_NIL)
|
||||
|
||||
inline bool operator<(nil_t const& lhs, nil_t const& rhs) {
|
||||
return &lhs < &rhs;
|
||||
}
|
||||
|
||||
inline bool operator==(nil const& lhs, nil const& rhs) {
|
||||
inline bool operator==(nil_t const& lhs, nil_t const& rhs) {
|
||||
return &lhs == &rhs;
|
||||
}
|
||||
|
||||
@@ -44,42 +42,42 @@ inline bool operator==(nil const& lhs, nil const& rhs) {
|
||||
namespace adaptor {
|
||||
|
||||
template <>
|
||||
struct convert<type::nil> {
|
||||
msgpack::object const& operator()(msgpack::object const& o, type::nil&) const {
|
||||
struct convert<type::nil_t> {
|
||||
msgpack::object const& operator()(msgpack::object const& o, type::nil_t&) const {
|
||||
if(o.type != msgpack::type::NIL) { throw msgpack::type_error(); }
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct pack<type::nil> {
|
||||
struct pack<type::nil_t> {
|
||||
template <typename Stream>
|
||||
msgpack::packer<Stream>& operator()(msgpack::packer<Stream>& o, const type::nil&) const {
|
||||
msgpack::packer<Stream>& operator()(msgpack::packer<Stream>& o, const type::nil_t&) const {
|
||||
o.pack_nil();
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct object<type::nil> {
|
||||
void operator()(msgpack::object& o, type::nil) const {
|
||||
struct object<type::nil_t> {
|
||||
void operator()(msgpack::object& o, type::nil_t) const {
|
||||
o.type = msgpack::type::NIL;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct object_with_zone<type::nil> {
|
||||
void operator()(msgpack::object::with_zone& o, type::nil v) const {
|
||||
struct object_with_zone<type::nil_t> {
|
||||
void operator()(msgpack::object::with_zone& o, type::nil_t v) const {
|
||||
static_cast<msgpack::object&>(o) << v;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace adaptror
|
||||
} // namespace adaptor
|
||||
|
||||
template <>
|
||||
inline void msgpack::object::as<void>() const
|
||||
{
|
||||
msgpack::type::nil v;
|
||||
msgpack::type::nil_t v;
|
||||
convert(v);
|
||||
}
|
||||
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_PAIR_HPP
|
||||
#define MSGPACK_TYPE_PAIR_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_RAW_HPP
|
||||
#define MSGPACK_TYPE_RAW_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2015 FURUHASHI Sadayuki
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_SET_HPP
|
||||
#define MSGPACK_TYPE_SET_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2015 FURUHASHI Sadayuki
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_STRING_HPP
|
||||
#define MSGPACK_TYPE_STRING_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2015 FURUHASHI Sadayuki
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_TR1_UNORDERED_MAP_HPP
|
||||
#define MSGPACK_TYPE_TR1_UNORDERED_MAP_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2015 FURUHASHI Sadayuki
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_TR1_UNORDERED_SET_HPP
|
||||
#define MSGPACK_TYPE_TR1_UNORDERED_SET_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2015 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_V4RAW_HPP
|
||||
#define MSGPACK_TYPE_V4RAW_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2015 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_VECTOR_HPP
|
||||
#define MSGPACK_TYPE_VECTOR_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_VECTOR_BOOL_HPP
|
||||
#define MSGPACK_TYPE_VECTOR_BOOL_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2014-2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_VECTOR_CHAR_HPP
|
||||
#define MSGPACK_TYPE_VECTOR_CHAR_HPP
|
||||
@@ -38,11 +30,29 @@ struct convert<std::vector<char, Alloc> > {
|
||||
switch (o.type) {
|
||||
case msgpack::type::BIN:
|
||||
v.resize(o.via.bin.size);
|
||||
std::memcpy(&v.front(), o.via.bin.ptr, o.via.bin.size);
|
||||
if (o.via.bin.size != 0) {
|
||||
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
#endif // (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined(__clang__)
|
||||
std::memcpy(&v.front(), o.via.bin.ptr, o.via.bin.size);
|
||||
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif // (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined(__clang__)
|
||||
}
|
||||
break;
|
||||
case msgpack::type::STR:
|
||||
v.resize(o.via.str.size);
|
||||
std::memcpy(&v.front(), o.via.str.ptr, o.via.str.size);
|
||||
if (o.via.str.size != 0) {
|
||||
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
#endif // (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined(__clang__)
|
||||
std::memcpy(&v.front(), o.via.str.ptr, o.via.str.size);
|
||||
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif // (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined(__clang__)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw msgpack::type_error();
|
||||
@@ -58,7 +68,9 @@ struct pack<std::vector<char, Alloc> > {
|
||||
msgpack::packer<Stream>& operator()(msgpack::packer<Stream>& o, const std::vector<char, Alloc>& v) const {
|
||||
uint32_t size = checked_get_container_size(v.size());
|
||||
o.pack_bin(size);
|
||||
o.pack_bin_body(&v.front(), size);
|
||||
if (size != 0) {
|
||||
o.pack_bin_body(&v.front(), size);
|
||||
}
|
||||
|
||||
return o;
|
||||
}
|
||||
@@ -69,7 +81,9 @@ struct object<std::vector<char, Alloc> > {
|
||||
void operator()(msgpack::object& o, const std::vector<char, Alloc>& v) const {
|
||||
uint32_t size = checked_get_container_size(v.size());
|
||||
o.type = msgpack::type::BIN;
|
||||
o.via.bin.ptr = &v.front();
|
||||
if (size != 0) {
|
||||
o.via.bin.ptr = &v.front();
|
||||
}
|
||||
o.via.bin.size = size;
|
||||
}
|
||||
};
|
||||
@@ -79,10 +93,12 @@ struct object_with_zone<std::vector<char, Alloc> > {
|
||||
void operator()(msgpack::object::with_zone& o, const std::vector<char, Alloc>& v) const {
|
||||
uint32_t size = checked_get_container_size(v.size());
|
||||
o.type = msgpack::type::BIN;
|
||||
char* ptr = static_cast<char*>(o.zone.allocate_align(size));
|
||||
o.via.bin.ptr = ptr;
|
||||
o.via.bin.size = size;
|
||||
std::memcpy(ptr, &v.front(), size);
|
||||
if (size != 0) {
|
||||
char* ptr = static_cast<char*>(o.zone.allocate_align(size));
|
||||
o.via.bin.ptr = ptr;
|
||||
std::memcpy(ptr, &v.front(), size);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2014-2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_TYPE_VECTOR_UNSIGNED_CHAR_HPP
|
||||
#define MSGPACK_TYPE_VECTOR_UNSIGNED_CHAR_HPP
|
||||
@@ -38,11 +30,29 @@ struct convert<std::vector<unsigned char, Alloc> > {
|
||||
switch (o.type) {
|
||||
case msgpack::type::BIN:
|
||||
v.resize(o.via.bin.size);
|
||||
std::memcpy(&v.front(), o.via.bin.ptr, o.via.bin.size);
|
||||
if (o.via.bin.size != 0) {
|
||||
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
#endif // (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined(__clang__)
|
||||
std::memcpy(&v.front(), o.via.bin.ptr, o.via.bin.size);
|
||||
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif // (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined(__clang__)
|
||||
}
|
||||
break;
|
||||
case msgpack::type::STR:
|
||||
v.resize(o.via.str.size);
|
||||
std::memcpy(&v.front(), o.via.str.ptr, o.via.str.size);
|
||||
if (o.via.str.size != 0) {
|
||||
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
#endif // (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined(__clang__)
|
||||
std::memcpy(&v.front(), o.via.str.ptr, o.via.str.size);
|
||||
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif // (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined(__clang__)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw msgpack::type_error();
|
||||
@@ -58,7 +68,9 @@ struct pack<std::vector<unsigned char, Alloc> > {
|
||||
msgpack::packer<Stream>& operator()(msgpack::packer<Stream>& o, const std::vector<unsigned char, Alloc>& v) const {
|
||||
uint32_t size = checked_get_container_size(v.size());
|
||||
o.pack_bin(size);
|
||||
o.pack_bin_body(reinterpret_cast<char const*>(&v.front()), size);
|
||||
if (size != 0) {
|
||||
o.pack_bin_body(reinterpret_cast<char const*>(&v.front()), size);
|
||||
}
|
||||
|
||||
return o;
|
||||
}
|
||||
@@ -69,7 +81,9 @@ struct object<std::vector<unsigned char, Alloc> > {
|
||||
void operator()(msgpack::object& o, const std::vector<unsigned char, Alloc>& v) const {
|
||||
uint32_t size = checked_get_container_size(v.size());
|
||||
o.type = msgpack::type::BIN;
|
||||
o.via.bin.ptr = reinterpret_cast<char const*>(&v.front());
|
||||
if (size != 0) {
|
||||
o.via.bin.ptr = reinterpret_cast<char const*>(&v.front());
|
||||
}
|
||||
o.via.bin.size = size;
|
||||
}
|
||||
};
|
||||
@@ -79,10 +93,12 @@ struct object_with_zone<std::vector<unsigned char, Alloc> > {
|
||||
void operator()(msgpack::object::with_zone& o, const std::vector<unsigned char, Alloc>& v) const {
|
||||
uint32_t size = checked_get_container_size(v.size());
|
||||
o.type = msgpack::type::BIN;
|
||||
char* ptr = static_cast<char*>(o.zone.allocate_align(size));
|
||||
o.via.bin.ptr = ptr;
|
||||
o.via.bin.size = size;
|
||||
std::memcpy(ptr, &v.front(), size);
|
||||
if (size != 0) {
|
||||
char* ptr = static_cast<char*>(o.zone.allocate_align(size));
|
||||
o.via.bin.ptr = ptr;
|
||||
std::memcpy(ptr, &v.front(), size);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2013 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_CPP_CONFIG_HPP
|
||||
#define MSGPACK_CPP_CONFIG_HPP
|
||||
@@ -32,8 +24,7 @@
|
||||
|
||||
|
||||
|
||||
#if defined __cplusplus
|
||||
#if __cplusplus < 201103L
|
||||
#if defined(MSGPACK_USE_CPP03)
|
||||
|
||||
#if !defined(nullptr)
|
||||
# if _MSC_VER < 1600
|
||||
@@ -101,7 +92,7 @@ struct is_same<T, T> : true_type {};
|
||||
} // namespace msgpack
|
||||
|
||||
|
||||
#else // __cplusplus < 201103L
|
||||
#else // MSGPACK_USE_CPP03
|
||||
|
||||
#include <memory>
|
||||
#include <tuple>
|
||||
@@ -128,8 +119,6 @@ MSGPACK_API_VERSION_NAMESPACE(v1) {
|
||||
} // namespace msgpack
|
||||
|
||||
|
||||
#endif // __cplusplus < 201103L
|
||||
|
||||
#endif // __cplusplus
|
||||
#endif // MSGPACK_USE_CPP03
|
||||
|
||||
#endif /* msgpack/cpp_config.hpp */
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2010 FURUHASHI Sadayuki
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_CPP03_ZONE_HPP
|
||||
#define MSGPACK_CPP03_ZONE_HPP
|
||||
@@ -133,6 +125,7 @@ class zone {
|
||||
::free(c);
|
||||
c = n;
|
||||
} else {
|
||||
m_head = c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2008-2013 FURUHASHI Sadayuki and KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_CPP11_ZONE_HPP
|
||||
#define MSGPACK_CPP11_ZONE_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
*
|
||||
* Copyright (C) 2013 Vladimir Volodko
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef MSGPACK_FBUFFER_H
|
||||
#define MSGPACK_FBUFFER_H
|
||||
@@ -31,7 +23,7 @@ extern "C" {
|
||||
* @{
|
||||
*/
|
||||
|
||||
static inline int msgpack_fbuffer_write(void* data, const char* buf, unsigned int len)
|
||||
static inline int msgpack_fbuffer_write(void* data, const char* buf, size_t len)
|
||||
{
|
||||
return (1 == fwrite(buf, len, 1, (FILE *)data)) ? 0 : -1;
|
||||
}
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2013 Vladimir Volodko
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#ifndef MSGPACK_FBUFFER_HPP__
|
||||
#define MSGPACK_FBUFFER_HPP__
|
||||
|
@@ -1,15 +1,7 @@
|
||||
/*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#ifndef MSGPACK_GCC_ATOMIC_H
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2015 MIZUKI Hirata
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_ITERATOR_HPP
|
||||
|
@@ -3,17 +3,9 @@
|
||||
//
|
||||
// Copyright (C) 2015 KONDO Takatoshi
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MSGPACK_META_HPP
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user