open-source-parsers / jsoncpp Goto Github PK
View Code? Open in Web Editor NEWA C++ library for interacting with JSON.
License: Other
A C++ library for interacting with JSON.
License: Other
Hi,
How can I build a 32 bit version of JSONCPP?
I'm using scons, and I've set the CPPFLAGS env var to -m32.
I'm building on a 64-bit box, but I'd like to produce a 32-bit binary.
When building jsoncpp as part of a "superbuild" of a larger project, I was surprised that it build a static library. I see this is because shared vs. static is configured by the JSONCPP_LIB_BUILD_SHARED
option and not the standard CMake option BUILD_SHARED_LIBS
.
Is there a reason you cannot use the latter? Please do so if possible, or at least default JSONCPP_LIB_BUILD_SHARED
to ${BUILD_SHARED_LIBS}
rather than OFF
.
Running the amalgamate.py script from the top level directory fails with a "No such file or directory" IOError. Specifically it can't find the version.h file in the include\json directory.
I've tried this on both a Windows 8.1 machine with Python 2.7.8 and an OSX 10.9.4 machine with Python 2.7.5
Re: issue #37
How to build debug mode library using scons ?
Hi! I downloaded the project fresh from this repository.
I also tried to run this command using PowerShell:
python amalgamate.py
This is the output:
Amalgating header...
Traceback (most recent call last):
File "amalgamate.py", line 149, in
main()
File "amalgamate.py", line 141, in main
header_include_path=options.header_include_path )
File "amalgamate.py", line 63, in amalgamate_source
header.add_file( 'LICENSE', wrap_in_comment=True )
File "amalgamate.py", line 30, in add_file
f = open( os.path.join( self.top_dir, relative_input_path ), 'rt' )
IOError: [Errno 2] No such file or directory: 'C:\python26\LICENSE'
Did I miss something? Thanks.
Implementations of Writer::write
should r-value move the return value to avoid making a copy.
Example:
https://github.com/open-source-parsers/jsoncpp/blob/master/src/lib_json/json_writer.cpp#L195
This should read
...
return std::move(document_);
Hi!
I am currently trying to build jsoncpp using cmake + mingw under windows. Python 3.4 is installed, but I am getting the following error:
Scanning dependencies of target jsontestrunner_exe
[100%] Building CXX object src/jsontestrunner/CMakeFiles/jsontestrunner_exe.dir/main.cpp.obj
Linking CXX executable ..\..\bin\jsontestrunner_exe.exe
[100%] Built target jsontestrunner_exe
Scanning dependencies of target jsoncpp_readerwriter_tests
File "C:/Users/user/Desktop/win32-deps/jsoncpp/src/jsontestrunner/../../test/runjsontests.py", line 37
except IOError, e:
^
SyntaxError: invalid syntax
src\jsontestrunner\CMakeFiles\jsoncpp_readerwriter_tests.dir\build.make:49: recipe for target 'src/jsontestrunner/CMakeF
iles/jsoncpp_readerwriter_tests' failed
mingw32-make[2]: *** [src/jsontestrunner/CMakeFiles/jsoncpp_readerwriter_tests] Error 1
CMakeFiles\Makefile2:180: recipe for target 'src/jsontestrunner/CMakeFiles/jsoncpp_readerwriter_tests.dir/all' failed
mingw32-make[1]: *** [src/jsontestrunner/CMakeFiles/jsoncpp_readerwriter_tests.dir/all] Error 2
Makefile:126: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
PS C:\Users\user\Desktop\win32-deps\jsoncpp\build\release>
Has anyone an idea on that?
https://code.google.com/p/android/issues/detail?id=77988
Hi all,
An FYI: we had a report of our games locking up on the new version of Android, which we tracked down to a buggy sscanf in the Android NDK (which is used when parsing floating-point values). Upgrading the the latest NDK (10c at time of writing) fixed this:
David Oakley [email protected]
argh
The problem is I need a exact version to package into distros. I hope you can understand as I don't want to package something always in the git, I do need a stable version(ensured by tags).
And if it used to have versions, why can't have anymore now?
Ok, that makes sense. Can you use the GitHub releases? Near the top of the screen, there are tabs for commits, branches, releases, and contributors. If you click on releases, you can see all our release tags, with an option to download either a tarball or a zipfile. Will that work for you?
If so, then we can continue to add tags for new releases.
I am copying this from source-forge:
I'm trying to use json-cpp in Visual Studio 2010. I have no problem when compiling debug, but release gives me the following error:
C:\Dev\ThirdParty\jsoncpp-src-0.6.0-rc2\src\lib_json\json_writer.cpp : fatal error C1083: Cannot open compiler generated file: '../../build/vs71/release/lib_json\json_writer.asm': No such file or directory
Are there any hard limits in JSONCPP with respect to object size (other than memory available on the heap)?
I wrote a really simple program to experiment with large objects in JSONCPP (see code below). I hit a limit WRT objects at ~400MB.
int main(int argc, char** argv) {
int count = std::atoi(argv[1]);
int messages = 100000000;
for (int i=0; i<count; ++i) {
Json::Value root(Json::arrayValue);
for (int j=0; j<messages; ++j) {
Json::Value& security = root.append(Json::Value(Json::objectValue));
security["symbol"] = "msft.o";
security["price"] = 27.0;
security["fair"] = 27.0;
}
Json::FastWriter writer;
std::cout << writer.write(root);
}
}
Looks like it fails to swap itemIsUsed_, memberNameIsStatic_, and comments_. If this is intentional, it deserves a comment.
My application is doing exception handling for the throw done by Jsoncpp like in JSON_FAIL_MESSAGE & JSON_ASSERT_MESSAGE.
If application receives junk data somehow, it catches exception & start to parse again because next time it can expect correct data. It can try for say 10 times till it receives correct data.
In such a case, is it fine to use same Json::Value object or do we need change some state of parser ?
I'm building with CMake and getting the following error from the unit tests:
Testing ValueTest/checkNormalizeFloatingPointStr: OK
Testing ValueTest/memberCount: OK
Testing ValueTest/objects: OK
Testing ValueTest/arrays: OK
Testing ValueTest/null: OK
Testing ValueTest/strings: OK
Testing ValueTest/bools: OK
Testing ValueTest/integers: FAILED
Testing ValueTest/nonIntegers: OK
Testing ValueTest/compareNull: OK
Testing ValueTest/compareInt: OK
Testing ValueTest/compareUInt: OK
Testing ValueTest/compareDouble: OK
Testing ValueTest/compareString: OK
Testing ValueTest/compareBoolean: OK
Testing ValueTest/compareArray: OK
Testing ValueTest/compareObject: OK
Testing ValueTest/compareType: OK
Testing ValueTest/offsetAccessors: OK
Testing ValueTest/typeChecksThrowExceptions: OK
Testing ReaderTest/parseWithNoErrors: OK
Testing ReaderTest/parseWithNoErrorsTestingOffsets: OK
Testing ReaderTest/parseWithOneError: OK
Testing ReaderTest/parseChineseWithOneError: OK
Testing ReaderTest/parseWithDetailError: OK
Testing WriterTest/dropNullPlaceholders: OK
* Detail of ValueTest/integers test failure:
/home/eric/Development/jsoncpp/src/test_lib_json/main.cpp(664): kfint32max == val.asFloat()
Expected: 2147483648
Actual : 2147483648
25/26 tests passed (1 failure(s))
make[2]: *** [jsoncpp/bin/jsoncpp_test] Error 1
make[1]: *** [jsoncpp/src/test_lib_json/CMakeFiles/jsoncpp_test.dir/all] Error 2
make: *** [all] Error 2
Is this an issue in the code or maybe specific to my setup?
The amalgamated source can't be generated after just cloning repository because there is no include/json/version.h file. But Readme.md says "The amalgamated source can be generated at any time..."
Hello,
I was looking for a good C++ json encoder / decoder and found your lib. I was looking at the code and found the duplicateStringValue function.
What is the prupose of this function considering the fact that cstring
provides strdup
?
Also, there is this part of the code:
// Avoid an integer overflow in the call to malloc below by limiting length
// to a sane value.
if (length >= (unsigned)Value::maxInt)
length = Value::maxInt - 1;
length
is defined as an unsigned int, so it may be greater than Value::maxInt
so I really don't know what you are trying to check here.
Anyway, why does this (C++) library does not use standard types for strings and arrays (std::string
and std::vector
) ? This would help having a true C++ lib.
It would be nice if there were a mechanism for reporting the locations of semantic errors (e.g. incorrect value type). It looks like the functionality is almost there with Value::getOffsetStart()
. Perhaps something like:
void Reader::pushError(const Value& value, std::string msg);
which would use the Value offset and Reader::begin_
to calculate a Reader::Location
and push_back a Reader::ErrorInfo
onto Reader::errors_
. The error could then be printed with a call to Reader::getFormattedErrorMessages()
. Perhaps there could be a:
void Reader::pushError(const Value& value, std::string msg, const Value& extra);
that also initializes Reader::ErrorInfo::extra_
.
Of course then it would be nice to have a function
bool Reader::good() const;
to return !Reader::errors_.size()
.
Soooo, I guess I basically could implement this right now....lol. Expect a pull request shortly.
Hi! I was testing a library using jsoncpp and I encountered that using a crafted JSON file can lead to a segfault in the JSON Reader.
I used the following command to generate a huge nested array (valid JSON) that causes jstontestrunner_exe to crash:
python -c "i=99999; print '['*i + '666' + ']'*i" > out.json;
The current double serialization code doesn't work as good as possible for doubles - the round trip double -> string -> double creates different double output from input in a lot of cases.
The reason for this is that the number of digits (16) used to print the double to string is too low.
This http://stackoverflow.com/a/16941784/2520006 links to some background reading.
The fix is quite simple: Just print 17 digits.
The attached test case demonstrates problem and fix.
See also http://sourceforge.net/p/jsoncpp/bugs/63/
#define STANDALONE 1
#include <stdio.h>
#include <string.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <string>
#include <iostream>
#include <iomanip>
#include <limits>
namespace {
double pi = M_PI;
double r2 = sqrt(2.0);
const float samples[] = { pi, pi + r2, pi + r2 * 2, pi + r2 * 3, pi + r2 * 4, pi + r2 * 5, pi + r2 * 6, pi + r2 * 7 };
const int samplessize = sizeof(samples)/sizeof(samples[0]);
}
// Code exactly as in jsoncpp amalgamated
/** Change ',' to '.' everywhere in buffer.
*
* We had a sophisticated way, but it did not work in WinCE.
* @see https://github.com/open-source-parsers/jsoncpp/pull/9
*/
static inline void fixNumericLocale(char* begin, char* end) {
while (begin < end) {
if (*begin == ',') {
*begin = '.';
}
++begin;
}
}
std::string valueToString16(double value) {
// Allocate a buffer that is more than large enough to store the 16 digits of
// precision requested below.
char buffer[32];
int len = -1;
// Print into the buffer. We need not request the alternative representation
// that always has a decimal point because JSON doesn't distingish the
// concepts of reals and integers.
#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) // Use secure version with
// visual studio 2005 to
// avoid warning.
#if defined(WINCE)
len = _snprintf(buffer, sizeof(buffer), "%.16g", value);
#else
len = sprintf_s(buffer, sizeof(buffer), "%.16g", value);
#endif
#else
if (isfinite(value)) {
len = snprintf(buffer, sizeof(buffer), "%.16g", value);
} else {
// IEEE standard states that NaN values will not compare to themselves
if (value != value) {
len = snprintf(buffer, sizeof(buffer), "null");
} else if (value < 0) {
len = snprintf(buffer, sizeof(buffer), "-1e+9999");
} else {
len = snprintf(buffer, sizeof(buffer), "1e+9999");
}
// For those, we do not need to call fixNumLoc, but it is fast.
}
#endif
//assert(len >= 0);
fixNumericLocale(buffer, buffer + len);
return buffer;
}
// Changed sprintf_s format to 17
std::string valueToString17(double value) {
// Allocate a buffer that is more than large enough to store the 16 digits of
// precision requested below.
char buffer[32];
int len = -1;
// Print into the buffer. We need not request the alternative representation
// that always has a decimal point because JSON doesn't distingish the
// concepts of reals and integers.
#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) // Use secure version with
// visual studio 2005 to
// avoid warning.
#if defined(WINCE)
len = _snprintf(buffer, sizeof(buffer), "%.17g", value);
#else
len = sprintf_s(buffer, sizeof(buffer), "%.17g", value);
#endif
#else
if (isfinite(value)) {
len = snprintf(buffer, sizeof(buffer), "%.17g", value);
} else {
// IEEE standard states that NaN values will not compare to themselves
if (value != value) {
len = snprintf(buffer, sizeof(buffer), "null");
} else if (value < 0) {
len = snprintf(buffer, sizeof(buffer), "-1e+9999");
} else {
len = snprintf(buffer, sizeof(buffer), "1e+9999");
}
// For those, we do not need to call fixNumLoc, but it is fast.
}
#endif
//assert(len >= 0);
fixNumericLocale(buffer, buffer + len);
return buffer;
}
// relevant extract of decode function in jsoncpp
double decodeDouble(const std::string& s)
{
double value = 0;
const int bufferSize = 32;
int count;
int length = s.length();
// Avoid using a string constant for the format control string given to
// sscanf, as this can cause hard to debug crashes on OS X. See here for more
// info:
//
// http://developer.apple.com/library/mac/#DOCUMENTATION/DeveloperTools/gcc-4.0.1/gcc/Incompatibilities.html
char format[] = "%lf";
count = sscanf( s.c_str(), format, &value );
return value;
}
void double16()
{
std::cout << "jsoncpp 0.60 implementation" << std::endl;
double d;
for(int i = 0; i < samplessize; i++)
{
d = samples[i];
std::string s = valueToString16(d);
double r = decodeDouble(s);
std::cout << "val: " << d << " dec: " << r << " dif: " << d - r << std::endl;
}
}
void double17()
{
std::cout << "fixed implementation" << std::endl;
double d;
for(int i = 0; i < samplessize; i++)
{
d = samples[i];
std::string s = valueToString17(d);
double r = decodeDouble(s);
std::cout << "val: " << d << " dec: " << r << " dif: " << d - r << std::endl;
}
}
#if (STANDALONE > 0)
int main(int argc, char* argv[])
#else
int jsoncppBugReport(int argc, char* argv[])
#endif
{
std::cout << "decimal" << std::endl;
std::cout << std::scientific
<< std::fixed
<< std::setprecision(std::numeric_limits<double>::digits10 + 2);
double16();
double17();
#if defined(_MSC_VER)
std::cout << "hex" << std::endl;
std::cout << std::hexfloat
<< std::setprecision(std::numeric_limits<double>::digits / 8 + 2);
double16();
double17();
#endif
return 1;
}
simple test:
#include <iostream>
#include <jsoncpp/json/value.h>
#include <jsoncpp/json/writer.h>
int main (int argc, char **argv) {
Json::StyledWriter wr;
Json::Value l ("September");
l.setComment ("// Autumn", Json::commentAfterOnSameLine);
std::cout << wr.write (l) << std::endl;
Json::Value r;
r["month"] = l; // comment is gone
std::cout << wr.write (r) << std::endl;
r["month"].setComment ("// Autumn either", Json::commentAfterOnSameLine);
std::cout << wr.write (r) << std::endl;
Json::Value s;
s["date"] = r; // deep level comments are preserved
std::cout << wr.write (s) << std::endl;
}
and result:
"September" // Autumn
{
"month" : "September"
}
{
"month" : "September" // Autumn either
}
{
"date" : {
"month" : "September" // Autumn either
}
}
A. For reading, we should first parse JSON into nested tables, arrays, and strings. We should then interpret the strings only as needed.
B. For writing, the caller should generate the string, and we should simply store it into the nested data structures. Utility libraries could help the caller convert numbers to strings.
As an experiment, I intend to separate these layers. The jsoncpp API would remain, for convenience, but under the covers there can be an extremely fast, efficient reader (maybe based on gason), which can be used directly by anyone who wants unlimited length numbers. One thing which people rarely notice in the JSON standard is that it says nothing about how long numbers can be. The whole issue of converting between ints/floats and strings is implementation-specific.
The other thing is that, in my opinion, we can simply matters by having two versions: One which reads/writes ASCII, and one which reads/writes UTF-32. rapidjson is an example of a library which goes overboard on unicode support. The encoding is threaded through the entire library as a template parameter. Way too complicated!
The problem is in parsing a JSON String. We have to support both standard Unicode characters and special JSON escapes. With UTF-8, we would have to skip variable numbers of bytes while looking for the closing quotation mark, unless we restrict ourselves to ASCII. With UTF-16, we have to worry about "surrogate pairs". But why bother? If someone needs real unicode strings, let them pre- and post-process in UTF-32, which is the easiest to deal with. If they want efficiency, let them be restricted to ASCII.
Those are the basic ideas. An example will make things more clear.
My gcc compiler flags are as follows:
-Wall -Wextra -Wno-unused-result
And compile the latest source code of jsoncpp, and get the following warnings:
[ 33%] Building CXX object json_reader.cpp.o
json_reader.cpp: In member function โbool Json::Reader::pushError(const Json::Value&, const string&)โ:
json_reader.cpp:834:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
json_reader.cpp:835:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
json_reader.cpp: In member function โbool Json::Reader::pushError(const Json::Value&, const string&, const Json::Value&)โ:
json_reader.cpp:850:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
json_reader.cpp:851:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
json_reader.cpp:852:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
[ 66%] Building CXX object json_value.cpp.o
json_value.cpp: In copy constructor โJson::Value::CZString::CZString(const Json::Value::CZString&)โ:
json_value.cpp:179:26: warning: enumeral and non-enumeral type in conditional expression [enabled by default]
src/lib_json/json_reader.cpp | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp
index 1b2f187..c5111f8 100644
--- a/src/lib_json/json_reader.cpp
+++ b/src/lib_json/json_reader.cpp
@@ -831,8 +831,9 @@ std::vectorReader::StructuredError Reader::getStructuredErrors() const {
}
bool Reader::pushError(const Value& value, const std::string& message) {
bool Reader::pushError(const Value& value, const std::string& message, const Value& extra) {
src/lib_json/json_value.cpp | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/src/lib_json/json_value.cpp b/src/lib_json/json_value.cpp
index b6ea8ff..b4af62b 100644
--- a/src/lib_json/json_value.cpp
+++ b/src/lib_json/json_value.cpp
@@ -170,13 +170,17 @@ Value::CZString::CZString(const char* cstr, DuplicationPolicy allocate)
: cstr_(allocate == duplicate ? duplicateStringValue(cstr) : cstr),
index_(allocate) {}
-Value::CZString::CZString(const CZString& other)
? duplicateStringValue(other.cstr_)
: other.cstr_),
index_(other.cstr_
? (other.index_ == noDuplication ? noDuplication : duplicate)
: other.index_) {}
cstr_ = other.cstr_;
Value::CZString::~CZString() {
if (cstr_ && index_ == duplicate)
Trying to copy a Json::Value object to a long int fails to compile, because Json::Uint64 and Json::Int64 are mapped to unsigned long int and long int, respectively.
On Linux/Unix systems, at least, these should instead be mapped to uint64_t and int64_t, which will always be 64 bit.
Also note that these typedefs (int64_t and uint64_t) don't work either with the Json::Value constructor, because they are typdefed to long int when __WORDSIZE == 64. They do work when __WORDSIZE == 32, because then they map to long long int, just like Json::Int64.
Hi Christopher,
I have tried to package 0.7.0 using the current tip and it seems that it
could be a backward-compatibility problem. The following log is what
symbols where defined in 0.6.0~rc2 and what are now defined. Basically,
take a look at MISSING tags:
@@ -72,7 +72,7 @@
(c++)"Json::Value::CZString::index() const@Base" 0.6.0~rc2
(c++)"Json::Value::CZString::isStaticString() const@Base" 0.6.0~rc2
(c++)"Json::Value::CZString::operator<(Json::Value::CZString const&)
const@Base" 0.6.0~rc2
- (c++)"Json::Value::CZString::operator=(Json::Value::CZString
const&)@Base" 0.6.0~rc2
+#MISSING: 0.7.0~git20141116-1#
(c++)"Json::Value::CZString::operator=(Json::Value::CZString
const&)@Base" 0.6.0~rc2
(c++)"Json::Value::CZString::operator==(Json::Value::CZString const&)
const@Base" 0.6.0~rc2
(c++)"Json::Value::CZString::swap(Json::Value::CZString&)@Base" 0.6.0~rc2
(c++)"Json::Value::CZString::~CZString()@Base" 0.6.0~rc2
@@ -141,7 +141,7 @@
(c++)"Json::Value::operator!=(Json::Value const&) const@Base" 0.6.0~rc2
(c++)"Json::Value::operator<(Json::Value const&) const@Base" 0.6.0~rc2
(c++)"Json::Value::operator<=(Json::Value const&) const@Base" 0.6.0~rc2
- (c++)"Json::Value::operator=(Json::Value const&)@Base" 0.6.0~rc2
+#MISSING: 0.7.0~git20141116-1# (c++)"Json::Value::operator=(Json::Value
const&)@Base" 0.6.0~rc2
(c++)"Json::Value::operator==(Json::Value const&) const@Base" 0.6.0~rc2
(c++)"Json::Value::operator>(Json::Value const&) const@Base" 0.6.0~rc2
(c++)"Json::Value::operator>=(Json::Value const&) const@Base" 0.6.0~rc2
Are you removed those method definition for any reason?. If those
changes could affect to an user I think I have to increase the SONAME in
Debian version, in order to avoid conflicts. What do you think?
In earlier version of Json::value constructor i.e. Value( const char *value ) was handling NULL as parameter gracefully But crashing In version jsoncpp 0.6.0.
Why this change is done, any specific issue related to that?
I am using the release 0.6 rc 2 from the release section. Under Windows7 I have troubles with double values if the locales in windows are set to german.
It formats double values like this: [3,2 , 4,2]
Has this been fixed in any recent version?
I'm under windows with Visual C++ 64 bits.
The error is vicious as it is not really reproducible. Depending on luck, json-cpp in my simply crash with an empty error message "\n"
, just ignore any keys or consider any to be null. It is constant in behaviour with the same file however. There seems to be a lot of memory corruption.
Here is my snippet of code :
#include <json/json.h>
#include <fstream>
#include <sstream>
#include <string>
#include <iostream>
int main( int argc, char* argv[] )
{
std::ifstream definition_file( "materials.json" );
if( !definition_file )
{
std::cerr << "no \"materials.json\"" << std::endl;
exit( 1 );
}
Json::Value root;
Json::Reader reader;
if( reader.parse( definition_file, root ) )
{
std::cerr << reader.getFormattedErrorMessages() << std::endl;
exit( 1 );
}
Json::Value json_materials = root["firstName"];
std::cout << "firstName's type : " << json_materials.type() << std::endl;
return 0;
}
and here is the example of json file :
{
firstName: "John"
}
Its type is said to be NullType :
firstName's type : 0
If have no idea how to investigate the corruption, as the error message is bltantly empty or there are no error at all.
By the way, isn't there a stable release for jsoncpp ? It's a pain in the butt to lose time guessing all those bugs are the lib's fault or mine. And I'm still unsure. And isn't there clean windows prebuild libs. My compilation went fine, but whatever.
From Itzik S (privately):
The following is simple solution.
void Value::remove(ArrayIndex index)
{
if (type_ == arrayValue){
#ifndef JSON_VALUE_USE_INTERNAL_MAP
CZString key(index);
ObjectValues::iterator it = value_.map_->find(key);
if (it != value_.map_->end()){
ArrayIndex oldSize = size();
// shift left all items left, into the place of the "removed"
for (ArrayIndex i=index; i<oldSize-1; i++){
CZString key(i);
(*value_.map_)[key] = (*this)[i+1];
}
// erase the last one ("leftover")
CZString keyLast(oldSize-1);
ObjectValues::iterator itLast = value_.map_->find(keyLast);
value_.map_->erase(itLast);
}
#else
NOT SUPPORTED
#endif
}
}
Json Value support 64 bit Signed & Unsigned Integers.
SO, Jsoncpp supports 64-bit architecture/machine fully ?
Is it tested thoroughly on 64-bit machine ?
I've edited the amalgamate.py to be able to run it with Python 3.X
It's here: http://www.file-upload.net/download-9494672/amalgamate.py.html
[]An error has occurred.
Jsoncpp strict mode is able to parse above input.
This is invalid json but somehow passed by latest jsoncpp code till "]". It is not considering input after "]".
Sample code :
int main()
{
Json::Value root;
ifdef STRICT
Json::Reader reader(Json::Features::strictMode());
else
Json::Reader reader;
endif
std::ifstream file("test_now.json");
bool parsingSuccessful = reader.parse(file, root);
if(!parsingSuccessful)
{
cout << "Failed to parse configuration. " << reader.getFormatedErrorMessages();
return 0;
}
else
cout << "Pretty-Print: " << root.toStyledString() << endl;
}
Output with all & strict mode:
./all
Pretty-Print: []
./strict
Pretty-Print: []
Json::Value root;
Json::Reader reader;
const bool parsingSuccessful = reader.parse("404 Not Found", root);
parsingSuccessful == true !
p.s.
http://jsonlint.com/
Parse error on line 1:
404 NotFound
^
Expecting '{', '['
Now that you've given up on version numbers, how do we determine the SONAME of the shared library?
Doesn't allow to set nesting limit and segfaults on deeply nested objects.
When I parse a string like "1", "12". JsonCPP just goes wrong.
parse function return true
I'm using this library as a CMake ExternalProject in one of my own projects and it runs tests everytime I recompile. It'd be nice if you set EXCLUDE_FROM_ALL for the json_cpp_readwriter_tests so the tests are only run when explicitly asked for.
Hi, I am using jsoncpp in one of my projects, which I am compiling natively and for the web with emscripten (basically works like any cross-compiler).
I found that finding the jsoncpp headers is a bit of an unnecessary hurdle there because by default they are installed in the directory ${prefix}/include/json
(that's what I have when cross-compiling), while in my native environment (arch linux), jsoncpp headers are in ${prefix}/include/jsoncpp/json
to avoid conflicts with other packages using ${prefix}/include/json
.
Could you please change the include directories name from "json" to "jsoncpp" so packagers don't have to work around this anymore and the headers are found in one common place?
Could you please add a link to the latest jsoncpp
documentation from this page:
https://github.com/open-source-parsers/jsoncpp
You can put it in the README and there's also the option to set a URL at the top besides the description "A C++ library for interacting with JSON."
As a first-time potential user that wants to know what this library does, should I start reading at https://github.com/open-source-parsers/jsoncpp/wiki or http://open-source-parsers.github.io/jsoncpp-docs/doxygen/index.html ?
I don't see any indication of what the PathArguments are in Json::Path and what the difference between make and resolve calls are. I'm a little confused about how to use it.
Building the XCode project shows up these errors in OSX 10.9.5 in the latest master revision
PhaseScriptExecution CMake\ Rules build/debug/src/jsontestrunner/jsoncpp.build/Debug/jsoncpp_readerwriter_tests.build/Script-C0323C78F6044CE59BD08559.sh
cd "/Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp"
/bin/sh -c \"/Users/Robotex/Documents/Progetti/OSX/Valkyrie\ Crusade\ Bot/Libraries/JsonCpp/build/debug/src/jsontestrunner/jsoncpp.build/Debug/jsoncpp_readerwriter_tests.build/Script-C0323C78F6044CE59BD08559.sh\"
echo ""
/usr/bin/python2.6 -B /Users/Robotex/Documents/Progetti/OSX/Valkyrie\ Crusade\ Bot/Libraries/JsonCpp/src/jsontestrunner/../../test/runjsontests.py /Users/Robotex/Documents/Progetti/OSX/Valkyrie\ Crusade\ Bot/Libraries/JsonCpp/build/debug/bin/Debug/jsontestrunner_exe /Users/Robotex/Documents/Progetti/OSX/Valkyrie\ Crusade\ Bot/Libraries/JsonCpp/src/jsontestrunner/../../test/data
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
sh: /Users/Robotex/Documents/Progetti/OSX/Valkyrie: No such file or directory
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/fail_test_array_01.json OK
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_array_01.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_array_02.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_array_03.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_array_04.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_array_05.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_array_06.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_array_07.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_basic_01.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_basic_02.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_basic_03.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_basic_04.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_basic_05.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_basic_06.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_basic_07.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_basic_08.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_basic_09.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_comment_01.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_comment_02.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_complex_01.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_integer_01.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_integer_02.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_integer_03.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_integer_04.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_integer_05.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_integer_06_64bits.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_integer_07_64bits.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_integer_08_64bits.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_large_01.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_object_01.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_object_02.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_object_03.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_object_04.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_preserve_comment_01.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_real_01.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_real_02.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_real_03.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_real_04.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_real_05.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_real_06.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_real_07.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_real_08.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_real_09.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_real_10.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_real_11.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_real_12.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_string_01.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_string_02.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_string_03.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_string_04.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_string_05.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_string_unicode_01.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_string_unicode_02.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_string_unicode_03.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_string_unicode_04.json parsing failed
TESTING: /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_string_unicode_05.json parsing failed
Failure details:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_array_01.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_array_02.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_array_03.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_array_04.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_array_05.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_array_06.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_array_07.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_basic_01.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_basic_02.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_basic_03.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_basic_04.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_basic_05.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_basic_06.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_basic_07.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_basic_08.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_basic_09.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_comment_01.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_comment_02.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_complex_01.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_integer_01.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_integer_02.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_integer_03.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_integer_04.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_integer_05.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_integer_06_64bits.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_integer_07_64bits.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_integer_08_64bits.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_large_01.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_object_01.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_object_02.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_object_03.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_object_04.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_preserve_comment_01.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_real_01.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_real_02.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_real_03.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_real_04.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_real_05.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_real_06.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_real_07.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_real_08.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_real_09.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_real_10.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_real_11.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_real_12.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_string_01.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_string_02.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_string_03.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_string_04.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_string_05.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_string_unicode_01.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_string_unicode_02.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_string_unicode_03.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_string_unicode_04.json
Parsing failed:
* Test /Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/test/data/test_string_unicode_05.json
Parsing failed:
Test results: 1 passed, 55 failed.
make: *** [/Users/Robotex/Documents/Progetti/OSX/Valkyrie Crusade Bot/Libraries/JsonCpp/build/debug/src/jsontestrunner/CMakeFiles/jsoncpp_readerwriter_tests] Error 1
I think the problem arises at line 58 in runjsontests.py
pipe = os.popen( "%s%s %s %s" % (
valgrind_path, jsontest_executable_path, options,
input_path) )
where input_path isn't getting escaped properly
Value json;
json["dbl"] = 0.0;
// json["dbl"].type() == realValue
FastWriter writer;
string str = writer.write( json );
// "dbl" becomes 0
Reader reader;
reader.read( str, json );
// json["dbl"].type() == intValue
writer's sprintf with %g doesn't print dot when 0 below.
%lf is OK. but not optimized.
Maybe need to add some codes.
Or am I misunderstand something?
Appending a character constant to a std::string
is faster than appending a string literal. Rationale: a temporary std::string
object does not need to be constructed.
Example:
https://github.com/open-source-parsers/jsoncpp/blob/master/src/lib_json/json_writer.cpp#L227
When trying to parse large JSON files it fails with Failed to parse JSON. Syntax error: value, object, or array expected.
It would be nice to create an official release 0.7.0 This should trigger Linux distributions to update their packages.
We are using ubuntu Linux and arch Linux. Both are using Version 0.6.0 rc2.
Eg. Autobuild relies on that. Please add an option to create this file on building.
Example:
/usr/lib/pkgconfig/jsoncpp.pc
prefix=/usr
libdir=${prefix}/lib
includedir=${prefix}/include/jsoncpp
version = 0.5.0
name = jsoncpp
pkgname = jsoncpp
Name: ${name}
Version: ${version}
Description: Jsoncpp library version 0.5.0
Cflags: -I${includedir}
Libs: -L${libdir} -ljsoncpp
Hi,
Thanks for all the great work. I've recently started using json-cpp
and I am really liking it. I'm currently using 0.6.0 rc2
but I see some improvements in master that I would really like to use, mainly that throw std::exception
is used more regularly rather than just using assert
.
The problem I have is that I can't seem to find any information regarding if there have been any releases since then, or am I just to assume that if the code is passing the tests that its in a stable state for I can just use the master
branch rather than expecting that releases known to be in a good stable state will be tagged.
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.