Александр Малинин
6a15ca6442
Fix non-rvalue Json::Value assignment operator (should copy, not move)
2017-07-31 15:29:02 +03:00
Devin Jeanpierre
59e4d35339
Restore BL's authorship attribution, and add "The Jsoncpp Authors" where it was missing.
...
Requested/noticed in https://github.com/open-source-parsers/jsoncpp/pull/610 , and a
followup to https://github.com/open-source-parsers/jsoncpp/pull/607 .
2017-07-21 03:44:36 -07:00
Dhruv Paranjape
0ba8bd73f5
add move assignment operator for CZString and change copy assignment to const reference.
2017-07-08 17:47:13 +05:30
Dhruv Paranjape
23c44d9f9e
overload append function for R value references.
2017-07-08 17:30:47 +05:30
Dhruv Paranjape
8996c377aa
add move assignment operator for Json::Value class.
2017-07-08 17:27:07 +05:30
Sergiy80
d6e666f573
Add pragma pack directive
...
Related to https://github.com/open-source-parsers/jsoncpp/issues/458
2016-12-03 22:29:14 +02:00
Omkar Wagh
91c1d23461
change throw() to noexcept to conform to c++11
2016-11-07 17:39:38 -05:00
Christopher Dunn
0f288aecdd
Use a Myers Singleton for null
...
Avoid some static initialization problems.
From @marklakata
See #488
2016-06-26 19:36:40 -05:00
Christopher Dunn
98e981dff9
Use macro for override
...
b/c MS VS2010 is supposed to be C++11 but does not fulfull
the entire standard.
Resolves #410 .
Re: #430 .
2016-03-21 21:00:24 -05:00
dawesc
ae564653c4
-DJSONCPP_USE_SECURE_MEMORY=1 for cmake
...
Add allocator.h to amalgamated header
Test JSONCPP_USE_SECURE_MEMORY in Travis
2016-03-19 19:21:15 -05:00
Gaurav
d97ea5bf8d
Added NORETURN for throw functions.
...
Resolve Issue - https://github.com/open-source-parsers/jsoncpp/issues/389
2016-03-16 11:15:09 +05:30
Christopher Dunn
de5b792168
JSONCPP_STRING
2016-03-06 11:56:38 -06:00
Christopher Dunn
d4513fcf45
Fix conversion warnings/errors
...
See #411 .
http://paste.debian.net/378673/
2016-02-06 09:25:20 -06:00
Motti
2b00891a86
move ctors
...
* Add move constructor to Value::CZString
* Add unit test for Value move constructor
* Allow includer to specify in advance the value for
JSON_HAS_RVALUE_REFERENCES
2015-10-19 23:42:52 -05:00
ycqiu
c8a8cfcd4b
fix
...
In value.h, ValueConstIterator can convert to ValueIterator, I think that is a bug. the correct way is ValueIterator can convert to ValueConstIterator.
2015-10-10 17:17:20 -05:00
Christopher Dunn
dc5aa4ad7f
Fix VS warnings
...
These don't really need to be const.
resolves #369
2015-09-28 17:05:57 -05:00
Gaurav
aadd0b1b63
C++11: override keyword
...
Source : http://en.cppreference.com/w/cpp/language/override
2015-09-05 12:03:38 -05:00
Christopher Dunn
949babd7b0
Exceptions declared in header
...
resolves #272
2015-07-23 00:26:13 -05:00
Christopher Dunn
89704039a0
minor doc fix, for #302
2015-07-11 12:11:00 -05:00
Christopher Dunn
2a10f4a3b8
move ctors for BORLAND
2015-04-28 04:55:12 +01:00
Dan Liu
fcbab02e4a
fix crash for "C++ Builder" IDE
...
http://blog.csdn.net/gzliudan/article/details/45264201
2015-04-27 18:10:12 -07:00
Christopher Dunn
50069d72da
prefer std::string for setComment()
...
in case of embedded nulls
2015-04-11 14:49:28 -05:00
Christopher Dunn
ed495edcc1
prefer ValueIterator::name() to ::memberName()
...
in case of embedded nulls
2015-03-08 14:35:00 -05:00
Christopher Dunn
4e30c4fcdb
comments
2015-03-08 12:56:32 -05:00
Christopher Dunn
5383794cc9
Runtime/LogicError and throwers
2015-03-08 12:31:57 -05:00
Christopher Dunn
75279ccec2
base Json::Exception
2015-03-08 12:20:06 -05:00
Christopher Dunn
ff61752444
change str_ for cross-compilation
...
https://sourceforge.net/p/jsoncpp/bugs/59/
2015-03-06 10:31:46 -06:00
Christopher Dunn
7f439f4276
clarify operator=
2015-03-06 09:22:57 -06:00
Christopher Dunn
0fd2875a44
fix get() for embedded zeroes in key
...
This method had been overlooked.
2015-03-05 16:47:29 -06:00
Christopher Dunn
8a70297869
fix inline doxygen comments
2015-03-03 16:17:08 -06:00
Christopher Dunn
c28610fb5d
fix StaticString test
...
* support zeroes in string_
* support zeroes in writer; provide getString(char**, unsigned*)
* valueToQuotedStringN(), isCC0(), etc
* allow zeroes for cpptl ConstString
* allocated => non-static
2015-03-03 00:14:54 -06:00
Christopher Dunn
a53283568f
cp duplicateStringValue()
2015-03-03 00:14:53 -06:00
Christopher Dunn
ef21fbc785
doc new behavior
2015-03-03 00:14:53 -06:00
Christopher Dunn
25342bac13
support UTF-8 for const methods
2015-03-03 00:14:53 -06:00
Christopher Dunn
8a77037320
actually store length in CZString
2015-03-02 23:50:59 -06:00
Christopher Dunn
57ad051f67
allow length in CZString
2015-03-02 23:50:59 -06:00
Christopher Dunn
4788764844
drop JSON_VALUE_USE_INTERNAL_MAP, JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
...
And remove some old headers.
These were not actually compiling anymore, and there were outstanding,
known bugs, e.g. https://sourceforge.net/p/jsoncpp/bugs/27
2015-02-25 10:04:13 -06:00
Kevin Grant
4c5832a0be
Fix bug in ValueIteratorBase::operator-
2015-02-15 02:38:31 -06:00
Christopher Dunn
07f0e9308d
nullRef, since we had to add that kludge to 0.8.0
2015-02-10 21:28:13 -06:00
Christopher Dunn
1e3149ab75
rm trailing newlines for *all* comments
...
This will make it easier to fix newlines consistently.
2015-01-25 14:32:13 -06:00
Christopher Dunn
2bc6137ada
fix gcc warnings
2015-01-24 13:42:37 -06:00
Christopher Dunn
76746b09fc
deprecate old removeMember()
2015-01-22 19:25:44 -06:00
Christopher Dunn
e87e41cdb0
from Itzik S; see issue #28
...
with minor corrections
2015-01-20 17:03:58 -06:00
Christopher Dunn
9de2c2d84d
partial
2015-01-20 17:02:48 -06:00
datadiode
9454e687a3
Specialize std::swap() for Json::Value in a C++ standard compliant way
...
originally from pull #119
2015-01-20 15:25:41 -06:00
Christopher Dunn
66eb72f121
use SwapPayload() to retain comments
...
All tests pass, but we might be missing coverage.
issue #47
2015-01-20 12:07:01 -06:00
datadiode
c07ef37904
https://github.com/open-source-parsers/jsoncpp/issues/47
2015-01-18 10:05:25 +01:00
Billy Donahue
8eb5d89db6
Remove initInt and initUInt until they are needed.
2014-11-10 01:35:42 -05:00
Aaron Jacobs
11086dd6a7
Enabled PointerBindsToType in clang-format options.
2014-09-15 10:15:29 +10:00
Aaron Jacobs
30b07c0275
Ran clang-format over all .h and .cpp files.
...
clang-format -i $(find . -name '*.h' -or -name '*.cpp')
2014-09-15 10:14:48 +10:00
Braden McDorman
540db3b052
Added arrow operator to ValueIterator and ValueConstIterator
2014-09-14 08:15:47 -07:00
Billy Donahue
45cd9490cd
Switch to copy-and-swap idiom for operator=.
...
This allows the compiler to elide a copy when rhs is a temporary.
2014-09-10 10:37:34 -07:00
Christopher Dunn
28836b8acc
fix bug for static init
...
Ugh! Static initialization of instance variables is a very bad idea.
This fix is taken from the Chromium code-base. It includes their
double-fix for ARM.
* https://codereview.chromium.org/24984004
* https://src.chromium.org/viewvc/chrome?revision=226099&view=revision
* https://code.google.com/p/webrtc/issues/detail?id=1777
2014-07-05 17:36:20 -07:00
Aaron Jacobs
3a0c4fcc82
Ran clang-format again.
2014-07-01 09:20:48 +10:00
Aaron Jacobs
9fa4e849a1
Ran clang-format over all .h and .cpp files.
...
clang-format -i $(find . -name '*.h' -or -name '*.cpp')
2014-07-01 08:48:54 +10:00
Aaron Jacobs
68db655347
Added structured error reporting to Reader.
...
This allows applications for interactively viewing or editing JSON to do
a better job of highlighting errors. Also added offset accessors to
Value, offering the same sort of functionality even for non-errors.
Thanks to Zach Clifford (zacharyc@google.com ) for the patch.
2014-04-23 23:41:12 +00:00
Baptiste Lepilleur
eafd702a17
- New CMake based build system. Based in part on contribution from
...
Igor Okulist and Damien Buhl (Patch #14 ). Added support for running
tests and building with DLL on Windows.
- added missing JSON_API
- Visual Studio DLL: suppressed warning "C4251: <data member>: <type>
needs to have dll-interface to be used by..." via pragma push/pop
in json-cpp headers.
- New header json/version.h now contains version number macros
(JSONCPP_VERSION_MAJOR, JSONCPP_VERSION_MINOR, JSONCPP_VERSION_PATCH
and JSONCPP_VERSION_HEXA). While this header is generated by CMake,
it is committed to ease build with alternate build system
(CMake only update the file when it changes avoid issues with VCS).
2013-05-08 20:21:11 +00:00
Baptiste Lepilleur
a8afdd40af
- Patch #3393345 : BOOST_FOREACH compatibility. Made Json::iterator more standard compliant, added missing iterator_category and value_type typedefs (contribued by Robert A. Iannucci).
...
- Patch #3474563 : added missing JSON_API on some classes causing link issues when building as a dynamic library on Windows (contributed by Francis Bolduc).
2013-04-12 14:10:13 +00:00
Aaron Jacobs
1b138e8544
Gave a more consistent behavior to the Value::isFoo methods. See
...
NEWS.txt for more details.
2011-05-25 04:19:17 +00:00
Aaron Jacobs
f1053e7acb
Fixed a bunch of compilation errors when JSON_HAS_INT64 is set.
2011-05-24 03:18:02 +00:00
Baptiste Lepilleur
eadc478e50
Fixed typo: amalga*ma*te. Replaced macro JSON_IS_AMALGATED with JSON_IS_AMALGAMATION
2011-05-02 21:09:30 +00:00
Baptiste Lepilleur
1837a1c508
Value::compare() is now const and has an actual implementation with unit tests.
2011-05-02 20:11:48 +00:00
Baptiste Lepilleur
e3cc0f004b
Untabified some sources
2011-05-02 18:41:01 +00:00
Baptiste Lepilleur
64e40aafe5
Added support for amalgated source and header generation (a la sqlite). Refer to README.txt section "Generating amalgated source and header" for detail.
...
The amalgated sources are generated by concatenating JsonCpp source in the correct order and defining macro JSON_IS_AMALGATED to prevent inclusion of other headers. Sources and header has been modified to prevent any inclusion when this macro is defined.
The script amalgate.py handle the generation.
2011-05-01 20:13:40 +00:00
Baptiste Lepilleur
842e9ac54b
Major rework of 64 integer support: 64 bits integer are only returned when explicitly request via Json::Value::asInt64(), unlike previous implementation where Json::Value::asInt() returned a 64 bits integer.
...
This eases porting portable code and does not break compatibility with the previous release.
Json::Value::asLargestInt() has also be added to ease writing portable code independent of 64 bits integer support. It is typically used to implement writers.
2010-12-27 17:45:23 +00:00
Baptiste Lepilleur
b96aed0f3e
Added float Json::Value::asFloat() to obtain a floating point value as a float (avoid lost of precision warning caused by used of asDouble() to initialize a float).
2010-12-24 19:30:06 +00:00
Baptiste Lepilleur
fa130ef871
- Array index can be passed as int to operator[], allowing use of literal:
...
Json::Value array;
array.append( 1234 );
int value = array[0].asInt(); // did not compile previously
2010-12-24 12:47:14 +00:00
Baptiste Lepilleur
7469f1d014
JsonCpp is now licensed under MIT license, or public domain if desired and recognized in your jurisdiction.
2010-04-20 21:35:19 +00:00
Baptiste Lepilleur
201fb2cf0d
- Moved definition of Json::Int and Json::UInt to config.h which compiler detection logic to define them to 64 bits integer if JSON_NO_INT64 is not defined.
...
- Added Json::ArrayIndex as an unsigned int to forwards.h
- Modified Json::Value to consistently use Json::ArrayIndex.
- Added int/unsigned int constructor overload to Json::Value to avoid ambiguous constructor call.
- Modified jsontestrunner/main.cpp to use Json::valueToString for Value::asInt() conversion to string.
- Modified Json::Reader to only overflow to double when the number is too large (previous code relied on the fact that an int fitted in a double without precision loss).
- Generalized uintToString() helpers and buffer size to automatically adapt to the precision of Json::UInt.
- Added specific conversion logic for UInt to double conversion on Microsoft Visual Studio 6 which only support __int64 to double conversion (unsigned __int64 conversion is not supported)
- Added test for 64 bits parsing/writing. Notes: those will fail when compiled with JSON_NO_INT64 (more dev required to adapt).
2010-04-19 07:37:41 +00:00
Baptiste Lepilleur
afd9cef928
Removed experimental ValueAllocator, it caused static initialization/destruction order issues (bug #2934500 ). The DefaultValueAllocator has been inlined in code.
2010-03-13 13:10:27 +00:00
Baptiste Lepilleur
0c5fff142d
Removed experimental notification on iterators, and added experimental status for allocator (to be removed)
2010-03-11 20:23:07 +00:00
Baptiste Lepilleur
3a1b93be1c
- added Int/UInt typedef in Json namespace. Modified Value::Int and Value::UInt to be typedef on those. Modified code to use Json::Int instead of Value::Int.
...
- added Value constructor taking begin/end pointer to initialize the Value with a non-zero terminated string.
2010-02-21 14:08:17 +00:00
Baptiste Lepilleur
4a5e58c4f4
Integrated part of Patch #2839016 , fixing default iterator initialization when using internal map.
2010-01-15 14:56:59 +00:00
Baptiste Lepilleur
a1d6c9e66a
Fixed iteration bug over null values.
2009-11-23 22:33:30 +00:00
Christopher Dunn
f4b73938d2
I always have compiler problems when using operator[](unsigned) when I pass int instead, so I added a note to the comments.
2007-06-13 17:02:59 +00:00
Christopher Dunn
6d135cb5e3
Added prop svn:eol-style native. Stripped carriage-returns on unix. Hopefully, this will work for Windows too now.
2007-06-13 15:51:04 +00:00
Christopher Dunn
a44cffb342
Fixed compilation warnings. Added -Wall to linux-gcc compilation. JSON_ASSERT_MESSAGE now throws exception (but JSON_ASSERT does not).
2007-05-09 19:35:15 +00:00
Christopher Dunn
208a781e47
Added empty() operator-bang and isNull()
2007-03-23 08:55:25 +00:00
Christopher Dunn
1aa20f9e58
Added removeMember() and altered a few comments.
2007-03-23 08:30:20 +00:00
Christopher Dunn
02ff716d2f
Added/clarified comments. Move extra verbiage out of brief sections.
2007-03-23 07:28:19 +00:00
Christopher Dunn
ca21256395
setComment() will assert if comment does not start with / (or if it were NULL, which would have seg-faulted before).
2007-03-23 07:05:19 +00:00
Christopher Dunn
8386d3efe1
Added comments, pre- and post-condition for resize(), clear(), Value(ValueType).
2007-03-23 06:38:29 +00:00
Baptiste Lepilleur
4cd8bae331
- reorganized repository to match standard layout
2007-03-15 22:11:38 +00:00