json-cpp

beta

C++ JSON parser

4.5 Stars (69)
747 Downloads (This Week)
Last Update:
Download jsoncpp-src-0.5.0.tar.gz
Browse All Files
BSD Windows Linux

Description

jsoncpp is an implementation of a JSON (http://json.org) 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.

New homepage:
https://github.com/open-source-parsers/jsoncpp
Old homepage:
http://jsoncpp.sourceforge.net

json-cpp Web Site

Categories

Data Formats

License

Public Domain, MIT License

Update Notifications





User Ratings

★★★★★
★★★★
★★★
★★
59
1
1
0
8
ease 1 of 5 2 of 5 3 of 5 4 of 5 5 of 5 2 / 5
features 1 of 5 2 of 5 3 of 5 4 of 5 5 of 5 3 / 5
design 1 of 5 2 of 5 3 of 5 4 of 5 5 of 5 3 / 5
support 1 of 5 2 of 5 3 of 5 4 of 5 5 of 5 2 / 5
Write a Review

User Reviews

  • yaopeijiang
    1 of 5 2 of 5 3 of 5 4 of 5 5 of 5

    hello author, I find two bug. 1.if json more than twenty value,Could lead to a loss of "[" and "{". example: Json::Value root; Json::FastWriter writer; while(bContinue) { hModule = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, PInfo.th32ProcessID); Module32First(hModule, &MInfo); CloseHandle(hModule); hProcess = OpenProcess(PROCESS_QUERY_INFORMATION,FALSE,PInfo.th32ProcessID); char cFull[1024] = {0}; int iLen = pGetProcessImageFileNameA(hProcess,cFull,1024); Json::Value sysinfo; sysinfo["dwPid"] = (int)PInfo.th32ProcessID; sysinfo["FileName"] = PInfo.szExeFile; sysinfo["FilePath"] = DosDevicePath2LogicalPath(cFull); sysinfo["dwThreads"] = (int)PInfo.cntThreads; sysinfo["dwPriClass"] = (int)GetPriorityClass(hProcess); root.append(sysinfo); bContinue = Process32Next(hSnapshot, &PInfo); } jsondata = writer.write(root); FILE *fp; fp = fopen("aa.txt", "w"); if(fp ==NULL) printf("fails\n"); fprintf(fp, jsondata.c_str()); 2.value["key"] funtion lost aslong(),if value is FileSize. If updated, please notice 674268015@qq.com,Thank you very much.

    Posted 07/27/2014
  • prof-tournesol
    1 of 5 2 of 5 3 of 5 4 of 5 5 of 5

    Ca marche nickel , ça marche sous C++ Builder 6 : utilise les : - conteneur : tableau associatif (map), tableau dynamique (vector) de la STL C++ , - flux de chaînes : stringstream (STL C++) , - string (de la STL C++) . Très bien, y a tout ce qu'il fallait utiliser !! Pour info, je récupère les données de production d'une éolienne en JSON sous la forme : {"Items":[{"Power":"0 W"},{"DailyYield":"0 Wh"},{"TotalYield":"404,54 kWh"}]} {"Items":[{"Power":"0 W"},{"DailyYield":"22 Wh"},{"TotalYield":"576,16 kWh"}]} je décode en C++ Builder6 avec : AnsiString reponse ; // contient la donnée de production éolienne au format JSON JSONValue json ; string power, dailyYield, totalYield ; reponse[ reponse.Length() ] = 0 ; // supprime le '\0' de fin de chaîne de caractères json.decode( reponse.c_str() ) ; if( ! json.empty() ) { power = json["Items"] [0] ["Power"].asString() ; dailyYield = json["Items"] [1] ["DailyYield"].asString() ; totalYield = json["Items"] [2] ["TotalYield"].asString() ; } En javascript, pour décoder du JSON, j'utilise la librairie : json.js Merci beaucoup, ça m'a bien aidé , Did

    Posted 03/07/2014
  • dramele
    1 of 5 2 of 5 3 of 5 4 of 5 5 of 5

    Good library: it can store UTF-8 text without \uXXXX\uXXXX encoding, so .json file is easy to read in text editors. I don't know if this violates some standards, but it is good. Much easier in usage than boost::property_tree::json_read(). The boost can't save/load symbols > 127, it even can't read its own \uXXXX codes. I love root["name"]["name"] syntax of jsoncpp. Also i like that it is GPL-free, because GPL is a virus and not a true freedom. One thing i regret about: there is no long int type, so i have to use double :) Used it in my project: audigger (sourceforce)

    Posted 08/14/2013
  • rusik1978
    1 of 5 2 of 5 3 of 5 4 of 5 5 of 5

    Thanks for great project! Simply the best.Good,good,good.+1

    Posted 05/19/2013
  • sever78
    1 of 5 2 of 5 3 of 5 4 of 5 5 of 5

    very good project, thanks!Good,good,good.+1

    Posted 05/18/2013
Read more reviews

Additional Project Details

Intended Audience

Developers

Programming Language

C++

Registered

2005-07-23

Icons must be PNG, GIF, or JPEG and less than 1 MiB in size. They will be displayed as 48x48 images.