124 lines (98 with data), 4.6 kB
/**
\mainpage
\section _intro Introduction
<a HREF="/?originalUrl=https%3A%2F%2Fsourceforge.net%2F%26%2334%3Bhttp%3A%2F%2Fwww.json.org%2F%26%2334%3B%26gt%3BJSON%2520(JavaScript%2520Object%2520Notation)%26lt%3B%2Fa%26gt%3B%2520is%2520a%2520lightweight%2520data-interchange%2520format.%2520It%2520can%2520represent%2520integer%2C%2520real%2520number%2C%2520string%2C%2520an%2520ordered%2520sequence%2520of%2520value%2C%2520anda%2520collection%2520of%2520name%2Fvalue%2520pairs.Here%2520is%2520an%2520example%2520of%2520JSON%2520data%3A%5Cverbatim%2F%2F%2520Configuration%2520options%7B%2520%2520%2520%2520%2F%2F%2520Default%2520encoding%2520for%2520text%2520%2520%2520%2520%26%2334%3Bencoding%26%2334%3B%2520%3A%2520%26%2334%3BUTF-8%26%2334%3B%2C%2520%2520%2520%2520%2520%2520%2520%2520%2F%2F%2520Plug-ins%2520loaded%2520at%2520start-up%2520%2520%2520%2520%26%2334%3Bplug-ins%26%2334%3B%2520%3A%2520%5B%2520%2520%2520%2520%2520%2520%2520%2520%26%2334%3Bpython%26%2334%3B%2C%2520%2520%2520%2520%2520%2520%2520%2520%26%2334%3Bc%2B%2B%26%2334%3B%2C%2520%2520%2520%2520%2520%2520%2520%2520%26%2334%3Bruby%26%2334%3B%2520%2520%2520%2520%2520%2520%2520%2520%5D%2C%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2F%2F%2520Tab%2520indent%2520size%2520%2520%2520%2520%26%2334%3Bindent%26%2334%3B%2520%3A%2520%7B%2520%26%2334%3Blength%26%2334%3B%2520%3A%25203%2C%2520%26%2334%3Buse_space%26%2334%3B%2520%3D%2520true%2520%7D%7D%5Cendverbatim%5Csection%2520_features%2520Features-%2520read%2520and%2520write%2520JSON%2520document-%2520attach%2520C%2520and%2520C%2B%2B%2520style%2520comments%2520to%2520element%2520during%2520parsing-%2520rewrite%2520JSON%2520document%2520preserving%2520original%2520commentsNotes%3A%2520Comments%2520used%2520to%2520be%2520supported%2520in%2520JSON%2520but%2520where%2520removed%2520for%2520portability%2520(C%2520like%2520comments%2520are%2520not%2520supported%2520in%2520Python).%2520Sincecomments%2520are%2520useful%2520in%2520configuration%2Finput%2520file%2C%2520this%2520feature%2520waspreserved.%5Csection%2520_example%2520Code%2520example%5CcodeJson%3A%3AValue%2520root%3B%2520%2520%2520%2F%2F%2520will%2520contains%2520the%2520root%2520value%2520after%2520parsing.Json%3A%3AReader%2520reader%3Bbool%2520parsingSuccessful%2520%3D%2520reader.parse(%2520config_doc%2C%2520root%2520)%3Bif%2520(%2520!parsingSuccessful%2520)%7B%2520%2520%2520%2520%2F%2F%2520report%2520to%2520the%2520user%2520the%2520failure%2520and%2520their%2520locations%2520in%2520the%2520document.%2520%2520%2520%2520std%3A%3Acout%2520%2520%26lt%3B%26lt%3B%2520%26%2334%3BFailed%2520to%2520parse%2520configuration%5Cn%26%2334%3B%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%26lt%3B%26lt%3B%2520reader.getFormatedErrorMessages()%3B%2520%2520%2520%2520return%3B%7D%2F%2F%2520Get%2520the%2520value%2520of%2520the%2520member%2520of%2520root%2520named%2520%26%2339%3Bencoding%26%2339%3B%2C%2520return%2520%26%2339%3BUTF-8%26%2339%3B%2520if%2520there%2520is%2520no%2F%2F%2520such%2520member.std%3A%3Astring%2520encoding%2520%3D%2520root.get(%26%2334%3Bencoding%26%2334%3B%2C%2520%26%2334%3BUTF-8%26%2334%3B%2520).asString()%3B%2F%2F%2520Get%2520the%2520value%2520of%2520the%2520member%2520of%2520root%2520named%2520%26%2339%3Bencoding%26%2339%3B%2C%2520return%2520a%2520%26%2339%3Bnull%26%2339%3B%2520value%2520if%2F%2F%2520there%2520is%2520no%2520such%2520member.const%2520Json%3A%3AValue%2520plugins%2520%3D%2520root%5B%26%2334%3Bplug-ins%26%2334%3B%5D%3Bfor%2520(%2520int%2520index%2520%3D%25200%3B%2520index%2520%26lt%3B%2520plugins.size()%3B%2520%2B%2Bindex%2520)%2520%2520%2F%2F%2520Iterates%2520over%2520the%2520sequence%2520elements.%2520%2520%2520loadPlugIn(%2520plugins%5Bindex%5D.asString()%2520)%3B%2520%2520%2520setIndentLength(%2520root%5B%26%2334%3Bindent%26%2334%3B%5D.get(%26%2334%3Blength%26%2334%3B%2C%25203).asInt()%2520)%3BsetIndentUseSpace(%2520root%5B%26%2334%3Bindent%26%2334%3B%5D.get(%26%2334%3Buse_space%26%2334%3B%2C%2520true).asBool()%2520)%3B%2F%2F%2520...%2F%2F%2520At%2520application%2520shutdown%2520to%2520make%2520the%2520new%2520configuration%2520document%3A%2F%2F%2520Since%2520Json%3A%3AValue%2520has%2520implicit%2520constructor%2520for%2520all%2520value%2520types%2C%2520it%2520is%2520not%2F%2F%2520necessary%2520to%2520explicitly%2520construct%2520the%2520Json%3A%3AValue%2520object%3Aroot%5B%26%2334%3Bencoding%26%2334%3B%5D%2520%3D%2520getCurrentEncoding()%3Broot%5B%26%2334%3Bindent%26%2334%3B%5D%5B%26%2334%3Blength%26%2334%3B%5D%2520%3D%2520getCurrentIndentLength()%3Broot%5B%26%2334%3Bindent%26%2334%3B%5D%5B%26%2334%3Buse_space%26%2334%3B%5D%2520%3D%2520getCurrentIndentUseSpace()%3BJson%3A%3AStyledWriter%2520writer%3B%2F%2F%2520Make%2520a%2520new%2520JSON%2520document%2520for%2520the%2520configuration.%2520Preserve%2520original%2520comments.std%3A%3Astring%2520outputConfig%2520%3D%2520writer.write(%2520root%2520)%3B%2F%2F%2520You%2520can%2520also%2520use%2520streams.%2520%2520This%2520will%2520put%2520the%2520contents%2520of%2520any%2520JSON%2F%2F%2520stream%2520at%2520a%2520particular%2520sub-value%2C%2520if%2520you%26%2339%3Bd%2520like.std%3A%3Acin%2520%26gt%3B%26gt%3B%2520root%5B%26%2334%3Bsubtree%26%2334%3B%5D%3B%2F%2F%2520And%2520you%2520can%2520write%2520to%2520a%2520stream%2C%2520using%2520the%2520StyledWriter%2520automatically.std%3A%3Acout%2520%26lt%3B%26lt%3B%2520root%3B%5Cendcode%5Csection%2520_pbuild%2520Build%2520instructionsThe%2520build%2520instructions%2520are%2520located%2520in%2520the%2520file%2520%26lt%3Ba%2520HREF%3D%26%2334%3BREADME.txt%26%2334%3B%26gt%3BREADME.txt%26lt%3B%2Fa%26gt%3B%2520in%2520the%2520top-directory%2520of%2520the%2520project.Permanent%2520link%2520to%2520the%2520latest%2520revision%2520of%2520the%2520file%2520in%2520subversion%3A%2520%26lt%3Ba%2520HREF%3D%26%2334%3Bhttp%3A%2F%2Fsvn.sourceforge.net%2Fviewcvs.cgi%2Fjsoncpp%2FREADME.txt%3Fview%3Dmarkup%26%2334%3B%26gt%3Blatest%2520README.txt%26lt%3B%2Fa%26gt%3B%5Csection%2520_pdownload%2520DownloadThe%2520sources%2520can%2520be%2520downloaded%2520from%2520%26lt%3Ba%2520HREF%3D%26%2334%3Bhttp%3A%2F%2Fsourceforge.net%2Fprojects%2Fjsoncpp%2Ffiles%2F%26%2334%3B%26gt%3BSourceForge%2520download%2520page%26lt%3B%2Fa%26gt%3B.The%2520latest%2520version%2520of%2520the%2520source%2520is%2520available%2520in%2520the%2520project%26%2339%3Bs%2520subversion%2520repository%3A%2520%26lt%3Ba%2520HREF%3D%26%2334%3Bhttp%3A%2F%2Fjsoncpp.svn.sourceforge.net%2Fsvnroot%2Fjsoncpp%2Ftrunk%2F%26%2334%3B%26gt%3Bhttp%3A%2F%2Fjsoncpp.svn.sourceforge.net%2Fsvnroot%2Fjsoncpp%2Ftrunk%2F%26lt%3B%2Fa%26gt%3BTo%2520checkout%2520the%2520source%2C%2520see%2520the%2520following%2520%26lt%3Ba%2520HREF%3D%26%2334%3Bhttp%3A%2F%2Fsourceforge.net%2Fscm%2F%3Ftype%3Dsvn%26amp%3Bgroup_id%3D144446%26%2334%3B%26gt%3Binstructions%26lt%3B%2Fa%26gt%3B.%5Csection%2520_news%2520What%26%2339%3Bs%2520New%3FThe%2520description%2520of%2520latest%2520changes%2520can%2520be%2520found%2520in%2520%26lt%3Ba%2520HREF%3D%26%2334%3BNEWS.txt%26%2334%3B%26gt%3BNEWS.txt%26lt%3B%2Fa%26gt%3B%2520in%2520the%2520top-directory%2520of%2520the%2520project.Permanent%2520link%2520to%2520the%2520latest%2520revision%2520of%2520the%2520file%2520in%2520subversion%3A%2520%26lt%3Ba%2520HREF%3D%26%2334%3Bhttp%3A%2F%2Fsvn.sourceforge.net%2Fviewcvs.cgi%2Fjsoncpp%2FREADME.txt%3Fview%3Dmarkup%26%2334%3B%26gt%3Blatest%2520NEWS.txt%26lt%3B%2Fa%26gt%3B%5Csection%2520_plinks%2520Project%2520links-%2520%26lt%3Ba%2520HREF%3D%26%2334%3Bhttp%3A%2F%2Fjsoncpp.sourceforge.net%26%2334%3B%26gt%3Bjson-cpp%2520home%26lt%3B%2Fa%26gt%3B-%2520%26lt%3Ba%2520HREF%3D%26%2334%3Bhttp%3A%2F%2Fwww.sourceforge.net%2Fprojects%2Fjsoncpp%26%2334%3B%26gt%3Bjson-cpp%2520sourceforge%2520project%26lt%3B%2Fa%26gt%3B%5Csection%2520_rlinks%2520Related%2520links-%2520%26lt%3Ba%2520HREF%3D%26%2334%3Bhttp%3A%2F%2Fwww.json.org%2F%26%2334%3B%26gt%3BJSON%26lt%3B%2Fa%26gt%3B%2520Specification%2520and%2520alternate%2520language%2520implementations.-%2520%26lt%3Ba%2520HREF%3D%26%2334%3Bhttp%3A%2F%2Fwww.yaml.org%2F%26%2334%3B%26gt%3BYAML%26lt%3B%2Fa%26gt%3B%2520A%2520data%2520format%2520designed%2520for%2520human%2520readability.-%2520%26lt%3Ba%2520HREF%3D%26%2334%3Bhttp%3A%2F%2Fwww.cl.cam.ac.uk%2F~mgk25%2Funicode.html%26%2334%3B%26gt%3BUTF-8%2520and%2520Unicode%2520FAQ%26lt%3B%2Fa%26gt%3B.%5Csection%2520_license%2520LicenseThe%2520json-cpp%2520library%2520and%2520this%2520documentation%2520are%2520in%2520Public%2520Domain.%5Cauthor%2520Baptiste%2520Lepilleur%2520%26lt%3Bblep%40users.sourceforge.net%26gt%3B*%2F%253C%2Fpre">