Questions tagged [jsoncpp]

jsoncpp is an open source JSON reader and writer for C++

jsoncpp is an implementation of a JSON reader and writer in C++. JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate.

318 questions
0
votes
2 answers

How to get the character coding type of a json file?

I'm tying to get the character coding type of a json string from jsoncpp: UTF-8, ANSI or UNICODE? How to get character coding type of a json::value? Thanks advance!
XHLin
  • 301
  • 1
  • 3
  • 13
0
votes
2 answers

Retrieving a JSON object within another one

I have a simple JSON format text file and I am having some trouble retrieving values in the "pixel" array. Here is the file: { "luminaire" : { "sensors": { "pixel" : [2000,2001,2002] } } } The code I wrote in order to do this is the…
iMadz
  • 41
  • 1
  • 7
0
votes
1 answer

Invalid unicode while sending a POST request to django with libcurl and jsoncpp

I've created a REST endpoint in Django using the rest-framework module; the simple code goes as below: models.py class Data(models.Model): name = models.CharField(max_length=256) description = models.TextField() def __str__(self): …
nathan lachenmyer
  • 5,298
  • 8
  • 36
  • 57
0
votes
0 answers

Need help to get started with json

I just started with json a day ago and wrote this simple piece of code. #include "json/json.h" const char* lbuf = "[{color: 'red',value: '#f00'},{color: 'green',value: '#0f0'}]"; Json::Value root; Json::Reader reader; bool parsingSuccessful =…
Kate
  • 21
  • 2
0
votes
1 answer

How to make JsonCPP works in MFC c++ project

I was able to create a test WinApp using JsonCPP (https://github.com/open-source-parsers/jsoncpp) to parse a json file. However, when I implemented similar in an MFC C++ project with C/C++ -> Precompiled Headers option set to Use Precompiled…
Key
  • 139
  • 1
  • 9
0
votes
0 answers

c++ Undefined Reference to Json::Value

I'm getting a ton of these undefined reference to errors in my code. The errors are only coming in the functions where I am using Json. The only two functions throwing these errors are my MovieLibrary::toJsonFile(string jsonFileName) function and…
Codet
  • 15
  • 1
  • 1
  • 8
0
votes
1 answer

ndk-build for jsoncpp always giving one error

Pre-requisites : I am using Android Studio 2.1.2 I have downloaded source of jsoncpp from following link https://github.com/open-source-parsers/jsoncpp I have already checked following SO thread , not getting proper solutions :…
AdiAtAnd
  • 119
  • 1
  • 13
0
votes
0 answers

What would be the fastest way to parse a Json String to a multidimensional array in C++?

I am currently using the JsonCPP library but it is proving be a bit slow for my needs. Appreciate your thoughts on this! json_response = response.extract_json().get(); auto json = json_response.serialize(); …
0
votes
1 answer

Getting ID from MongoDB using JsonCPP

I am trying to retrieve an object out of my MongoDB instance. I am using the JsonCPP library. Currently, what I am doing is: system(("mongo --host " + host_name + " --port " + std::to_string(port) + " " + database_name + " --eval 'db." +…
Karlo Kraljic
  • 173
  • 2
  • 11
0
votes
1 answer

How to save specific values in a list to txt using jsoncpp?

I have yahoo finance json file from which I want to isolate Date,Close and volume from the quote list and save it in the same order with a comma separtion in a single text file. This is my json script. Json::Value root; // will contains the root…
Eka
  • 14,170
  • 38
  • 128
  • 212
0
votes
1 answer

Getting weather from JSON array

I am extremely new to c++, and I am trying to use jsoncpp to get the weather out of an array. The json string looks like…
Chud37
  • 4,907
  • 13
  • 64
  • 116
0
votes
0 answers

What's wrong with my jsoncpp parse program & json file?

the json file: // config { "is_train" : false, "train" : { "train_data" : "data.txt", "save_model_path" : "svm_model.yaml", "SVM" : { "term_crit" : { "method" : 1, "iter" :…
hgaolbb
  • 1
  • 1
0
votes
1 answer

Build error in JSONCPP (Visual Studio2010)

I downloaded JSONCPP from GitHub. I included header file Json.h and wrote simple code as shown in picture. But i am getting link errors. Can you please help in using JSONCPP. lINK ERROR: unresolved external symbol "public: __thiscall …
user2329702
  • 479
  • 1
  • 4
  • 12
0
votes
2 answers

What's the difference between clear and arrayValue in jsoncpp

To work with json using a library jsoncpp. Previously created an array of objects can be cleared by clear. Json::Value value; ... value.clear(); Also, it can be purified by arrayValue (or nullValue). Json::Value value; ... value =…
Max ZS
  • 175
  • 11
0
votes
1 answer

JSONCPP - segfault when declaring JSON::Reader

I have a callback function that gets called whenever it receives something from a socket. It then parses the string and turns it into a JSON object using jsoncpp. However, I'm having a strange segfault. The code looks like this void…
user3240688
  • 1,188
  • 3
  • 13
  • 34