361 Commits

Author SHA1 Message Date
Marc Bodmer
8d09b7090d Removed MSGPACK_ENABLE_GCC_CXX_ATOMIC macro since this does not exist in user code and this code would not be active then. 2016-10-11 10:33:08 +02:00
Marc Bodmer
e7eae65ab7 Fixed path of gcc_atomic.h and gcc_atomic.hpp in definition of _msgpack_atomic_counter_header 2016-10-10 10:42:08 +02:00
Marc Bodmer
4e663609ca Fixed name of define as evaluated in CMakeLists.txt 2016-10-10 10:40:45 +02:00
Takatoshi Kondo
87ff7e4ccc Merge pull request #515 from edsiper/unpacker_size
unpack: new msgpack_unpacker_next_with_size() function
2016-09-11 19:32:48 +09:00
Takatoshi Kondo
c1f19c0e47 Merge pull request #504 from redboltz/fix_503
Fixed #503.
2016-09-06 23:00:17 +09:00
Eduardo Silva
d9a77e220a unpack: new msgpack_unpacker_next_with_size() function
This new function is an extension of the original msgpack_unpacker_next()
where it now adds third argument to store the number of parsed bytes for
the returned buffer upon a MSGPACK_UNPACK_SUCCESS case.

This is useful for cases where the caller needs to optimize memory usage
in the original buffer,s so upon success retrieval of the object, it can
later deprecate the already 'parsed' bytes.

For more details about the origins of this function please refer to the
following issue on github:

  https://github.com/msgpack/msgpack-c/issues/514

Signed-off-by: Eduardo Silva <eduardo@treasure-data.com>
2016-08-31 16:49:14 -06:00
Takatoshi Kondo
3a87cc8826 Merge branch 'VariadicC11Fix' of https://github.com/pkrenz/msgpack-c-1 into pkrenz-VariadicC11Fix 2016-08-30 00:04:09 +09:00
Takatoshi Kondo
5d69c22bf9 Use OR instead of AND for all classes that have multiple types.
Revert example. Combination of has_as and not has_as are move to tests.
2016-08-29 22:12:01 +09:00
Philipp
a9caff538e Fix warning in versioning 2016-08-26 16:56:01 +02:00
Martin C Drohmann
7191a3b014 enable as<map<...> > implementation when the key OR the value have as() 2016-08-23 15:03:14 -07:00
Takatoshi Kondo
b9bc9d4195 Replaced uint32_t with size_t.
User buffer size is not limited by msgpack-c so size_t is the
appropriate type.
2016-07-16 09:32:19 +09:00
Takatoshi Kondo
aa790ba785 Merge branch 'master' of https://github.com/smititelu/msgpack-c into smititelu-master 2016-07-16 09:20:39 +09:00
Takatoshi Kondo
d7a656523b Fixed #503.
Fixed fwrite return value comparison.
2016-07-11 19:34:10 +09:00
Stefan Mititelu
4fa661a63d Add msgpack_object_print_buffer() function
In order to print the msgpack object in a memory buffer.
2016-07-07 22:43:48 +03:00
Takatoshi Kondo
2e4de8b65c Fixed #498.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38764
2016-07-06 21:52:08 +09:00
Takatoshi Kondo
3c997edd71 Merge pull request #489 from redboltz/fix_390
Fix 390
2016-06-21 21:07:29 +09:00
Takatoshi Kondo
523e986077 Added size_equal_only support for C++03 msgpack::type::tuple. 2016-06-20 18:39:04 +09:00
Takatoshi Kondo
4ffdc01135 Added converting support for different size tuples. 2016-06-20 17:12:53 +09:00
Takatoshi Kondo
1b87018a0a Fixed #390.
Added size_equal_only class template to check converted container size
strictly.
Relaxed std::array size checking by default.
Fixed std::tuple and msgpack::type::tuple size checking problem.
2016-06-20 15:32:24 +09:00
Takatoshi Kondo
755342bb25 Improved C-Style array support.
In the case the target type is char[] or const char[],

If the array is '\0' teminated, msgpack-c packs the characters before
'\0', otherwise packs all characters.

When converting, the array has the size that is greater than
msgpack::object STR's size, msgpack-c adds '\0' to just after converted
characters. Otherwise msgpack-c doesn't add '\0'.
2016-06-19 20:47:42 +09:00
Takatoshi Kondo
0f66e144ab Support MSVC cli.
MSVC CLI defined their own nullptr and provides for __nullptr for standard C++11.
https://msdn.microsoft.com/en-us/library/4ex65770.aspx
msgpack-c introduce MSGPACK_NULLPTR for internal use, it is defined as __nullptr only if compiled on C++ CLI otherwise defined as nullptr.
2016-06-08 18:03:51 +09:00
Takatoshi Kondo
89faf6ee9f Updated boost predef and preprocessor from 1.58.0 to 1.61.0 2016-05-30 13:20:58 +09:00
Takatoshi Kondo
b68c073d1b Moved gcc_atomic.hpp location. 2016-05-30 09:55:16 +09:00
Takatoshi Kondo
22613d4dd0 Merge pull request #464 from redboltz/fix_463
Fixed #463.
2016-05-24 08:22:50 +09:00
Takatoshi Kondo
d15d9220ff Merge pull request #461 from redboltz/add_unpack_visitor_api
Added a visitor version of unpack API,
2016-05-22 22:50:44 +09:00
Takatoshi Kondo
cc02da0ccf Fixed #465
Added C-Style array support.

Existing mapping:
  convert:
  pack:
    char[N]       => STR
    const char[N] => STR
  object:
    char[N]       => STR (v1 only)
    const char[N] => STR (v1 only)
  object_with_zone:
    char[N]       => STR
    const char[N] => STR

Additional mapping:

  convert:
    STR        => char[N]
    ARRAY      => T[N]
  pack:
    T[N]       => ARRAY
    const T[N] => ARRAY
  object:
  object_with_zone:
    T[N]       => ARRAY
    const T[N] => ARRAY
2016-05-16 23:00:30 +09:00
Takatoshi Kondo
e6f82cf2bb Fixed #463.
Added lacked include files.
Added a test.
Added MSVC build settings on appveyor.
Added old MSVC workaround.
Fixed a variable definition point to meet ANSI-C.
2016-05-14 22:05:10 +09:00
Takatoshi Kondo
6593cba284 Fixed end_map_value() calling point.
Renamed names that related to a visitor.
Renamed test name from json to json_like because I omit escape.
Added end_map_value() and end_map() implementation.
2016-05-05 18:44:56 +09:00
Takatoshi Kondo
d5b515899c Added a visitor version of unpack API,
The current unpacking APIs are constructed on the visitor mechanism.
(Fixed #418)

Updated test condition.
2016-05-01 21:44:03 +09:00
Takatoshi Kondo
e21b4ef28d Fixed #457.
JSON doesn't have `nil` but has `null`.
msgpack::object JSON output uses `null` when the object is nil_t.
2016-04-14 14:48:42 +09:00
Takatoshi Kondo
07b5000824 Merge pull request #453 from redboltz/removed_obsolete_unpack
Removed obsolete `unpack()` API.
2016-03-27 17:38:58 +09:00
Takatoshi Kondo
db90ee4283 Removed obsolete unpack() API. 2016-03-26 11:46:45 +09:00
Takatoshi Kondo
a3e868acb8 Fixed pack comment. 2016-03-26 11:18:21 +09:00
Takatoshi Kondo
31a06a0682 Removed obsolete APIs form v2.
Removed MSGPACK_DISABLE_LEGACY_CONVERT from v2. Those APIs are removed
from v2.
2016-03-25 09:16:27 +09:00
Takatoshi Kondo
72c7feb2c4 Merge pull request #449 from redboltz/update_version_2_0
Updated the version to 2.0.0.
2016-03-21 19:33:58 +09:00
Takatoshi Kondo
a83e43a52f Merge pull request #448 from redboltz/replace_unpacked_with_object_handle
Replaced msgpack::unpacked with msgpack::object_handle.
2016-03-21 17:27:15 +09:00
Takatoshi Kondo
8b1632dc1d Merge pull request #444 from redboltz/nil_for_v2
type::nil is defined only if MSGPACK_USE_LEGACY_NIL in v2.
2016-03-21 17:26:08 +09:00
Takatoshi Kondo
170d29a13c Updated the version to 2.0.0.
It's not a release. Just inform that the master branch is for the
version 2.0.0.
2016-03-21 16:50:31 +09:00
Takatoshi Kondo
1bfcf55469 Replaced msgpack::unpacked with msgpack::object_handle.
msgpack::unpacked is a typedef of the msgpack::object_handle.
I recommend using msgpack::object_handle. It can be used not only
holding unpacked msgpack objects but also msgpack::objects that are
created by any types.

Replaced unpack() APIs in test codes and examples. They used to use old
APIs.
2016-03-21 15:22:50 +09:00
Takatoshi Kondo
f5f42782be Fixed #446.
Replaced passed by value with passed by rvalue reference on
msgpack::object_handle's constructor.
2016-03-21 00:51:18 +09:00
Takatoshi Kondo
5ecb797d8a type::nil is defined only if MSGPACK_USE_LEGACY_NIL in v2.
Note: In v1, type::nil is defined if NOT defined MSGPACK_DISABLE_LEGACY_NIL.
2016-03-18 09:40:34 +09:00
Takatoshi Kondo
455e0190d1 Fixed #442.
Updated msgpack::v1::operator<< and >> implementation.
Those functions refer to current version of convert, pack, object, and object_with_zone.
2016-03-17 08:43:00 +09:00
Takatoshi Kondo
fe229d1df0 Fixed #440.
Fixed a pointer operation problem at msgpack::zone::chunk_list::clear().
It was only happened on C++03.
2016-03-12 11:39:38 +09:00
Takatoshi Kondo
b5b865a6ca Merge pull request #436 from al11090/master
Fixed the broken float en/decoder on iOS
2016-03-02 09:58:03 +09:00
Takatoshi Kondo
d8e9941fa9 Merge pull request #434 from redboltz/fix_417
Fix 417
2016-03-02 09:56:53 +09:00
Mizuki Hirata
bab3eea3a8 fixed the broken float en/decoder, caused by dead detector 'TARGET_OS_IPHONE'. 2016-02-29 02:22:58 +09:00
Takatoshi Kondo
b641065d1f Added a pragma for avoiding maybe-uninitialized warning. 2016-02-26 15:51:35 +09:00
Takatoshi Kondo
60d4b2833d Fixed #433.
Added zero size check before calling std::vector<T>::front().
Added empty checking tests for all containers.
2016-02-26 15:08:18 +09:00
Takatoshi Kondo
acf4ac01fc Fixed #417.
Removed object adaptor specialization for std::string from v2.
2016-02-22 10:06:15 +09:00
Takatoshi Kondo
86ac7c6eb7 Undo-ed overly removed constructors. 2016-02-20 23:50:53 +09:00