Compare commits

..

81 Commits

Author SHA1 Message Date
Takatoshi Kondo
bd18a36dae Merge pull request #681 from redboltz/update_doc_to_v3.0.0
Update the document for the version 3.0.0.
2018-05-09 21:40:30 +09:00
Takatoshi Kondo
3fe630769e Update the document for the version 3.0.0. 2018-05-09 16:16:50 +09:00
Takatoshi Kondo
2f80758889 Merge pull request #677 from komainu8/add_dll_export
Add dll export for msvc
2018-04-30 18:15:59 +09:00
Takatoshi Kondo
9f3efe9e54 Merge pull request #678 from derwolfe/lower-test-limit-oom
Lower limits for the fuzzer inputs
2018-04-30 09:25:24 +09:00
Chris Wolfe
6e44edf290 lower the input limits, I might need to push a config change to oss-fuzz as well to lower the max input size 2018-04-29 10:49:56 -05:00
Yasuhiro Horimoto
d28cbf32b9 Add dll export for msvc 2018-04-27 18:24:17 +09:00
Takatoshi Kondo
48d226e97c Merge pull request #676 from redboltz/remove_object_pack_recursion
Removed recursion from msgpack::object packing and stringize.
2018-04-27 06:33:51 +09:00
Takatoshi Kondo
64698e8e8c Removed other recursions from msgpack::object.
Fixed start_map_item and start_array_item calling point.
Supported visitor aborting.
2018-04-27 00:54:55 +09:00
Takatoshi Kondo
e0d098641c Merge pull request #674 from derwolfe/fix-fuzzer
Fix the fuzzer by setting limits for depth and ext.
2018-04-26 21:49:04 +09:00
Takatoshi Kondo
06f4b05487 Removed #if 0 codes. 2018-04-26 20:18:20 +09:00
Takatoshi Kondo
122fce5aee Merge pull request #675 from derwolfe/add-fuzz-corpus
move the seed corpus in repo
2018-04-26 20:08:58 +09:00
Takatoshi Kondo
e3f5281903 Removed recursion from msgpack::object packing and stringize.
Changed json expected strings.

Before this commit, json output has redundant white space.
The commit remove it. Semantically no difference.
2018-04-26 19:36:48 +09:00
Chris Wolfe
88e94e3776 move the seed corpus in repo 2018-04-25 15:47:53 -05:00
Chris Wolfe
95275ff16e Fix the fuzzer by setting limits for depth and ext.
This is a short lived bug in the fuzzer implementation in which the
limits were not set correctly.

Credit to OSS-Fuzz
2018-04-25 08:00:47 -05:00
Takatoshi Kondo
4cb938ed18 Merge pull request #673 from redboltz/fix_671
Fixed #671.
2018-04-25 12:52:12 +09:00
Takatoshi Kondo
5f3e62461e Merge pull request #672 from derwolfe/add-fuzzer-and-test
Add the fuzzer from oss-fuzz and a test that exercises it
2018-04-25 11:08:42 +09:00
Takatoshi Kondo
ec239933db Fixed #671.
Added STR type check to define_map.
2018-04-25 10:43:26 +09:00
Chris Wolfe
de59b393c7 conform to project norms and naming conventions 2018-04-24 20:04:54 -05:00
Chris Wolfe
b02371efe5 no reason to have this declaration 2018-04-24 18:09:15 -05:00
Chris Wolfe
f34289fdfd remove newline that I accidentally added 2018-04-24 17:17:49 -05:00
Chris Wolfe
584478a4f1 fuzzers are cpp11 only at the moment 2018-04-24 15:22:20 -05:00
Chris Wolfe
700ec688f7 add the fuzzer from oss-fuzz and a test that exercises it 2018-04-24 15:05:09 -05:00
Takatoshi Kondo
a133c1d393 Merge pull request #670 from redboltz/fix_variadic_template
Added missing variadic template parameters.
2018-04-12 08:03:02 +09:00
Takatoshi Kondo
6ba9a58648 Added missing variadic template parameters. 2018-04-12 06:36:32 +09:00
Takatoshi Kondo
bb92d326c8 Merge pull request #668 from redboltz/fix_missing_install_files
Fixed #667.
2018-04-11 11:26:12 +09:00
Takatoshi Kondo
1e13dadf1f Added install file comparison script. 2018-04-11 09:49:47 +09:00
Takatoshi Kondo
7b271c2af2 Fixed #667. 2018-04-11 08:52:16 +09:00
Takatoshi Kondo
c3f4e52bdb Merge pull request #666 from redboltz/fix_663_and_update_to_v3
Fix 663 and update to v3
2018-04-09 06:20:42 +09:00
Takatoshi Kondo
458b4c0363 Removed redundant version namespace qualification. 2018-04-08 23:24:17 +09:00
Takatoshi Kondo
f8dc0f0d04 Fixed #663. 2018-04-08 22:29:36 +09:00
Takatoshi Kondo
347658cdc1 Updated the version to 3.0.0.
See https://github.com/msgpack/msgpack-c/pull/639#issuecomment-353786498
So I updated the version to 3.0.0.
In the version 2.x, it keeps the original behavior.
2018-04-08 22:27:45 +09:00
Takatoshi Kondo
427a6e7313 Revert "Fixed #637."
This reverts commit 5ece2ef2c7.
2018-04-06 07:38:58 +09:00
Takatoshi Kondo
7f76a3caf0 Merge pull request #661 from Leo3738/master
Small grammatical changes made to README.md
2018-04-04 22:55:39 +09:00
Takatoshi Kondo
40539727e6 Merge branch 'kraj-master' 2018-04-04 22:52:56 +09:00
Takatoshi Kondo
30e56d0a45 Merge branch 'master' of https://github.com/kraj/msgpack-c into kraj-master 2018-04-04 21:11:56 +09:00
Takatoshi Kondo
8eef2a245b Merge branch 'cableramki-master' 2018-04-04 18:23:00 +09:00
Takatoshi Kondo
2bcfe2fdb0 Merge branch 'master' of https://github.com/cableramki/msgpack-c into cableramki-master 2018-04-04 15:55:35 +09:00
Takatoshi Kondo
2b49e62b3c Merge branch 'utkarsh009-master' 2018-04-04 15:54:09 +09:00
Takatoshi Kondo
bf70a36a1d Merge branch 'master' of https://github.com/utkarsh009/msgpack-c into utkarsh009-master 2018-04-04 14:04:00 +09:00
Takatoshi Kondo
eb92058cf4 Merge branch 'Elv13-master' 2018-04-04 14:00:48 +09:00
Takatoshi Kondo
423eaf25fb Removed -O3 -g -Werror options from CmakeLists.txt.
Added -g -Werror options to .travis.yml.
2018-04-04 13:07:21 +09:00
Takatoshi Kondo
280abe852c Merge pull request #662 from redboltz/update_boost_on_travis
Update boost on travis
2018-04-04 12:18:00 +09:00
Takatoshi Kondo
c91307aaa1 Merge branch 'master' of https://github.com/Elv13/msgpack-c into Elv13-master 2018-04-04 12:13:56 +09:00
Takatoshi Kondo
88ffd08087 Supported boost 1.66.0 or later on the examples. 2018-04-04 07:44:49 +09:00
Takatoshi Kondo
bd337129c6 Updated the boost version to 1.66.0 on travis-ci. 2018-04-04 07:20:08 +09:00
Ramki A
1f5cb86366 Update unpack_decl.hpp 2018-04-02 17:58:04 -07:00
Ramki A
0d39c577d8 Update unpack.hpp 2018-04-02 17:57:52 -07:00
Ramki A
7e66dc28f0 Update unpack_decl.hpp 2018-04-02 17:57:25 -07:00
Ramki A
bec47a59f0 Update unpack.hpp 2018-04-02 17:56:57 -07:00
Leo3738
064f854ddf Small grammatical changes made to README.md 2018-04-02 15:08:52 -07:00
Khem Raj
a05d92ae85 Fix -Werror=class-memaccess
Casting to void* make gcc happy since its upset about
object types and rightly so

Fixes

'void* memcpy(void*, const void*, size_t)' copying an object of non-trivial type 'struct msgpack::v2::object' from an array of 'const msgpack_object' {aka 'const struct msgpack_object'} [-Werror=class-memaccess]

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2018-04-01 19:55:38 -07:00
Ananthakrishnan
1fdfde5d5f Fixed #elif syntax. 2018-03-30 15:30:49 -07:00
Ananthakrishnan
b1620f1f6a Fixed Travis Mac OS build. 2018-03-30 15:14:59 -07:00
Ramki Ananthakrishnan
f789635ddc Fixed Coverity error due to missing header. 2018-03-29 15:09:19 -07:00
Utkarsh Anand
f65c26e280 Include <sys/uio.h> in NetBSD too.
This was needed for neovim
2018-03-28 20:18:05 +05:30
Emmanuel Lepage Vallée
579212996f build: Do not set -g, -O3 and -Werror CFLAGS
Hello, here are a few changes to the default CFLAGS

## Why Werror

With each new compiler version, your code "break" and fail to compile. It is true that it's a sometime a "bug" in the code and need visibility to get fixed. However, Werror should *always* be a local CFLAGS and not a project one, see Google for endless people arguing back and forth and removing Werror is now the prevalent winner of that argument. In the latest GCC, it fails to compile because the fwrite result in unchecked. Even if you fix this in new releases, you cannot fix the past and all existing releases used in stable products suddenly fail to compile, wasting everybody time.

## Why -g

This should be decided by the one who compiles the code. Some people want small and pre-stripped binaries and appending this to the CFLAGS breaks the standard way of achieving this. Prepend it if you wish, but please do not append it.

## Why -O3

On many systems with limited cache or higher memory latency, `O3` is slower than `O2`, so IMHO it should not be hardcoded. In my case I used `Os` and it's faster. The `O` value should be left to the system, not hardcoded.
2017-12-12 01:26:22 -05:00
Takatoshi Kondo
208595b262 Merge pull request #639 from redboltz/fix_637
Fixed #637.
2017-11-28 08:05:43 +09:00
Takatoshi Kondo
83a4b89818 Merge pull request #645 from redboltz/fix_644
Fixed #644.
2017-11-14 19:04:03 +09:00
Takatoshi Kondo
d46f220737 Removed unused code. 2017-11-12 12:31:17 +09:00
Takatoshi Kondo
b4db293181 Fixed #644.
Added `as()` checking to MSGPACK_DEFINE family.
2017-11-11 15:44:31 +09:00
Takatoshi Kondo
d1eac600e9 Merge pull request #643 from redboltz/fix_642
Fixed #642.
2017-11-10 12:15:05 +09:00
Takatoshi Kondo
7e758ca053 Fixed #642.
Fixed documentation.
2017-11-09 10:40:43 +09:00
Takatoshi Kondo
db6d4f2003 Merge pull request #641 from redboltz/fix_640
Fixed #640.
2017-11-04 15:43:02 +09:00
Takatoshi Kondo
1ba46a30ce Fixed #640.
Replaced comma with semi colon.
Unified cording style.
2017-11-04 12:55:22 +09:00
Takatoshi Kondo
5ece2ef2c7 Fixed #637.
<<< Breaking change >>>
In the functions unpack() and parse(),
Old behavior: If any parse error is happend, offset is NOT updated.
New behavior: If any parse error is happend, offset is updated to the
position the error happened.

It helps MessagePack format error analysis.

If you want to old behavior, copy the original value of offset and then call unpack()
and/or parse().
2017-10-22 18:22:41 +09:00
Takatoshi Kondo
9513734040 Merge pull request #635 from sztomi/sztomi/objhandle_ops
Added * and -> operators to object_handle
2017-10-14 10:54:28 +09:00
sztomi
d452625ed1 Added * and -> operators to object_handle 2017-10-09 20:23:25 +02:00
Takatoshi Kondo
b02c6beb4d Merge pull request #634 from redboltz/fix_trusty
Fix trusty
2017-10-09 18:39:39 +09:00
Takatoshi Kondo
06c2896def Added symbolic link. 2017-10-09 15:20:29 +09:00
Takatoshi Kondo
724db8ed89 Added zlib1g-dev for 32bit build. 2017-10-09 14:29:47 +09:00
Takatoshi Kondo
fa48078a52 Merge pull request #631 from redboltz/fix_travis
Set `precise` explicitly to fix 32bit zlib missing problem.
2017-10-01 23:38:21 +09:00
Takatoshi Kondo
d8ad85fa8c Set precise explicitly to fix 32bit zlib missing problem. 2017-10-01 21:25:06 +09:00
Takatoshi Kondo
cc3b895449 Merge pull request #630 from samdoshi/patch-1
Don't sudo with brew in QUICKSTART-C.md
2017-10-01 17:45:36 +09:00
Sam Doshi
384242e5eb Don't sudo with brew in QUICKSTART-C.md 2017-10-01 08:29:46 +01:00
Takatoshi Kondo
7a98138f27 Merge pull request #625 from redboltz/update_to_215
Updated the version to 2.1.5.
2017-08-05 00:02:07 +09:00
Takatoshi Kondo
cd4e0bda57 Updated the version to 2.1.5.
Version 2.1.4 will be removed.
See https://github.com/msgpack/msgpack-c/issues/623
2017-08-04 23:07:27 +09:00
Takatoshi Kondo
1ad2db0c42 Merge pull request #624 from mkaes/master
Add defines for QNX build
2017-08-04 22:37:44 +09:00
Michael Kaes
96a76a7a5c Add defines for QNX build 2017-08-04 14:41:37 +02:00
Takatoshi Kondo
bc964bd847 Merge pull request #622 from redboltz/add_version_updater
Added version updating script.
2017-08-04 08:14:43 +09:00
Takatoshi Kondo
12604b5c8e Added version updating script. 2017-08-04 08:13:48 +09:00
Takatoshi Kondo
7c67109396 Updated README. 2017-08-04 07:18:17 +09:00
147 changed files with 5087 additions and 585 deletions

View File

@@ -1,5 +1,6 @@
language: cpp
sudo: false
dist: trusty
install:
- export BASE=`pwd`
@@ -11,6 +12,7 @@ install:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then export LD_LIBRARY_PATH="${BASE}/usr/lib:$LD_LIBRARY_PATH"; fi
- if [ "$CXX" = "g++" ]; then export CXX="g++-6" CC="gcc-6"; fi
- if [ "$CXX" = "clang++" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then export CXX="clang++-3.9" CC="clang-3.9"; fi
- if [ "$CXX" = "g++" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then cd /usr/include/c++/$(g++ -v 2>&1 | grep version | awk '{print $3}')/bits; ln -s ../ext/atomicity.h .; cd ${BASE}/usr; fi
#gtest
- wget https://github.com/google/googletest/archive/release-1.7.0.zip -O googletest-release-1.7.0.zip
- unzip -q googletest-release-1.7.0.zip
@@ -27,7 +29,8 @@ install:
# valgrind
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then wget http://valgrind.org/downloads/valgrind-3.12.0.tar.bz2 && tar xjf valgrind-3.12.0.tar.bz2 && cd valgrind-3.12.0 && ./configure --prefix=${BASE}/usr > /dev/null && make -j3 > /dev/null && make install > /dev/null && cd ..; fi
# boost
- if [ "$BOOST" == "ON" ]; then wget http://sourceforge.net/projects/boost/files/boost/1.63.0/boost_1_63_0.zip && unzip -q boost_1_63_0.zip && cd boost_1_63_0 && ./bootstrap.sh && ./b2 -j3 --prefix=${BASE}/usr --with-chrono --with-context --with-system --with-timer address-model=${ARCH} install > /dev/null && cd ..; fi
- if [ "$BOOST" == "ON" ]; then wget http://sourceforge.net/projects/boost/files/boost/1.66.0/boost_1_66_0.zip && unzip -q boost_1_66_0.zip && cd boost_1_66_0 && ./bootstrap.sh && ./b2 -j3 --prefix=${BASE}/usr --with-chrono --with-context --with-system --with-timer address-model=${ARCH} install > /dev/null && cd ..; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ln -s /usr/include/x86_64-linux-gnu/zconf.h /usr/include; fi
matrix:
include:
@@ -36,7 +39,7 @@ matrix:
env: ACTION="ci/build_cmake.sh" CXX11="ON" ARCH="64" BOOST="ON" SHARED="ON" CHAR_SIGN="unsigned" API_VERSION="1"
- os: osx
compiler: clang
env: ACTION="ci/build_cmake.sh" CXX11="ON" ARCH="64" BOOST="ON" SHARED="ON" CHAR_SIGN="signed" API_VERSION="2"
env: ACTION="ci/build_cmake.sh" CXX11="ON" ARCH="64" BOOST="ON" SHARED="ON" CHAR_SIGN="signed" API_VERSION="3"
- os: osx
compiler: clang
env: ACTION="ci/build_cmake.sh" CXX11="ON" ARCH="64" SHARED="ON" CHAR_SIGN="signed" API_VERSION="2"
@@ -78,12 +81,13 @@ matrix:
- lib32gcc1
- libc6-i386
- lib32z1-dev
- zlib1g-dev
- bzip2
- clang-3.9
- libc6-dbg
- os: linux
compiler: clang
env: ACTION="ci/build_cmake.sh" CXX11="ON" ARCH="64" BOOST="ON" SHARED="ON" CHAR_SIGN="signed" API_VERSION="2" X3_PARSE="ON"
env: ACTION="ci/build_cmake.sh" CXX11="ON" ARCH="64" BOOST="ON" SHARED="ON" CHAR_SIGN="signed" API_VERSION="3" X3_PARSE="ON"
addons:
apt:
sources:
@@ -116,6 +120,7 @@ matrix:
- lib32gcc1
- libc6-i386
- lib32z1-dev
- zlib1g-dev
- bzip2
- clang-3.9
- libc6-dbg
@@ -135,7 +140,7 @@ matrix:
- libc6-dbg
- os: linux
compiler: gcc
env: ACTION="ci/build_cmake.sh" CXX11="ON" ARCH="32" BOOST="ON" SHARED="ON" CHAR_SIGN="unsigned" API_VERSION="2" X3_PARSE="ON"
env: ACTION="ci/build_cmake.sh" CXX11="ON" ARCH="32" BOOST="ON" SHARED="ON" CHAR_SIGN="unsigned" API_VERSION="3" X3_PARSE="ON"
addons:
apt:
sources:
@@ -149,6 +154,7 @@ matrix:
- lib32gcc1
- libc6-i386
- lib32z1-dev
- zlib1g-dev
- bzip2
- libc6-dbg
- os: linux
@@ -181,6 +187,7 @@ matrix:
- lib32gcc1
- libc6-i386
- lib32z1-dev
- zlib1g-dev
- bzip2
- libc6-dbg
- os: linux
@@ -199,8 +206,10 @@ matrix:
- lib32gcc1
- libc6-i386
- lib32z1-dev
- zlib1g-dev
- bzip2
- libc6-dbg
script:
- CMAKE_CXX_COMPILER="${CXX}" CMAKE_C_COMPILER="${CC}" CMAKE_LIBRARY_PATH="${BASE}/usr/lib:${BASE}/build" GTEST_ROOT="${BASE}/usr" BOOST_ROOT="${BASE}/usr" ${ACTION}
- CMAKE_CXX_COMPILER="${CXX}" CMAKE_C_COMPILER="${CC}" CMAKE_LIBRARY_PATH="${BASE}/usr/lib:${BASE}/build" GTEST_ROOT="${BASE}/usr" BOOST_ROOT="${BASE}/usr" CFLAGS="-Werror -g" CXXFLAGS="-Werror -g" ${ACTION}
- cat Files.cmake| grep ".*\.[h|hpp]" | perl -pe 's/ //g' | sort > tmp1 && find include -name "*.h" -o -name "*.hpp" | sort > tmp2 && diff tmp1 tmp2

View File

@@ -1,4 +1,24 @@
# 2017-08-03 version 2.1.4
# 2018-05-09 version 3.0.0
## << breaking changes >>
* Change offset parameter updating rule. If parse error is happend, offset is updated to the error position. (#639, #666)
## << other updates >>
* Improve cross platform configuration (#655, #677)
* Improve build system (#647)
* Improve user class adaptor (#645, #673)
* Improve msgpack::object visitation logic (#676)
* Remove some warnings (#641, 659)
* Add `->` and `*` operators to object_handle (#635)
* Improve CI environment (#631, #634, #643, #657, #662, #668)
* Improve documents (#630, #661)
* Refactoring (#670)
* Add OSS-Fuzz support (#672, #674, #675, #678)
# 2017-08-04 version 2.1.5
* Improve cross platform configuration (#624)
* Add boost asio examples (including zlib) (#610)
* Remove some warnings (#611)
* Fix unpack visitor to treat float32/64 correctly (#613)
@@ -6,6 +26,9 @@
* Fix alignment problem on some platform (#617, #518)
* Fix conflict std::tuple, std::pair, and boost::fusion::sequence problem (#619)
# 2017-08-03 version 2.1.4 (Invalid)
* See https://github.com/msgpack/msgpack-c/issues/623
# 2017-06-15 version 2.1.3
* Improve build system (#603)
* Add C++17 adaptors `std::optional` and `std::string_view`. (#607, #608)

View File

@@ -124,7 +124,7 @@ ENDIF ()
IF (MSGPACK_DEFAULT_API_VERSION)
SET (CMAKE_CXX_FLAGS "-DMSGPACK_DEFAULT_API_VERSION=${MSGPACK_DEFAULT_API_VERSION} ${CMAKE_CXX_FLAGS}")
ELSE ()
SET (CMAKE_CXX_FLAGS "-DMSGPACK_DEFAULT_API_VERSION=2 ${CMAKE_CXX_FLAGS}")
SET (CMAKE_CXX_FLAGS "-DMSGPACK_DEFAULT_API_VERSION=3 ${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)
@@ -237,9 +237,9 @@ ENDIF ()
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
IF (MSGPACK_ENABLE_SHARED)
SET_PROPERTY (TARGET msgpackc APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Werror -g -O3 -DPIC")
SET_PROPERTY (TARGET msgpackc APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra -DPIC")
ENDIF ()
SET_PROPERTY (TARGET msgpackc-static APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Werror -g -O3" )
SET_PROPERTY (TARGET msgpackc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra" )
ENDIF ()
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")

View File

@@ -216,6 +216,8 @@ IF (MSGPACK_ENABLE_CXX)
include/msgpack/adaptor/vector_unsigned_char.hpp
include/msgpack/cpp_config.hpp
include/msgpack/cpp_config_decl.hpp
include/msgpack/create_object_visitor.hpp
include/msgpack/create_object_visitor_decl.hpp
include/msgpack/fbuffer.hpp
include/msgpack/fbuffer_decl.hpp
include/msgpack/gcc_atomic.hpp
@@ -223,12 +225,16 @@ IF (MSGPACK_ENABLE_CXX)
include/msgpack/iterator_decl.hpp
include/msgpack/meta.hpp
include/msgpack/meta_decl.hpp
include/msgpack/null_visitor.hpp
include/msgpack/null_visitor_decl.hpp
include/msgpack/object.hpp
include/msgpack/object_decl.hpp
include/msgpack/object_fwd.hpp
include/msgpack/object_fwd_decl.hpp
include/msgpack/pack.hpp
include/msgpack/pack_decl.hpp
include/msgpack/parse.hpp
include/msgpack/parse_decl.hpp
include/msgpack/parse_return.hpp
include/msgpack/preprocessor.hpp
include/msgpack/preprocessor/arithmetic.hpp
@@ -541,6 +547,7 @@ IF (MSGPACK_ENABLE_CXX)
include/msgpack/v1/adaptor/detail/cpp03_define_map_decl.hpp
include/msgpack/v1/adaptor/detail/cpp03_msgpack_tuple.hpp
include/msgpack/v1/adaptor/detail/cpp03_msgpack_tuple_decl.hpp
include/msgpack/v1/adaptor/detail/cpp11_convert_helper.hpp
include/msgpack/v1/adaptor/detail/cpp11_define_array.hpp
include/msgpack/v1/adaptor/detail/cpp11_define_array_decl.hpp
include/msgpack/v1/adaptor/detail/cpp11_define_map.hpp
@@ -632,31 +639,85 @@ IF (MSGPACK_ENABLE_CXX)
include/msgpack/v2/adaptor/v4raw_decl.hpp
include/msgpack/v2/cpp_config_decl.hpp
include/msgpack/v2/create_object_visitor.hpp
include/msgpack/v2/create_object_visitor_decl.hpp
include/msgpack/v2/detail/cpp03_zone_decl.hpp
include/msgpack/v2/detail/cpp11_zone_decl.hpp
include/msgpack/v2/fbuffer_decl.hpp
include/msgpack/v2/iterator_decl.hpp
include/msgpack/v2/meta_decl.hpp
include/msgpack/v2/null_visitor.hpp
include/msgpack/v2/null_visitor_decl.hpp
include/msgpack/v2/object.hpp
include/msgpack/v2/object_decl.hpp
include/msgpack/v2/object_fwd.hpp
include/msgpack/v2/object_fwd_decl.hpp
include/msgpack/v2/pack_decl.hpp
include/msgpack/v2/parse.hpp
include/msgpack/v2/parse_decl.hpp
include/msgpack/v2/parse_return.hpp
include/msgpack/v2/sbuffer_decl.hpp
include/msgpack/v2/unpack.hpp
include/msgpack/v2/unpack_decl.hpp
include/msgpack/v2/vrefbuffer_decl.hpp
include/msgpack/v2/x3_parse.hpp
include/msgpack/v2/x3_parse_decl.hpp
include/msgpack/v2/x3_unpack.hpp
include/msgpack/v2/x3_unpack_decl.hpp
include/msgpack/v2/zbuffer_decl.hpp
include/msgpack/v2/zone_decl.hpp
include/msgpack/v3/adaptor/adaptor_base.hpp
include/msgpack/v3/adaptor/adaptor_base_decl.hpp
include/msgpack/v3/adaptor/array_ref_decl.hpp
include/msgpack/v3/adaptor/boost/msgpack_variant_decl.hpp
include/msgpack/v3/adaptor/check_container_size_decl.hpp
include/msgpack/v3/adaptor/define_decl.hpp
include/msgpack/v3/adaptor/detail/cpp03_define_array_decl.hpp
include/msgpack/v3/adaptor/detail/cpp03_define_map_decl.hpp
include/msgpack/v3/adaptor/detail/cpp03_msgpack_tuple_decl.hpp
include/msgpack/v3/adaptor/detail/cpp11_define_array_decl.hpp
include/msgpack/v3/adaptor/detail/cpp11_define_map_decl.hpp
include/msgpack/v3/adaptor/detail/cpp11_msgpack_tuple_decl.hpp
include/msgpack/v3/adaptor/ext_decl.hpp
include/msgpack/v3/adaptor/fixint_decl.hpp
include/msgpack/v3/adaptor/int_decl.hpp
include/msgpack/v3/adaptor/map_decl.hpp
include/msgpack/v3/adaptor/msgpack_tuple_decl.hpp
include/msgpack/v3/adaptor/nil_decl.hpp
include/msgpack/v3/adaptor/raw_decl.hpp
include/msgpack/v3/adaptor/size_equal_only_decl.hpp
include/msgpack/v3/adaptor/v4raw_decl.hpp
include/msgpack/v3/cpp_config_decl.hpp
include/msgpack/v3/create_object_visitor_decl.hpp
include/msgpack/v3/detail/cpp03_zone_decl.hpp
include/msgpack/v3/detail/cpp11_zone_decl.hpp
include/msgpack/v3/fbuffer_decl.hpp
include/msgpack/v3/iterator_decl.hpp
include/msgpack/v3/meta_decl.hpp
include/msgpack/v3/null_visitor_decl.hpp
include/msgpack/v3/object_decl.hpp
include/msgpack/v3/object_fwd.hpp
include/msgpack/v3/object_fwd_decl.hpp
include/msgpack/v3/pack_decl.hpp
include/msgpack/v3/parse.hpp
include/msgpack/v3/parse_decl.hpp
include/msgpack/v3/parse_return.hpp
include/msgpack/v3/sbuffer_decl.hpp
include/msgpack/v3/unpack.hpp
include/msgpack/v3/unpack_decl.hpp
include/msgpack/v3/vrefbuffer_decl.hpp
include/msgpack/v3/x3_parse_decl.hpp
include/msgpack/v3/x3_unpack.hpp
include/msgpack/v3/x3_unpack_decl.hpp
include/msgpack/v3/zbuffer_decl.hpp
include/msgpack/v3/zone_decl.hpp
include/msgpack/version.hpp
include/msgpack/versioning.hpp
include/msgpack/vrefbuffer.hpp
include/msgpack/vrefbuffer_decl.hpp
include/msgpack/x3_parse.hpp
include/msgpack/x3_parse_decl.hpp
include/msgpack/x3_unpack.hpp
include/msgpack/x3_unpack_decl.hpp
include/msgpack/zbuffer.hpp
include/msgpack/zbuffer_decl.hpp
include/msgpack/zone.hpp

View File

@@ -20,7 +20,7 @@ You might need to run `sudo port selfupdate` before installing to update the pac
You can also install via Homebrew.
```
$ sudo brew install msgpack
$ brew install msgpack
```
## FreeBSD with Ports Collection

View File

@@ -1,9 +1,9 @@
`msgpack` for C/C++
===================
Version 2.1.3 [![Build Status](https://travis-ci.org/msgpack/msgpack-c.svg?branch=master)](https://travis-ci.org/msgpack/msgpack-c) [![Build status](https://ci.appveyor.com/api/projects/status/8kstcgt79qj123mw/branch/master?svg=true)](https://ci.appveyor.com/project/redboltz/msgpack-c/branch/master)
Version 3.0.0 [![Build Status](https://travis-ci.org/msgpack/msgpack-c.svg?branch=master)](https://travis-ci.org/msgpack/msgpack-c) [![Build status](https://ci.appveyor.com/api/projects/status/8kstcgt79qj123mw/branch/master?svg=true)](https://ci.appveyor.com/project/redboltz/msgpack-c/branch/master)
It's like JSON but small and fast.
It's like JSON but smaller and faster.
Overview
--------
@@ -11,7 +11,7 @@ Overview
[MessagePack](http://msgpack.org/) is an efficient binary serialization
format, which lets you exchange data among multiple languages like JSON,
except that it's faster and smaller. Small integers are encoded into a
single byte while typical short strings require only one extra byte in
single byte and short strings require only one extra byte in
addition to the strings themselves.
Example

View File

@@ -1,4 +1,4 @@
version: 2.1.4.{build}
version: 3.0.0.{build}
image:
- Visual Studio 2015

View File

@@ -61,6 +61,7 @@ struct define_map<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> {
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
std::map<std::string, msgpack::object const*> kvmap;
for (uint32_t i = 0; i < o.via.map.size; ++i) {
if (o.via.map.ptr[i].key.type != msgpack::type::STR) { throw msgpack::type_error(); }
kvmap.insert(
std::map<std::string, msgpack::object const*>::value_type(
std::string(

View File

@@ -39,7 +39,7 @@ FOREACH (source_file ${exec_PROGRAMS})
)
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 -g -O3")
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")
ENDIF ()
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")

View File

@@ -70,13 +70,22 @@ int main() {
// Client
auto host = "localhost";
boost::asio::ip::tcp::resolver r(ios);
#if BOOST_VERSION < 106600
boost::asio::ip::tcp::resolver::query q(host, boost::lexical_cast<std::string>(port));
auto it = r.resolve(q);
boost::asio::ip::tcp::resolver::iterator end;
#else // BOOST_VERSION < 106600
auto eps = r.resolve(host, boost::lexical_cast<std::string>(port));
auto it = eps.begin();
auto end = eps.end();
#endif // BOOST_VERSION < 106600
boost::asio::ip::tcp::socket cs(ios);
boost::asio::async_connect(
cs,
it,
end,
[&]
(boost::system::error_code const& e, boost::asio::ip::tcp::resolver::iterator) {
if (e) {

View File

@@ -136,13 +136,24 @@ int main() {
// Client
auto host = "localhost";
boost::asio::ip::tcp::resolver r(ios);
#if BOOST_VERSION < 106600
boost::asio::ip::tcp::resolver::query q(host, boost::lexical_cast<std::string>(port));
auto it = r.resolve(q);
boost::asio::ip::tcp::resolver::iterator end;
#else // BOOST_VERSION < 106600
auto eps = r.resolve(host, boost::lexical_cast<std::string>(port));
auto it = eps.begin();
auto end = eps.end();
#endif // BOOST_VERSION < 106600
boost::asio::ip::tcp::socket cs(ios);
boost::asio::async_connect(
cs,
it,
end,
[&]
(boost::system::error_code const& e, boost::asio::ip::tcp::resolver::iterator) {
if (e) {

View File

@@ -23,7 +23,7 @@ FOREACH (source_file ${exec_PROGRAMS})
${MSGPACK_LIB}
)
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 -g -O3")
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")
ENDIF ()
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")

View File

@@ -40,7 +40,7 @@ FOREACH (source_file ${exec_PROGRAMS})
$<TARGET_PROPERTY:msgpackc,INTERFACE_INCLUDE_DIRECTORIES>
)
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 -g -O3")
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")
ENDIF ()
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
IF (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
@@ -65,7 +65,7 @@ FOREACH (source_file ${with_pthread_PROGRAMS})
${CMAKE_THREAD_LIBS_INIT}
)
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 -g -O3")
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")
ENDIF ()
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
IF (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")

View File

@@ -25,7 +25,7 @@ IF (MSGPACK_CXX11)
$<TARGET_PROPERTY:msgpackc,INTERFACE_INCLUDE_DIRECTORIES>
)
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 -g -O3 ")
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")
ENDIF ()
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")

View File

@@ -1,4 +1,4 @@
IF (MSGPACK_USE_X3_PARSE)
IF (MSGPACK_USE_X3_PARSE AND MSGPACK_DEFAULT_API_VERSION VERSION_GREATER 1)
INCLUDE_DIRECTORIES (
../include
)
@@ -23,7 +23,7 @@ IF (MSGPACK_USE_X3_PARSE)
$<TARGET_PROPERTY:msgpackc,INTERFACE_INCLUDE_DIRECTORIES>
)
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 -g ")
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")
ENDIF ()
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
@@ -54,7 +54,7 @@ IF (MSGPACK_USE_X3_PARSE)
${CMAKE_THREAD_LIBS_INIT}
)
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 -g ")
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")
ENDIF ()
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")

View File

@@ -0,0 +1,23 @@
#include <msgpack.hpp>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
try {
// NOTE(derwolfe): by default the limits are set at 2^32-1 length. I'm
// setting these at far smaller values to avoid OOMs
const int test_limit = 1000;
msgpack::object_handle unpacked = msgpack::unpack(reinterpret_cast<const char *>(data),
size,
nullptr,
nullptr,
msgpack::unpack_limit(test_limit,
test_limit,
test_limit,
test_limit,
test_limit,
test_limit));
msgpack::sbuffer sbuf;
msgpack::pack(sbuf, unpacked.get());
} catch (...) {
}
return 0;
}

View File

@@ -0,0 +1 @@
<EFBFBD>

View File

@@ -0,0 +1 @@
<EFBFBD>

View File

@@ -0,0 +1,2 @@
<EFBFBD><01><02><03><04><05><06><07><08> <09>
<EFBFBD> <0B> <0C>

Binary file not shown.

Binary file not shown.

View File

@@ -11,7 +11,11 @@
#include "msgpack/iterator.hpp"
#include "msgpack/zone.hpp"
#include "msgpack/pack.hpp"
#include "msgpack/null_visitor.hpp"
#include "msgpack/parse.hpp"
#include "msgpack/unpack.hpp"
#include "msgpack/x3_parse.hpp"
#include "msgpack/x3_unpack.hpp"
#include "msgpack/sbuffer.hpp"
#include "msgpack/vrefbuffer.hpp"
#include "msgpack/version.hpp"

View File

@@ -14,5 +14,6 @@
#include "msgpack/v1/adaptor/adaptor_base.hpp"
#include "msgpack/v2/adaptor/adaptor_base.hpp"
#include "msgpack/v3/adaptor/adaptor_base.hpp"
#endif // MSGPACK_ADAPTOR_BASE_HPP

View File

@@ -12,5 +12,6 @@
#include "msgpack/v1/adaptor/adaptor_base_decl.hpp"
#include "msgpack/v2/adaptor/adaptor_base_decl.hpp"
#include "msgpack/v3/adaptor/adaptor_base_decl.hpp"
#endif // MSGPACK_ADAPTOR_BASE_DECL_HPP

View File

@@ -12,5 +12,6 @@
#include "msgpack/v1/adaptor/array_ref_decl.hpp"
#include "msgpack/v2/adaptor/array_ref_decl.hpp"
#include "msgpack/v3/adaptor/array_ref_decl.hpp"
#endif // MSGPACK_TYPE_ARRAY_REF_DECL_HPP

View File

@@ -12,5 +12,6 @@
#include "msgpack/v1/adaptor/boost/msgpack_variant_decl.hpp"
#include "msgpack/v2/adaptor/boost/msgpack_variant_decl.hpp"
#include "msgpack/v3/adaptor/boost/msgpack_variant_decl.hpp"
#endif // MSGPACK_TYPE_BOOST_MSGPACK_VARIANT_DECL_HPP

View File

@@ -12,5 +12,6 @@
#include "msgpack/v1/adaptor/check_container_size_decl.hpp"
#include "msgpack/v2/adaptor/check_container_size_decl.hpp"
#include "msgpack/v3/adaptor/check_container_size_decl.hpp"
#endif // MSGPACK_CHECK_CONTAINER_SIZE_DECL_HPP

View File

@@ -139,5 +139,6 @@
#include "msgpack/v1/adaptor/define_decl.hpp"
#include "msgpack/v2/adaptor/define_decl.hpp"
#include "msgpack/v3/adaptor/define_decl.hpp"
#endif // MSGPACK_DEFINE_DECL_HPP

View File

@@ -12,5 +12,6 @@
#include "msgpack/v1/adaptor/ext_decl.hpp"
#include "msgpack/v2/adaptor/ext_decl.hpp"
#include "msgpack/v3/adaptor/ext_decl.hpp"
#endif // MSGPACK_TYPE_EXT_DECL_HPP

View File

@@ -12,5 +12,6 @@
#include "msgpack/v1/adaptor/fixint_decl.hpp"
#include "msgpack/v2/adaptor/fixint_decl.hpp"
#include "msgpack/v3/adaptor/fixint_decl.hpp"
#endif // MSGPACK_TYPE_FIXINT_DECL_HPP

View File

@@ -12,5 +12,6 @@
#include "msgpack/v1/adaptor/int_decl.hpp"
#include "msgpack/v2/adaptor/int_decl.hpp"
#include "msgpack/v3/adaptor/int_decl.hpp"
#endif // MSGPACK_TYPE_INT_DECL_HPP

View File

@@ -12,5 +12,6 @@
#include "msgpack/v1/adaptor/map_decl.hpp"
#include "msgpack/v2/adaptor/map_decl.hpp"
#include "msgpack/v3/adaptor/map_decl.hpp"
#endif // MSGPACK_TYPE_MAP_DECL_HPP

View File

@@ -12,5 +12,6 @@
#include "msgpack/v1/adaptor/msgpack_tuple_decl.hpp"
#include "msgpack/v2/adaptor/msgpack_tuple_decl.hpp"
#include "msgpack/v3/adaptor/msgpack_tuple_decl.hpp"
#endif // MSGPACK_MSGPACK_TUPLE_DECL_HPP

View File

@@ -12,5 +12,6 @@
#include "msgpack/v1/adaptor/nil_decl.hpp"
#include "msgpack/v2/adaptor/nil_decl.hpp"
#include "msgpack/v3/adaptor/nil_decl.hpp"
#endif // MSGPACK_TYPE_NIL_DECL_HPP

View File

@@ -12,5 +12,6 @@
#include "msgpack/v1/adaptor/raw_decl.hpp"
#include "msgpack/v2/adaptor/raw_decl.hpp"
#include "msgpack/v3/adaptor/raw_decl.hpp"
#endif // MSGPACK_TYPE_RAW_DECL_HPP

View File

@@ -12,5 +12,6 @@
#include "msgpack/v1/adaptor/size_equal_only_decl.hpp"
#include "msgpack/v2/adaptor/size_equal_only_decl.hpp"
#include "msgpack/v3/adaptor/size_equal_only_decl.hpp"
#endif // MSGPACK_TYPE_SIZE_EQUAL_ONLY_DECL_HPP

View File

@@ -12,5 +12,6 @@
#include "msgpack/v1/adaptor/v4raw_decl.hpp"
#include "msgpack/v2/adaptor/v4raw_decl.hpp"
#include "msgpack/v3/adaptor/v4raw_decl.hpp"
#endif // MSGPACK_TYPE_V4RAW_DECL_HPP

View File

@@ -12,5 +12,6 @@
#include "msgpack/v1/cpp_config_decl.hpp"
#include "msgpack/v2/cpp_config_decl.hpp"
#include "msgpack/v3/cpp_config_decl.hpp"
#endif // MSGPACK_CPP_CONFIG_DECL_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ deserializing routine
//
// Copyright (C) 2018 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_CREATE_OBJECT_VISITOR_HPP
#define MSGPACK_CREATE_OBJECT_VISITOR_HPP
#include "msgpack/create_object_visitor_decl.hpp"
#include "msgpack/v2/create_object_visitor.hpp"
#endif // MSGPACK_CREATE_OBJECT_VISITOR_HPP

View File

@@ -0,0 +1,16 @@
//
// MessagePack for C++ deserializing routine
//
// Copyright (C) 2018 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_CREATE_OBJECT_VISITOR_DECL_HPP
#define MSGPACK_CREATE_OBJECT_VISITOR_DECL_HPP
#include "msgpack/v2/create_object_visitor_decl.hpp"
#include "msgpack/v3/create_object_visitor_decl.hpp"
#endif // MSGPACK_CREATE_OBJECT_VISITOR_DECL_HPP

View File

@@ -12,5 +12,6 @@
#include "msgpack/v1/fbuffer_decl.hpp"
#include "msgpack/v2/fbuffer_decl.hpp"
#include "msgpack/v3/fbuffer_decl.hpp"
#endif // MSGPACK_FBUFFER_DECL_HPP

View File

@@ -13,5 +13,6 @@
#include <msgpack/v1/iterator_decl.hpp>
#include <msgpack/v2/iterator_decl.hpp>
#include <msgpack/v3/iterator_decl.hpp>
#endif // MSGPACK_V1_ITERATOR_DECL_HPP
#endif // MSGPACK_ITERATOR_DECL_HPP

View File

@@ -13,5 +13,6 @@
#include "msgpack/v1/meta_decl.hpp"
#include "msgpack/v2/meta_decl.hpp"
#include "msgpack/v3/meta_decl.hpp"
#endif // MSGPACK_META_DECL_HPP

View File

@@ -0,0 +1,17 @@
//
// MessagePack for C++ deserializing routine
//
// Copyright (C) 2018 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_NULL_VISITOR_HPP
#define MSGPACK_NULL_VISITOR_HPP
#include "msgpack/null_visitor_decl.hpp"
#include "msgpack/v2/null_visitor.hpp"
#endif // MSGPACK_NULL_VISITOR_HPP

View File

@@ -0,0 +1,16 @@
//
// MessagePack for C++ deserializing routine
//
// Copyright (C) 2018 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_NULL_VISITOR_DECL_HPP
#define MSGPACK_NULL_VISITOR_DECL_HPP
#include "msgpack/v2/null_visitor_decl.hpp"
#include "msgpack/v3/null_visitor_decl.hpp"
#endif // MSGPACK_NULL_VISITOR_DECL_HPP

View File

@@ -13,5 +13,6 @@
#include "msgpack/v1/object_decl.hpp"
#include "msgpack/v2/object_decl.hpp"
#include "msgpack/v3/object_decl.hpp"
#endif // MSGPACK_OBJECT_DECL_HPP

View File

@@ -15,5 +15,6 @@
#include "msgpack/v1/object_fwd.hpp"
#include "msgpack/v2/object_fwd.hpp"
#include "msgpack/v3/object_fwd.hpp"
#endif // MSGPACK_OBJECT_FWD_HPP

View File

@@ -13,5 +13,6 @@
#include "msgpack/v1/object_fwd_decl.hpp"
#include "msgpack/v2/object_fwd_decl.hpp"
#include "msgpack/v3/object_fwd_decl.hpp"
#endif // MSGPACK_OBJECT_FWD_DECL_HPP

View File

@@ -98,6 +98,7 @@ static int msgpack_pack_bin_body(msgpack_packer* pk, const void* b, size_t l);
static int msgpack_pack_ext(msgpack_packer* pk, size_t l, int8_t type);
static int msgpack_pack_ext_body(msgpack_packer* pk, const void* b, size_t l);
MSGPACK_DLLEXPORT
int msgpack_pack_object(msgpack_packer* pk, msgpack_object d);

View File

@@ -12,5 +12,6 @@
#include "msgpack/v1/pack_decl.hpp"
#include "msgpack/v2/pack_decl.hpp"
#include "msgpack/v3/pack_decl.hpp"
#endif // MSGPACK_PACK_DECL_HPP

18
include/msgpack/parse.hpp Normal file
View File

@@ -0,0 +1,18 @@
//
// MessagePack for C++ deserializing routine
//
// Copyright (C) 2018 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_PARSE_HPP
#define MSGPACK_PARSE_HPP
#include "msgpack/parse_decl.hpp"
#include "msgpack/v2/parse.hpp"
#include "msgpack/v3/parse.hpp"
#endif // MSGPACK_PARSE_HPP

View File

@@ -0,0 +1,16 @@
//
// MessagePack for C++ deserializing routine
//
// Copyright (C) 2018 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_PARSE_DECL_HPP
#define MSGPACK_PARSE_DECL_HPP
#include "msgpack/v2/parse_decl.hpp"
#include "msgpack/v3/parse_decl.hpp"
#endif // MSGPACK_PARSE_DECL_HPP

View File

@@ -12,5 +12,6 @@
#include "msgpack/v1/parse_return.hpp"
#include "msgpack/v2/parse_return.hpp"
#include "msgpack/v3/parse_return.hpp"
#endif // MSGPACK_PARSE_RETURN_HPP

View File

@@ -12,6 +12,7 @@
#include "msgpack/v1/sbuffer_decl.hpp"
#include "msgpack/v2/sbuffer_decl.hpp"
#include "msgpack/v3/sbuffer_decl.hpp"
#endif // MSGPACK_SBUFFER_DECL_HPP

View File

@@ -14,6 +14,6 @@
#include "msgpack/v1/unpack.hpp"
#include "msgpack/v2/unpack.hpp"
#include "msgpack/v2/x3_unpack.hpp"
#include "msgpack/v3/unpack.hpp"
#endif // MSGPACK_UNPACK_HPP

View File

@@ -12,5 +12,6 @@
#include "msgpack/v1/unpack_decl.hpp"
#include "msgpack/v2/unpack_decl.hpp"
#include "msgpack/v3/unpack_decl.hpp"
#endif // MSGPACK_UNPACK_DECL_HPP

View File

@@ -62,6 +62,7 @@ struct define_map<A0, A1> {
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
std::map<std::string, msgpack::object const*> kvmap;
for (uint32_t i = 0; i < o.via.map.size; ++i) {
if (o.via.map.ptr[i].key.type != msgpack::type::STR) { throw msgpack::type_error(); }
kvmap.insert(
std::map<std::string, msgpack::object const*>::value_type(
std::string(
@@ -114,6 +115,7 @@ struct define_map<A0, A1, A2, A3> {
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
std::map<std::string, msgpack::object const*> kvmap;
for (uint32_t i = 0; i < o.via.map.size; ++i) {
if (o.via.map.ptr[i].key.type != msgpack::type::STR) { throw msgpack::type_error(); }
kvmap.insert(
std::map<std::string, msgpack::object const*>::value_type(
std::string(
@@ -180,6 +182,7 @@ struct define_map<A0, A1, A2, A3, A4, A5> {
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
std::map<std::string, msgpack::object const*> kvmap;
for (uint32_t i = 0; i < o.via.map.size; ++i) {
if (o.via.map.ptr[i].key.type != msgpack::type::STR) { throw msgpack::type_error(); }
kvmap.insert(
std::map<std::string, msgpack::object const*>::value_type(
std::string(
@@ -260,6 +263,7 @@ struct define_map<A0, A1, A2, A3, A4, A5, A6, A7> {
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
std::map<std::string, msgpack::object const*> kvmap;
for (uint32_t i = 0; i < o.via.map.size; ++i) {
if (o.via.map.ptr[i].key.type != msgpack::type::STR) { throw msgpack::type_error(); }
kvmap.insert(
std::map<std::string, msgpack::object const*>::value_type(
std::string(
@@ -354,6 +358,7 @@ struct define_map<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9> {
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
std::map<std::string, msgpack::object const*> kvmap;
for (uint32_t i = 0; i < o.via.map.size; ++i) {
if (o.via.map.ptr[i].key.type != msgpack::type::STR) { throw msgpack::type_error(); }
kvmap.insert(
std::map<std::string, msgpack::object const*>::value_type(
std::string(
@@ -462,6 +467,7 @@ struct define_map<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11> {
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
std::map<std::string, msgpack::object const*> kvmap;
for (uint32_t i = 0; i < o.via.map.size; ++i) {
if (o.via.map.ptr[i].key.type != msgpack::type::STR) { throw msgpack::type_error(); }
kvmap.insert(
std::map<std::string, msgpack::object const*>::value_type(
std::string(
@@ -584,6 +590,7 @@ struct define_map<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13> {
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
std::map<std::string, msgpack::object const*> kvmap;
for (uint32_t i = 0; i < o.via.map.size; ++i) {
if (o.via.map.ptr[i].key.type != msgpack::type::STR) { throw msgpack::type_error(); }
kvmap.insert(
std::map<std::string, msgpack::object const*>::value_type(
std::string(
@@ -720,6 +727,7 @@ struct define_map<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A1
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
std::map<std::string, msgpack::object const*> kvmap;
for (uint32_t i = 0; i < o.via.map.size; ++i) {
if (o.via.map.ptr[i].key.type != msgpack::type::STR) { throw msgpack::type_error(); }
kvmap.insert(
std::map<std::string, msgpack::object const*>::value_type(
std::string(
@@ -870,6 +878,7 @@ struct define_map<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A1
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
std::map<std::string, msgpack::object const*> kvmap;
for (uint32_t i = 0; i < o.via.map.size; ++i) {
if (o.via.map.ptr[i].key.type != msgpack::type::STR) { throw msgpack::type_error(); }
kvmap.insert(
std::map<std::string, msgpack::object const*>::value_type(
std::string(
@@ -1034,6 +1043,7 @@ struct define_map<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A1
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
std::map<std::string, msgpack::object const*> kvmap;
for (uint32_t i = 0; i < o.via.map.size; ++i) {
if (o.via.map.ptr[i].key.type != msgpack::type::STR) { throw msgpack::type_error(); }
kvmap.insert(
std::map<std::string, msgpack::object const*>::value_type(
std::string(
@@ -1212,6 +1222,7 @@ struct define_map<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A1
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
std::map<std::string, msgpack::object const*> kvmap;
for (uint32_t i = 0; i < o.via.map.size; ++i) {
if (o.via.map.ptr[i].key.type != msgpack::type::STR) { throw msgpack::type_error(); }
kvmap.insert(
std::map<std::string, msgpack::object const*>::value_type(
std::string(
@@ -1404,6 +1415,7 @@ struct define_map<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A1
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
std::map<std::string, msgpack::object const*> kvmap;
for (uint32_t i = 0; i < o.via.map.size; ++i) {
if (o.via.map.ptr[i].key.type != msgpack::type::STR) { throw msgpack::type_error(); }
kvmap.insert(
std::map<std::string, msgpack::object const*>::value_type(
std::string(
@@ -1610,6 +1622,7 @@ struct define_map<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A1
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
std::map<std::string, msgpack::object const*> kvmap;
for (uint32_t i = 0; i < o.via.map.size; ++i) {
if (o.via.map.ptr[i].key.type != msgpack::type::STR) { throw msgpack::type_error(); }
kvmap.insert(
std::map<std::string, msgpack::object const*>::value_type(
std::string(
@@ -1830,6 +1843,7 @@ struct define_map<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A1
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
std::map<std::string, msgpack::object const*> kvmap;
for (uint32_t i = 0; i < o.via.map.size; ++i) {
if (o.via.map.ptr[i].key.type != msgpack::type::STR) { throw msgpack::type_error(); }
kvmap.insert(
std::map<std::string, msgpack::object const*>::value_type(
std::string(
@@ -2064,6 +2078,7 @@ struct define_map<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A1
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
std::map<std::string, msgpack::object const*> kvmap;
for (uint32_t i = 0; i < o.via.map.size; ++i) {
if (o.via.map.ptr[i].key.type != msgpack::type::STR) { throw msgpack::type_error(); }
kvmap.insert(
std::map<std::string, msgpack::object const*>::value_type(
std::string(
@@ -2312,6 +2327,7 @@ struct define_map<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A1
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
std::map<std::string, msgpack::object const*> kvmap;
for (uint32_t i = 0; i < o.via.map.size; ++i) {
if (o.via.map.ptr[i].key.type != msgpack::type::STR) { throw msgpack::type_error(); }
kvmap.insert(
std::map<std::string, msgpack::object const*>::value_type(
std::string(

View File

@@ -0,0 +1,45 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2017 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_V1_CPP11_CONVERT_HELPER_HPP
#define MSGPACK_V1_CPP11_CONVERT_HELPER_HPP
#include <tuple>
#include <msgpack/object_fwd.hpp>
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v1) {
/// @endcond
namespace type {
template <typename T>
inline typename std::enable_if<
has_as<T>::value
>::type
convert_helper(msgpack::object const& o, T& t) {
t = o.as<T>();
}
template <typename T>
inline typename std::enable_if<
!has_as<T>::value
>::type
convert_helper(msgpack::object const& o, T& t) {
o.convert(t);
}
} // namespace type
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v1)
/// @endcond
} // namespace msgpack
#endif // MSGPACK_V1_CPP11_CONVERT_HELPER_HPP

View File

@@ -11,6 +11,7 @@
#define MSGPACK_V1_CPP11_DEFINE_ARRAY_HPP
#include "msgpack/v1/adaptor/detail/cpp11_define_array_decl.hpp"
#include "msgpack/v1/adaptor/detail/cpp11_convert_helper.hpp"
#include <tuple>
@@ -31,7 +32,7 @@ struct define_array_imp {
define_array_imp<Tuple, N-1>::unpack(o, t);
const size_t size = o.via.array.size;
if(size <= N-1) { return; }
o.via.array.ptr[N-1].convert(std::get<N-1>(t));
convert_helper(o.via.array.ptr[N-1], std::get<N-1>(t));
}
static void object(msgpack::object* o, msgpack::zone& z, Tuple const& t) {
define_array_imp<Tuple, N-1>::object(o, z, t);
@@ -48,7 +49,7 @@ struct define_array_imp<Tuple, 1> {
static void unpack(msgpack::object const& o, Tuple& t) {
const size_t size = o.via.array.size;
if(size <= 0) { return; }
o.via.array.ptr[0].convert(std::get<0>(t));
convert_helper(o.via.array.ptr[0], std::get<0>(t));
}
static void object(msgpack::object* o, msgpack::zone& z, Tuple const& t) {
o->via.array.ptr[0] = msgpack::object(std::get<0>(t), z);

View File

@@ -11,6 +11,7 @@
#define MSGPACK_V1_CPP11_DEFINE_MAP_HPP
#include "msgpack/v1/adaptor/detail/cpp11_define_map_decl.hpp"
#include "msgpack/v1/adaptor/detail/cpp11_convert_helper.hpp"
#include <tuple>
#include <map>
@@ -34,7 +35,7 @@ struct define_map_imp {
define_map_imp<Tuple, N-2>::unpack(o, t, kvmap);
auto it = kvmap.find(std::get<N-2>(t));
if (it != kvmap.end()) {
it->second->convert(std::get<N-1>(t));
convert_helper(*it->second, std::get<N-1>(t));
}
}
static void object(msgpack::object* o, msgpack::zone& z, Tuple const& t) {
@@ -71,6 +72,7 @@ struct define_map {
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
std::map<std::string, msgpack::object const*> kvmap;
for (uint32_t i = 0; i < o.via.map.size; ++i) {
if (o.via.map.ptr[i].key.type != msgpack::type::STR) { throw msgpack::type_error(); }
kvmap.emplace(
std::string(
o.via.map.ptr[i].key.via.str.ptr,

View File

@@ -201,75 +201,91 @@ struct object<type::fix_int64> {
template <>
struct object<type::fix_uint8> {
void operator()(msgpack::object& o, type::fix_uint8 v) const
{ o.type = msgpack::type::POSITIVE_INTEGER, o.via.u64 = v.get(); }
void operator()(msgpack::object& o, type::fix_uint8 v) const {
o.type = msgpack::type::POSITIVE_INTEGER;
o.via.u64 = v.get();
}
};
template <>
struct object<type::fix_uint16> {
void operator()(msgpack::object& o, type::fix_uint16 v) const
{ o.type = msgpack::type::POSITIVE_INTEGER, o.via.u64 = v.get(); }
void operator()(msgpack::object& o, type::fix_uint16 v) const {
o.type = msgpack::type::POSITIVE_INTEGER;
o.via.u64 = v.get();
}
};
template <>
struct object<type::fix_uint32> {
void operator()(msgpack::object& o, type::fix_uint32 v) const
{ o.type = msgpack::type::POSITIVE_INTEGER, o.via.u64 = v.get(); }
void operator()(msgpack::object& o, type::fix_uint32 v) const {
o.type = msgpack::type::POSITIVE_INTEGER;
o.via.u64 = v.get();
}
};
template <>
struct object<type::fix_uint64> {
void operator()(msgpack::object& o, type::fix_uint64 v) const
{ o.type = msgpack::type::POSITIVE_INTEGER, o.via.u64 = v.get(); }
void operator()(msgpack::object& o, type::fix_uint64 v) const {
o.type = msgpack::type::POSITIVE_INTEGER;
o.via.u64 = v.get();
}
};
template <>
struct object_with_zone<type::fix_int8> {
void operator()(msgpack::object::with_zone& o, type::fix_int8 v) const
{ static_cast<msgpack::object&>(o) << v; }
void operator()(msgpack::object::with_zone& o, type::fix_int8 v) const {
static_cast<msgpack::object&>(o) << v;
}
};
template <>
struct object_with_zone<type::fix_int16> {
void operator()(msgpack::object::with_zone& o, type::fix_int16 v) const
{ static_cast<msgpack::object&>(o) << v; }
void operator()(msgpack::object::with_zone& o, type::fix_int16 v) const {
static_cast<msgpack::object&>(o) << v;
}
};
template <>
struct object_with_zone<type::fix_int32> {
void operator()(msgpack::object::with_zone& o, type::fix_int32 v) const
{ static_cast<msgpack::object&>(o) << v; }
void operator()(msgpack::object::with_zone& o, type::fix_int32 v) const {
static_cast<msgpack::object&>(o) << v;
}
};
template <>
struct object_with_zone<type::fix_int64> {
void operator()(msgpack::object::with_zone& o, type::fix_int64 v) const
{ static_cast<msgpack::object&>(o) << v; }
void operator()(msgpack::object::with_zone& o, type::fix_int64 v) const {
static_cast<msgpack::object&>(o) << v;
}
};
template <>
struct object_with_zone<type::fix_uint8> {
void operator()(msgpack::object::with_zone& o, type::fix_uint8 v) const
{ static_cast<msgpack::object&>(o) << v; }
void operator()(msgpack::object::with_zone& o, type::fix_uint8 v) const {
static_cast<msgpack::object&>(o) << v;
}
};
template <>
struct object_with_zone<type::fix_uint16> {
void operator()(msgpack::object::with_zone& o, type::fix_uint16 v) const
{ static_cast<msgpack::object&>(o) << v; }
void operator()(msgpack::object::with_zone& o, type::fix_uint16 v) const {
static_cast<msgpack::object&>(o) << v;
}
};
template <>
struct object_with_zone<type::fix_uint32> {
void operator()(msgpack::object::with_zone& o, type::fix_uint32 v) const
{ static_cast<msgpack::object&>(o) << v; }
void operator()(msgpack::object::with_zone& o, type::fix_uint32 v) const {
static_cast<msgpack::object&>(o) << v;
}
};
template <>
struct object_with_zone<type::fix_uint64> {
void operator()(msgpack::object::with_zone& o, type::fix_uint64 v) const
{ static_cast<msgpack::object&>(o) << v; }
void operator()(msgpack::object::with_zone& o, type::fix_uint64 v) const {
static_cast<msgpack::object&>(o) << v;
}
};
} // namespace adaptor

View File

@@ -82,7 +82,8 @@ struct object_char_sign<true> {
template <>
struct object_char_sign<false> {
static void make(msgpack::object& o, char v) {
o.type = msgpack::type::POSITIVE_INTEGER, o.via.u64 = v;
o.type = msgpack::type::POSITIVE_INTEGER;
o.via.u64 = v;
}
};
@@ -320,99 +321,120 @@ struct object<signed long long> {
template <>
struct object<unsigned char> {
void operator()(msgpack::object& o, unsigned char v) const
{ o.type = msgpack::type::POSITIVE_INTEGER, o.via.u64 = v; }
void operator()(msgpack::object& o, unsigned char v) const {
o.type = msgpack::type::POSITIVE_INTEGER;
o.via.u64 = v;
}
};
template <>
struct object<unsigned short> {
void operator()(msgpack::object& o, unsigned short v) const
{ o.type = msgpack::type::POSITIVE_INTEGER, o.via.u64 = v; }
void operator()(msgpack::object& o, unsigned short v) const {
o.type = msgpack::type::POSITIVE_INTEGER;
o.via.u64 = v;
}
};
template <>
struct object<unsigned int> {
void operator()(msgpack::object& o, unsigned int v) const
{ o.type = msgpack::type::POSITIVE_INTEGER, o.via.u64 = v; }
void operator()(msgpack::object& o, unsigned int v) const {
o.type = msgpack::type::POSITIVE_INTEGER;
o.via.u64 = v;
}
};
template <>
struct object<unsigned long> {
void operator()(msgpack::object& o, unsigned long v) const
{ o.type = msgpack::type::POSITIVE_INTEGER, o.via.u64 = v; }
void operator()(msgpack::object& o, unsigned long v) const {
o.type = msgpack::type::POSITIVE_INTEGER;
o.via.u64 = v;
}
};
template <>
struct object<unsigned long long> {
void operator()(msgpack::object& o, unsigned long long v) const
{ o.type = msgpack::type::POSITIVE_INTEGER, o.via.u64 = v; }
void operator()(msgpack::object& o, unsigned long long v) const {
o.type = msgpack::type::POSITIVE_INTEGER;
o.via.u64 = v;
}
};
template <>
struct object_with_zone<char> {
void operator()(msgpack::object::with_zone& o, char v) const
{ static_cast<msgpack::object&>(o) << v; }
void operator()(msgpack::object::with_zone& o, char v) const {
static_cast<msgpack::object&>(o) << v;
}
};
template <>
struct object_with_zone<signed char> {
void operator()(msgpack::object::with_zone& o, signed char v) const
{ static_cast<msgpack::object&>(o) << v; }
void operator()(msgpack::object::with_zone& o, signed char v) const {
static_cast<msgpack::object&>(o) << v;
}
};
template <>
struct object_with_zone<signed short> {
void operator()(msgpack::object::with_zone& o, signed short v) const
{ static_cast<msgpack::object&>(o) << v; }
void operator()(msgpack::object::with_zone& o, signed short v) const {
static_cast<msgpack::object&>(o) << v;
}
};
template <>
struct object_with_zone<signed int> {
void operator()(msgpack::object::with_zone& o, signed int v) const
{ static_cast<msgpack::object&>(o) << v; }
void operator()(msgpack::object::with_zone& o, signed int v) const {
static_cast<msgpack::object&>(o) << v;
}
};
template <>
struct object_with_zone<signed long> {
void operator()(msgpack::object::with_zone& o, signed long v) const
{ static_cast<msgpack::object&>(o) << v; }
void operator()(msgpack::object::with_zone& o, signed long v) const {
static_cast<msgpack::object&>(o) << v;
}
};
template <>
struct object_with_zone<signed long long> {
void operator()(msgpack::object::with_zone& o, const signed long long& v) const
{ static_cast<msgpack::object&>(o) << v; }
void operator()(msgpack::object::with_zone& o, const signed long long& v) const {
static_cast<msgpack::object&>(o) << v;
}
};
template <>
struct object_with_zone<unsigned char> {
void operator()(msgpack::object::with_zone& o, unsigned char v) const
{ static_cast<msgpack::object&>(o) << v; }
void operator()(msgpack::object::with_zone& o, unsigned char v) const {
static_cast<msgpack::object&>(o) << v;
}
};
template <>
struct object_with_zone<unsigned short> {
void operator()(msgpack::object::with_zone& o, unsigned short v) const
{ static_cast<msgpack::object&>(o) << v; }
void operator()(msgpack::object::with_zone& o, unsigned short v) const {
static_cast<msgpack::object&>(o) << v;
}
};
template <>
struct object_with_zone<unsigned int> {
void operator()(msgpack::object::with_zone& o, unsigned int v) const
{ static_cast<msgpack::object&>(o) << v; }
void operator()(msgpack::object::with_zone& o, unsigned int v) const {
static_cast<msgpack::object&>(o) << v;
}
};
template <>
struct object_with_zone<unsigned long> {
void operator()(msgpack::object::with_zone& o, unsigned long v) const
{ static_cast<msgpack::object&>(o) << v; }
void operator()(msgpack::object::with_zone& o, unsigned long v) const {
static_cast<msgpack::object&>(o) << v;
}
};
template <>
struct object_with_zone<unsigned long long> {
void operator()(msgpack::object::with_zone& o, const unsigned long long& v) const
{ static_cast<msgpack::object&>(o) << v; }
void operator()(msgpack::object::with_zone& o, const unsigned long long& v) const {
static_cast<msgpack::object&>(o) << v;
}
};
} // namespace adaptor

File diff suppressed because it is too large Load Diff

View File

@@ -83,6 +83,13 @@ bool operator!=(const T& y, const msgpack::object& x);
void operator<< (msgpack::object& o, const msgpack_object& v);
class object_parser;
template <typename Stream>
struct object_pack_visitor;
struct object_stringize_visitor;
// obsolete
template <typename T>
MSGPACK_DEPRECATED("please use member function version of object::convert(T&)")
@@ -104,7 +111,7 @@ msgpack::packer<Stream>& operator<< (msgpack::packer<Stream>& o, const msgpack::
template <typename Stream>
msgpack::packer<Stream>& operator<< (msgpack::packer<Stream>& o, const msgpack::object::with_zone& v);
std::ostream& operator<< (std::ostream& s, const msgpack::object& o);
std::ostream& operator<< (std::ostream& s, const msgpack::object& v);
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v1)

View File

@@ -59,7 +59,7 @@ private:
decltype(adaptor::as<U>()(std::declval<msgpack::object>())),
T
>::type;
template <typename>
template <typename...>
static std::false_type check(...);
public:
using type = decltype(check<T>(MSGPACK_NULLPTR));

View File

@@ -848,7 +848,6 @@ class unpacker {
public:
/// Constructor
/**
* @param referenced If the unpacked object contains reference of the buffer, then set as true, otherwise false.
* @param f A judging function that msgpack::object refer to the buffer.
* @param user_data This parameter is passed to f.
* @param initial_buffer_size The memory size to allocate when unpacker is constructed.

View File

@@ -12,6 +12,7 @@
#include "msgpack/unpack_decl.hpp"
#include "msgpack/unpack_exception.hpp"
#include "msgpack/v2/create_object_visitor_decl.hpp"
#include "msgpack/v2/null_visitor.hpp"
namespace msgpack {

View File

@@ -0,0 +1,33 @@
//
// MessagePack for C++ deserializing routine
//
// Copyright (C) 2017 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_V2_CREATE_OBJECT_VISITOR_DECL_HPP
#define MSGPACK_V2_CREATE_OBJECT_VISITOR_DECL_HPP
#include "msgpack/versioning.hpp"
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v2) {
/// @endcond
namespace detail {
class create_object_visitor;
} // detail
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v2)
/// @endcond
} // namespace msgpack
#endif // MSGPACK_V2_CREATE_OBJECT_VISITOR_DECL_HPP

View File

@@ -10,8 +10,7 @@
#ifndef MSGPACK_V2_NULL_VISITOR_HPP
#define MSGPACK_V2_NULL_VISITOR_HPP
#include "msgpack/versioning.hpp"
#include "msgpack/cpp_config.hpp"
#include "msgpack/v2/null_visitor_decl.hpp"
namespace msgpack {

View File

@@ -0,0 +1,29 @@
//
// MessagePack for C++ deserializing routine
//
// Copyright (C) 2018 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_V2_NULL_VISITOR_DECL_HPP
#define MSGPACK_V2_NULL_VISITOR_DECL_HPP
#include "msgpack/versioning.hpp"
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v2) {
/// @endcond
struct null_visitor;
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v2)
/// @endcond
} // namespace msgpack
#endif // MSGPACK_V2_NULL_VISITOR_DECL_HPP

View File

@@ -37,6 +37,10 @@ using v1::detail::packer_serializer;
} // namespace detail
using v1::object_parser;
using v1::object_pack_visitor;
using v1::object_stringize_visitor;
using v1::operator==;
using v1::operator!=;

View File

@@ -91,7 +91,7 @@ private:
v1::has_as<U>::value,
std::true_type
>::type;
template <typename>
template <typename...>
static std::false_type check(...);
public:
using type = decltype(check<T>(MSGPACK_NULLPTR));

View File

@@ -22,6 +22,7 @@ using v1::packer;
using v1::pack;
#if MSGPACK_ENDIAN_LITTLE_BYTE
using v1::take8_8;

View File

@@ -10,8 +10,14 @@
#ifndef MSGPACK_V2_PARSE_HPP
#define MSGPACK_V2_PARSE_HPP
#if MSGPACK_DEFAULT_API_VERSION >= 2
#include <cstddef>
#include "msgpack/unpack_define.h"
#include "msgpack/parse_return.hpp"
#include "msgpack/unpack_exception.hpp"
#include "msgpack/unpack_decl.hpp"
#include "msgpack/v2/create_object_visitor.hpp"
namespace msgpack {
@@ -21,6 +27,10 @@ MSGPACK_API_VERSION_NAMESPACE(v2) {
namespace detail {
using v1::detail::fix_tag;
using v1::detail::value;
using v1::detail::load;
template <typename VisitorHolder>
class context {
public:
@@ -621,11 +631,11 @@ class parser : public detail::context<VisitorHolder> {
public:
/// Constructor
/**
* @param referenced If the unpacked object contains reference of the buffer, then set as true, otherwise false.
* @param f A judging function that msgpack::object refer to the buffer.
* @param user_data This parameter is passed to f.
* @param hook The handler that is called when buffer is allocated internally.
* `hook` should be callable with char* parameter.
* `parser` gives a chance to prepare finalizer.
* See https://github.com/msgpack/msgpack-c/wiki/v2_0_cpp_visitor#parse-api
* @param initial_buffer_size The memory size to allocate when unpacker is constructed.
* @param limit The size limit information of msgpack::object.
*
*/
parser(ReferencedBufferHook& hook,
@@ -998,23 +1008,23 @@ inline void parser<VisitorHolder, ReferencedBufferHook>::remove_nonparsed_buffer
template <typename Visitor>
inline bool parse(const char* data, size_t len, size_t& off, Visitor& v) {
parse_return ret = detail::parse_imp(data, len, off, v);
parse_return ret = msgpack::detail::parse_imp(data, len, off, v);
return ret == PARSE_SUCCESS || ret == PARSE_EXTRA_BYTES;
}
template <typename Visitor>
inline bool parse(const char* data, size_t len, Visitor& v) {
std::size_t off = 0;
return parse(data, len, off, v);
return msgpack::parse(data, len, off, v);
}
namespace detail {
template <typename Visitor>
struct parse_helper : context<parse_helper<Visitor> > {
struct parse_helper : detail::context<parse_helper<Visitor> > {
parse_helper(Visitor& v):m_visitor(v) {}
parse_return execute(const char* data, std::size_t len, std::size_t& off) {
return context<parse_helper<Visitor> >::execute(data, len, off);
return detail::context<parse_helper<Visitor> >::execute(data, len, off);
}
Visitor& visitor() const { return m_visitor; }
Visitor& m_visitor;
@@ -1057,5 +1067,6 @@ parse_imp(const char* data, size_t len, size_t& off, Visitor& v) {
} // namespace msgpack
#endif // MSGPACK_DEFAULT_API_VERSION >= 2
#endif // MSGPACK_V2_PARSE_HPP

View File

@@ -0,0 +1,79 @@
//
// MessagePack for C++ deserializing routine
//
// Copyright (C) 2018 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_V2_PARSE_DECL_HPP
#define MSGPACK_V2_PARSE_DECL_HPP
#include "msgpack/parse_return.hpp"
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v2) {
/// @endcond
namespace detail {
template <typename VisitorHolder>
class context;
} // detail
/// Parsing class for a stream deserialization.
template <typename VisitorHolder, typename ReferencedBufferHook>
class parser;
/// Unpack msgpack formatted data via a visitor
/**
* @param data The pointer to the buffer.
* @param len The length of the buffer.
* @param off The offset position of the buffer. It is read and overwritten.
* @param v The visitor that satisfies visitor concept. https://github.com/msgpack/msgpack-c/wiki/v2_0_cpp_visitor#visitor-concept
*
* @return if unpacking process finishs without error then return true, otherwise return false.
*
*/
template <typename Visitor>
bool parse(const char* data, size_t len, size_t& off, Visitor& v);
/// Unpack msgpack formatted data via a visitor
/**
* @param data The pointer to the buffer.
* @param len The length of the buffer.
* @param v The visitor that satisfies visitor concept. https://github.com/msgpack/msgpack-c/wiki/v2_0_cpp_visitor#visitor-concept
*
* @return if unpacking process finishs without error then return true, otherwise return false.
*
*/
template <typename Visitor>
bool parse(const char* data, size_t len, Visitor& v);
namespace detail {
template <typename Visitor>
struct parse_helper;
template <typename Visitor>
inline parse_return
parse_imp(const char* data, size_t len, size_t& off, Visitor& v);
} // detail
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v2)
/// @endcond
} // namespace msgpack
#endif // MSGPACK_V2_PARSE_DECL_HPP

View File

@@ -10,9 +10,11 @@
#ifndef MSGPACK_V2_UNPACK_HPP
#define MSGPACK_V2_UNPACK_HPP
#if MSGPACK_DEFAULT_API_VERSION >= 2
#include "msgpack/unpack_decl.hpp"
#include "msgpack/v2/create_object_visitor.hpp"
#include "msgpack/v2/parse.hpp"
#include "msgpack/parse.hpp"
#include "msgpack/create_object_visitor.hpp"
namespace msgpack {
@@ -229,7 +231,7 @@ inline void unpack(
inline void unpack(
msgpack::object_handle& result,
const char* data, std::size_t len, std::size_t& off,
msgpack::v2::unpack_reference_func f, void* user_data,
unpack_reference_func f, void* user_data,
unpack_limit const& limit)
{
bool referenced;
@@ -341,5 +343,6 @@ unpack_imp(const char* data, std::size_t len, std::size_t& off,
} // namespace msgpack
#endif // MSGPACK_DEFAULT_API_VERSION >= 2
#endif // MSGPACK_V2_UNPACK_HPP

View File

@@ -100,7 +100,7 @@ class basic_unpacker;
* @return object_handle that contains unpacked data.
*
*/
object_handle unpack(
msgpack::object_handle unpack(
const char* data, std::size_t len, std::size_t& off, bool& referenced,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR, unpack_limit const& limit = unpack_limit());
@@ -116,7 +116,7 @@ object_handle unpack(
* @return object_handle that contains unpacked data.
*
*/
object_handle unpack(
msgpack::object_handle unpack(
const char* data, std::size_t len, std::size_t& off,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR, unpack_limit const& limit = unpack_limit());
@@ -132,7 +132,7 @@ object_handle unpack(
* @return object_handle that contains unpacked data.
*
*/
object_handle unpack(
msgpack::object_handle unpack(
const char* data, std::size_t len, bool& referenced,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR, unpack_limit const& limit = unpack_limit());
@@ -147,7 +147,7 @@ object_handle unpack(
* @return object_handle that contains unpacked data.
*
*/
object_handle unpack(
msgpack::object_handle unpack(
const char* data, std::size_t len,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR, unpack_limit const& limit = unpack_limit());
@@ -166,7 +166,7 @@ object_handle unpack(
*
*/
void unpack(
object_handle& result,
msgpack::object_handle& result,
const char* data, std::size_t len, std::size_t& off, bool& referenced,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR, unpack_limit const& limit = unpack_limit());
@@ -183,7 +183,7 @@ void unpack(
*
*/
void unpack(
object_handle& result,
msgpack::object_handle& result,
const char* data, std::size_t len, std::size_t& off,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR, unpack_limit const& limit = unpack_limit());
@@ -200,7 +200,7 @@ void unpack(
*
*/
void unpack(
object_handle& result,
msgpack::object_handle& result,
const char* data, std::size_t len, bool& referenced,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR, unpack_limit const& limit = unpack_limit());
@@ -216,7 +216,7 @@ void unpack(
*
*/
void unpack(
object_handle& result,
msgpack::object_handle& result,
const char* data, std::size_t len,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR, unpack_limit const& limit = unpack_limit());
@@ -292,31 +292,6 @@ msgpack::object unpack(
const char* data, std::size_t len,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR, unpack_limit const& limit = unpack_limit());
/// Unpack msgpack formatted data via a visitor
/**
* @param data The pointer to the buffer.
* @param len The length of the buffer.
* @param off The offset position of the buffer. It is read and overwritten.
* @param v The visitor that satisfies visitor concept. https://github.com/msgpack/msgpack-c/wiki/v2_0_cpp_visitor#visitor-concept
*
* @return if unpacking process finishs without error then return true, otherwise return false.
*
*/
template <typename Visitor>
bool parse(const char* data, size_t len, size_t& off, Visitor& v);
/// Unpack msgpack formatted data via a visitor
/**
* @param data The pointer to the buffer.
* @param len The length of the buffer.
* @param v The visitor that satisfies visitor concept. https://github.com/msgpack/msgpack-c/wiki/v2_0_cpp_visitor#visitor-concept
*
* @return if unpacking process finishs without error then return true, otherwise return false.
*
*/
template <typename Visitor>
bool parse(const char* data, size_t len, Visitor& v);
namespace detail {
parse_return
@@ -325,9 +300,6 @@ unpack_imp(const char* data, std::size_t len, std::size_t& off,
unpack_reference_func f, void* user_data,
unpack_limit const& limit);
template <typename UnpackVisitor>
parse_return
parse_imp(const char* data, size_t len, size_t& off, UnpackVisitor& v);
} // detail

View File

@@ -17,6 +17,7 @@
#if BOOST_VERSION >= 106100
#include "msgpack/versioning.hpp"
#include "msgpack/x3_parse_decl.hpp"
#if __GNUC__ >= 4
#pragma GCC diagnostic push

View File

@@ -0,0 +1,36 @@
//
// MessagePack for C++ deserializing routine
//
// Copyright (C) 2017 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_V2_X3_PARSE_DECL_HPP
#define MSGPACK_V2_X3_PARSE_DECL_HPP
#if defined(MSGPACK_USE_X3_PARSE)
#include "msgpack/versioning.hpp"
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v2) {
/// @endcond
template <typename Iterator, typename Visitor>
bool parse(Iterator&& begin, Iterator&& end, Visitor&& vis);
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v2)
/// @endcond
} // namespace msgpack
#endif // defined(MSGPACK_USE_X3_PARSE)
#endif // MSGPACK_V2_X3_PARSE_DECL_HPP

View File

@@ -17,8 +17,9 @@
#if BOOST_VERSION >= 106100
#include "msgpack/versioning.hpp"
#include "msgpack/v2/create_object_visitor.hpp"
#include "msgpack/v2/x3_parse.hpp"
#include "msgpack/create_object_visitor.hpp"
#include "msgpack/x3_unpack_decl.hpp"
#include "msgpack/x3_parse.hpp"
namespace msgpack {
@@ -32,8 +33,8 @@ template <typename Iterator>
inline void
unpack_imp(Iterator&& begin, Iterator&& end,
msgpack::zone& result_zone, msgpack::object& result, bool& referenced,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR,
unpack_limit const& limit = unpack_limit())
unpack_reference_func f, void* user_data,
unpack_limit const& limit)
{
create_object_visitor v(f, user_data, limit);
v.set_zone(result_zone);
@@ -53,8 +54,8 @@ template <typename Iterator>
inline msgpack::object_handle unpack(
Iterator&& begin, Iterator&& end,
bool& referenced,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR,
unpack_limit const& limit = unpack_limit())
unpack_reference_func f, void* user_data,
unpack_limit const& limit)
{
msgpack::object obj;
msgpack::unique_ptr<msgpack::zone> z(new msgpack::zone);
@@ -67,8 +68,8 @@ inline msgpack::object_handle unpack(
template <typename Iterator>
inline msgpack::object_handle unpack(
Iterator&& begin, Iterator&& end,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR,
unpack_limit const& limit = unpack_limit())
unpack_reference_func f, void* user_data,
unpack_limit const& limit)
{
bool referenced;
return unpack(std::forward<Iterator>(begin), std::forward<Iterator>(end), referenced, f, user_data, limit);
@@ -79,8 +80,8 @@ inline msgpack::object unpack(
msgpack::zone& z,
Iterator&& begin, Iterator&& end,
bool& referenced,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR,
unpack_limit const& limit = unpack_limit())
unpack_reference_func f, void* user_data,
unpack_limit const& limit)
{
msgpack::object obj;
referenced = false;
@@ -93,8 +94,8 @@ template <typename Iterator>
inline msgpack::object unpack(
msgpack::zone& z,
Iterator&& begin, Iterator&& end,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR,
unpack_limit const& limit = unpack_limit())
unpack_reference_func f, void* user_data,
unpack_limit const& limit)
{
bool referenced;
return unpack(

View File

@@ -0,0 +1,71 @@
//
// MessagePack for C++ deserializing routine
//
// Copyright (C) 2018 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_V2_X3_UNPACK_DECL_HPP
#define MSGPACK_V2_X3_UNPACK_DECL_HPP
#if defined(MSGPACK_USE_X3_PARSE)
#include "msgpack/versioning.hpp"
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v2) {
/// @endcond
namespace detail {
template <typename Iterator>
void
unpack_imp(Iterator&& begin, Iterator&& end,
msgpack::zone& result_zone, msgpack::object& result, bool& referenced,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR,
unpack_limit const& limit = unpack_limit());
} // namespace detail
template <typename Iterator>
msgpack::object_handle unpack(
Iterator&& begin, Iterator&& end,
bool& referenced,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR,
unpack_limit const& limit = unpack_limit());
template <typename Iterator>
msgpack::object_handle unpack(
Iterator&& begin, Iterator&& end,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR,
unpack_limit const& limit = unpack_limit());
template <typename Iterator>
msgpack::object unpack(
msgpack::zone& z,
Iterator&& begin, Iterator&& end,
bool& referenced,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR,
unpack_limit const& limit = unpack_limit());
template <typename Iterator>
msgpack::object unpack(
msgpack::zone& z,
Iterator&& begin, Iterator&& end,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR,
unpack_limit const& limit = unpack_limit());
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v2)
/// @endcond
} // namespace msgpack
#endif // defined(MSGPACK_USE_X3_PARSE)
#endif // MSGPACK_V2_X3_UNPACK_DECL_HPP

View File

@@ -0,0 +1,58 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2015-2016 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_V3_ADAPTOR_BASE_HPP
#define MSGPACK_V3_ADAPTOR_BASE_HPP
#include "msgpack/v3/adaptor/adaptor_base_decl.hpp"
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v3) {
/// @endcond
namespace adaptor {
// Adaptor functors
template <typename T, typename Enabler>
struct convert : v2::adaptor::convert<T, Enabler> {
};
template <typename T, typename Enabler>
struct pack : v2::adaptor::pack<T, Enabler> {
};
template <typename T, typename Enabler>
struct object<
T,
Enabler,
typename msgpack::enable_if<
!msgpack::is_same<T, std::string>::value &&
!msgpack::is_array<T>::value
>::type>
: v2::adaptor::object<T, Enabler> {
};
template <typename T, typename Enabler>
struct object_with_zone : v2::adaptor::object_with_zone<T, Enabler> {
};
} // namespace adaptor
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v3)
/// @endcond
} // namespace msgpack
#endif // MSGPACK_V3_ADAPTOR_BASE_HPP

View File

@@ -0,0 +1,52 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 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_V3_ADAPTOR_BASE_DECL_HPP
#define MSGPACK_V3_ADAPTOR_BASE_DECL_HPP
#include "msgpack/v2/adaptor/adaptor_base_decl.hpp"
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v3) {
/// @endcond
using v2::packer;
namespace adaptor {
// Adaptor functors
template <typename T, typename Enabler = void>
struct convert;
template <typename T, typename Enabler = void>
struct pack;
template <typename T, typename Enabler = void, typename Enabler2 = void>
struct object;
template <typename T, typename Enabler = void>
struct object_with_zone;
} // namespace adaptor
// operators
using v2::operator>>;
using v2::operator<<;
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v3)
/// @endcond
} // namespace msgpack
#endif // MSGPACK_V3_ADAPTOR_BASE_DECL_HPP

View File

@@ -0,0 +1,36 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 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_V3_TYPE_ARRAY_REF_DECL_HPP
#define MSGPACK_V3_TYPE_ARRAY_REF_DECL_HPP
#include "msgpack/v2/adaptor/array_ref_decl.hpp"
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v3) {
/// @endcond
namespace type {
using v2::type::array_ref;
using v2::type::make_array_ref;
} // namespace type
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v3)
/// @endcond
} // namespace msgpack
#endif // MSGPACK_V3_TYPE_ARRAY_REF_DECL_HPP

View File

@@ -0,0 +1,42 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 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_V3_TYPE_BOOST_MSGPACK_VARIANT_DECL_HPP
#define MSGPACK_V3_TYPE_BOOST_MSGPACK_VARIANT_DECL_HPP
#if defined(MSGPACK_USE_BOOST)
#include "msgpack/v2/adaptor/boost/msgpack_variant_decl.hpp"
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v3) {
/// @endcond
namespace type {
using v2::type::basic_variant;
using v2::type::variant;
using v2::type::variant_ref;
using v2::type::operator<;
using v2::type::operator==;
} // namespace type
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v3)
/// @endcond
} // namespace msgpack
#endif // MSGPACK_USE_BOOST
#endif // MSGPACK_V3_TYPE_BOOST_MSGPACK_VARIANT_DECL_HPP

View File

@@ -0,0 +1,39 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 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_V3_CHECK_CONTAINER_SIZE_DECL_HPP
#define MSGPACK_V3_CHECK_CONTAINER_SIZE_DECL_HPP
#include "msgpack/v2/adaptor/check_container_size_decl.hpp"
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v3) {
/// @endcond
using v2::container_size_overflow;
namespace detail {
using v2::detail::check_container_size;
using v2::detail::check_container_size_for_ext;
} // namespace detail
using v2::checked_get_container_size;
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v3)
/// @endcond
} // namespace msgpack
#endif // MSGPACK_V3_CHECK_CONTAINER_SIZE_DECL_HPP

View File

@@ -0,0 +1,23 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 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_V3_DEFINE_DECL_HPP
#define MSGPACK_V3_DEFINE_DECL_HPP
#include "msgpack/cpp_config.hpp"
#if defined(MSGPACK_USE_CPP03)
#include "msgpack/v3/adaptor/detail/cpp03_define_array_decl.hpp"
#include "msgpack/v3/adaptor/detail/cpp03_define_map_decl.hpp"
#else // MSGPACK_USE_CPP03
#include "msgpack/v3/adaptor/detail/cpp11_define_array_decl.hpp"
#include "msgpack/v3/adaptor/detail/cpp11_define_map_decl.hpp"
#endif // MSGPACK_USE_CPP03
#endif // MSGPACK_V3_DEFINE_DECL_HPP

View File

@@ -0,0 +1,31 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and 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_V3_CPP03_DEFINE_ARRAY_DECL_HPP
#define MSGPACK_V3_CPP03_DEFINE_ARRAY_DECL_HPP
#include "msgpack/v2/adaptor/detail/cpp03_define_array_decl.hpp"
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v3) {
/// @endcond
namespace type {
using v2::type::define_array;
using v2::type::make_define_array;
} // namespace type
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v3)
/// @endcond
} // namespace msgpack
#endif // MSGPACK_V3_CPP03_DEFINE_ARRAY_DECL_HPP

View File

@@ -0,0 +1,31 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2015-2016 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_V3_CPP03_DEFINE_MAP_DECL_HPP
#define MSGPACK_V3_CPP03_DEFINE_MAP_DECL_HPP
#include "msgpack/v2/adaptor/detail/cpp03_define_map_decl.hpp"
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v3) {
/// @endcond
namespace type {
using v2::type::define_map;
using v2::type::make_define_map;
} // namespace type
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v3)
/// @endcond
} // namespace msgpack
#endif // MSGPACK_V3_CPP03_DEFINE_MAP_DECL_HPP

View File

@@ -0,0 +1,43 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 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_V3_CPP03_MSGPACK_TUPLE_DECL_HPP
#define MSGPACK_V3_CPP03_MSGPACK_TUPLE_DECL_HPP
#include "msgpack/v2/adaptor/detail/cpp03_msgpack_tuple_decl.hpp"
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v3) {
/// @endcond
namespace type {
using v2::type::tuple;
using v2::type::tuple_element;
using v2::type::const_tuple_element;
using v2::type::tuple_type;
using v2::type::get;
using v2::type::make_tuple;
} // namespace type
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v3)
/// @endcond
} // namespace msgpack
#endif // MSGPACK_V3_CPP03_MSGPACK_TUPLE_DECL_HPP

View File

@@ -0,0 +1,32 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and 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_V3_CPP11_DEFINE_ARRAY_DECL_HPP
#define MSGPACK_V3_CPP11_DEFINE_ARRAY_DECL_HPP
#include "msgpack/v2/adaptor/detail/cpp11_define_array_decl.hpp"
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v3) {
/// @endcond
namespace type {
using v2::type::define_array_imp;
using v2::type::define_array;
using v2::type::make_define_array;
} // namespace type
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v3)
/// @endcond
} // namespace msgpack
#endif // MSGPACK_V3_CPP11_DEFINE_ARRAY_DECL_HPP

View File

@@ -0,0 +1,31 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 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_V3_CPP11_DEFINE_MAP_DECL_HPP
#define MSGPACK_V3_CPP11_DEFINE_MAP_DECL_HPP
#include "msgpack/v2/adaptor/detail/cpp11_define_map_decl.hpp"
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v3) {
/// @endcond
namespace type {
using v2::type::define_map_imp;
using v2::type::define_map;
using v2::type::make_define_map;
} // namespace type
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v3)
/// @endcond
} // namespace msgpack
#endif // MSGPACK_V3_CPP11_DEFINE_MAP_DECL_HPP

View File

@@ -0,0 +1,59 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 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_V3_CPP11_MSGPACK_TUPLE_DECL_HPP
#define MSGPACK_V3_CPP11_MSGPACK_TUPLE_DECL_HPP
#include "msgpack/v2/adaptor/detail/cpp11_msgpack_tuple_decl.hpp"
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v3) {
/// @endcond
namespace type {
using v2::type::get;
using v2::type::tuple_size;
using v2::type::tuple_element;
using v2::type::uses_allocator;
using v2::type::ignore;
using v2::type::swap;
using v2::type::tuple;
using v2::type::make_tuple;
using v2::type::forward_as_tuple;
using v2::type::tuple_cat;
using v2::type::tie;
} // namespace type
// --- Pack from tuple to packer stream ---
using v2::MsgpackTuplePacker;
// --- Convert from tuple to object ---
using v2::MsgpackTupleAs;
using v2::MsgpackTupleAsImpl;
using v2::MsgpackTupleConverter;
// --- Convert from tuple to object with zone ---
using v2::MsgpackTupleToObjectWithZone;
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v3)
///@endcond
} // namespace msgpack
#endif // MSGPACK_V3_CPP11_MSGPACK_TUPLE_DECL_HPP

View File

@@ -0,0 +1,34 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 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_V3_TYPE_EXT_DECL_HPP
#define MSGPACK_V3_TYPE_EXT_DECL_HPP
#include "msgpack/v2/adaptor/ext_decl.hpp"
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v3) {
/// @endcond
namespace type {
using v2::type::ext_ref;
using v2::type::ext;
} // namespace type
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v3)
/// @endcond
} // namespace msgpack
#endif // MSGPACK_V3_TYPE_EXT_DECL_HPP

View File

@@ -0,0 +1,43 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 FURUHASHI Sadayuki and 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_V3_TYPE_FIXINT_DECL_HPP
#define MSGPACK_V3_TYPE_FIXINT_DECL_HPP
#include "msgpack/v2/adaptor/fixint_decl.hpp"
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v3) {
/// @endcond
namespace type {
using v2::type::fix_int;
using v2::type::fix_uint8;
using v2::type::fix_uint16;
using v2::type::fix_uint32;
using v2::type::fix_uint64;
using v2::type::fix_int8;
using v2::type::fix_int16;
using v2::type::fix_int32;
using v2::type::fix_int64;
} // namespace type
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v3)
/// @endcond
} // namespace msgpack
#endif // MSGPACK_V3_TYPE_FIXINT_DECL_HPP

View File

@@ -0,0 +1,54 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 FURUHASHI Sadayuki and 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_V3_TYPE_INT_DECL_HPP
#define MSGPACK_V3_TYPE_INT_DECL_HPP
#include "msgpack/v2/adaptor/int_decl.hpp"
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v3){
/// @endcond
namespace type {
namespace detail {
template <typename T, bool Signed>
struct convert_integer_sign;
template <typename T>
struct is_signed;
template <bool Signed>
struct object_char_sign;
//using v2::type::detail::convert_integer_sign;
//using v2::type::detail::is_signed;
using v2::type::detail::convert_integer;
//using v2::type::detail::object_char_sign;
using v2::type::detail::object_char;
} // namespace detail
} // namespace type
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v3)
/// @endcond
} // namespace msgpack
#endif // MSGPACK_V3_TYPE_INT_DECL_HPP

View File

@@ -0,0 +1,33 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 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_V3_TYPE_MAP_DECL_HPP
#define MSGPACK_V3_TYPE_MAP_DECL_HPP
#include "msgpack/v2/adaptor/map_decl.hpp"
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v3) {
/// @endcond
namespace type {
using v2::type::assoc_vector;
} //namespace type
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v3)
/// @endcond
} // namespace msgpack
#endif // MSGPACK_V3_TYPE_MAP_DECL_HPP

View File

@@ -0,0 +1,21 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and 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_V3_MSGPACK_TUPLE_DECL_HPP
#define MSGPACK_V3_MSGPACK_TUPLE_DECL_HPP
#include "msgpack/cpp_config.hpp"
#if defined(MSGPACK_USE_CPP03)
#include "msgpack/v3/adaptor/detail/cpp03_msgpack_tuple_decl.hpp"
#else // MSGPACK_USE_CPP03
#include "msgpack/v3/adaptor/detail/cpp11_msgpack_tuple_decl.hpp"
#endif // MSGPACK_USE_CPP03
#endif // MSGPACK_V3_MSGPACK_TUPLE_DECL_HPP

View File

@@ -0,0 +1,42 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2016 FURUHASHI Sadayuki and 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_V3_TYPE_NIL_DECL_HPP
#define MSGPACK_V3_TYPE_NIL_DECL_HPP
#include "msgpack/v2/adaptor/nil_decl.hpp"
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v3) {
/// @endcond
namespace type {
using v2::type::nil_t;
#if defined(MSGPACK_USE_LEGACY_NIL)
typedef nil_t nil;
#endif // defined(MSGPACK_USE_LEGACY_NIL)
using v2::type::operator<;
using v2::type::operator==;
} // namespace type
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v3)
/// @endcond
} // namespace msgpack
#endif // MSGPACK_V3_TYPE_NIL_DECL_HPP

View File

@@ -0,0 +1,33 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2016 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_V3_TYPE_RAW_DECL_HPP
#define MSGPACK_V3_TYPE_RAW_DECL_HPP
#include "msgpack/v2/adaptor/raw_decl.hpp"
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v3) {
/// @endcond
namespace type {
using v2::type::raw_ref;
} // namespace type
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v3)
/// @endcond
} // namespace msgpack
#endif // MSGPACK_V3_TYPE_RAW_DECL_HPP

Some files were not shown because too many files have changed in this diff Show More