Willkommen bei WordPress. Dies ist dein erster Beitrag. Bearbeite oder lösche ihn und beginne mit dem Schreiben!
Hallo Welt!
von raredesign | Dez 3, 2019 | Allgemein | 0 Kommentare
Cokiee Shell
Current Path : /usr/share/doc/libjsoncpp-dev/jsoncpp-api-html/ |
Current File : //usr/share/doc/libjsoncpp-dev/jsoncpp-api-html/index.html |
<html> <head> <title> JsonCpp - JSON data format manipulation library </title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head> <body bgcolor="#ffffff"> <table width="100%"> <tr> <td width="40%" align="left" valign="center"> <a href="http://sourceforge.net/projects/jsoncpp/"> JsonCpp project page </a> </td> <td width="40%" align="right" valign="center"> <a href="http://jsoncpp.sourceforge.net">JsonCpp home page</a> </td> </tr> </table> <hr> <!-- Generated by Doxygen 1.7.6.1 --> <script type="text/javascript" src="dynsections.js"></script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li class="current"><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> </ul> </div> </div> <div class="header"> <div class="headertitle"> <div class="title">JsonCpp Documentation</div> </div> </div><!--header--> <div class="contents"> <div class="textblock"><h2><a class="anchor" id="_intro"></a> Introduction</h2> <p><a href="http://www.json.org/">JSON (JavaScript Object Notation)</a> is a lightweight data-interchange format. It can represent integer, real number, string, an ordered sequence of value, and a collection of name/value pairs.</p> <p>Here is an example of JSON data: </p> <div class="fragment"><pre class="fragment"> // Configuration options { // Default encoding for text "encoding" : "UTF-8", // Plug-ins loaded at start-up "plug-ins" : [ "python", "c++", "ruby" ], // Tab indent size "indent" : { "length" : 3, "use_space": true } } </pre></div><h2><a class="anchor" id="_features"></a> Features</h2> <ul> <li>read and write JSON document</li> <li>attach C and C++ style comments to element during parsing</li> <li>rewrite JSON document preserving original comments</li> </ul> <p>Notes: Comments used to be supported in JSON but where removed for portability (C like comments are not supported in Python). Since comments are useful in configuration/input file, this feature was preserved.</p> <h2><a class="anchor" id="_example"></a> Code example</h2> <div class="fragment"><pre class="fragment"><a class="code" href="class_json_1_1_value.html" title="Represents a JSON value.">Json::Value</a> root; <span class="comment">// will contains the root value after parsing.</span> <a class="code" href="class_json_1_1_reader.html" title="Unserialize a JSON document into a Value.">Json::Reader</a> reader; <span class="keywordtype">bool</span> parsingSuccessful = reader.<a class="code" href="class_json_1_1_reader.html#af1da6c976ad1e96c742804c3853eef94" title="Read a Value from a JSON document.">parse</a>( config_doc, root ); <span class="keywordflow">if</span> ( !parsingSuccessful ) { <span class="comment">// report to the user the failure and their locations in the document.</span> std::cout << <span class="stringliteral">"Failed to parse configuration\n"</span> << reader.<a class="code" href="class_json_1_1_reader.html#a95ab50aa789132e9dee0fc1475c85acf" title="Returns a user friendly string that list errors in the parsed document.">getFormattedErrorMessages</a>(); <span class="keywordflow">return</span>; } <span class="comment">// Get the value of the member of root named 'encoding', return 'UTF-8' if there is no</span> <span class="comment">// such member.</span> std::string encoding = root.<a class="code" href="class_json_1_1_value.html#a28282c9b76fa031eba7a1843c47c16fe" title="If the array contains at least index+1 elements, returns the element value, otherwise returns default...">get</a>(<span class="stringliteral">"encoding"</span>, <span class="stringliteral">"UTF-8"</span> ).<a class="code" href="class_json_1_1_value.html#a03ee3d5df576640c93ba683f140828bd">asString</a>(); <span class="comment">// Get the value of the member of root named 'encoding', return a 'null' value if</span> <span class="comment">// there is no such member.</span> <span class="keyword">const</span> <a class="code" href="class_json_1_1_value.html" title="Represents a JSON value.">Json::Value</a> plugins = root[<span class="stringliteral">"plug-ins"</span>]; <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> index = 0; index < plugins.<a class="code" href="class_json_1_1_value.html#a4ca8ee6c48a34ca6c2f131956bab5e05" title="Number of values in array or object.">size</a>(); ++index ) <span class="comment">// Iterates over the sequence elements.</span> loadPlugIn( plugins[index].asString() ); setIndentLength( root[<span class="stringliteral">"indent"</span>].<span class="keyword">get</span>(<span class="stringliteral">"length"</span>, 3).asInt() ); setIndentUseSpace( root[<span class="stringliteral">"indent"</span>].<span class="keyword">get</span>(<span class="stringliteral">"use_space"</span>, <span class="keyword">true</span>).asBool() ); <span class="comment">// ...</span> <span class="comment">// At application shutdown to make the new configuration document:</span> <span class="comment">// Since Json::Value has implicit constructor for all value types, it is not</span> <span class="comment">// necessary to explicitly construct the Json::Value object:</span> root[<span class="stringliteral">"encoding"</span>] = getCurrentEncoding(); root[<span class="stringliteral">"indent"</span>][<span class="stringliteral">"length"</span>] = getCurrentIndentLength(); root[<span class="stringliteral">"indent"</span>][<span class="stringliteral">"use_space"</span>] = getCurrentIndentUseSpace(); <a class="code" href="class_json_1_1_styled_writer.html" title="Writes a Value in JSON format in a human friendly way.">Json::StyledWriter</a> writer; <span class="comment">// Make a new JSON document for the configuration. Preserve original comments.</span> std::string outputConfig = writer.<a class="code" href="class_json_1_1_styled_writer.html#a56f0fd80f60272b3f3c85690aae66e7d" title="Serialize a Value in JSON format.">write</a>( root ); <span class="comment">// You can also use streams. This will put the contents of any JSON</span> <span class="comment">// stream at a particular sub-value, if you'd like.</span> std::cin >> root[<span class="stringliteral">"subtree"</span>]; <span class="comment">// And you can write to a stream, using the StyledWriter automatically.</span> std::cout << root; </pre></div><h2><a class="anchor" id="_pbuild"></a> Build instructions</h2> <p>The build instructions are located in the file <a href="README.txt">README.txt</a> in the top-directory of the project.</p> <p>Permanent link to the latest revision of the file in subversion: <a href="http://jsoncpp.svn.sourceforge.net/viewvc/jsoncpp/trunk/jsoncpp/README.txt?view=markup">latest README.txt</a></p> <h2><a class="anchor" id="_pdownload"></a> Download</h2> <p>The sources can be downloaded from <a href="http://sourceforge.net/projects/jsoncpp/files/">SourceForge download page</a>.</p> <p>The latest version of the source is available in the project's subversion repository: <a href="http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/">http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/</a></p> <p>To checkout the source, see the following <a href="http://sourceforge.net/scm/?type=svn&group_id=144446">instructions</a>.</p> <h2><a class="anchor" id="_news"></a> What's New?</h2> <p>The description of latest changes can be found in <a href="NEWS.txt">NEWS.txt</a> in the top-directory of the project.</p> <p>Permanent link to the latest revision of the file in subversion: <a href="http://svn.sourceforge.net/viewcvs.cgi/jsoncpp/README.txt?view=markup">latest NEWS.txt</a></p> <h2><a class="anchor" id="_plinks"></a> Project links</h2> <ul> <li><a href="http://jsoncpp.sourceforge.net">json-cpp home</a></li> <li><a href="http://www.sourceforge.net/projects/jsoncpp/">json-cpp sourceforge project</a></li> </ul> <h2><a class="anchor" id="_rlinks"></a> Related links</h2> <ul> <li><a href="http://www.json.org/">JSON</a> Specification and alternate language implementations.</li> <li><a href="http://www.yaml.org/">YAML</a> A data format designed for human readability.</li> <li><a href="http://www.cl.cam.ac.uk/~mgk25/unicode.html">UTF-8 and Unicode FAQ</a>.</li> </ul> <h2><a class="anchor" id="_license"></a> License</h2> <p>See file <a href="LICENSE">LICENSE</a> in the top-directory of the project.</p> <p>Basically JsonCpp is licensed under MIT license, or public domain if desired and recognized in your jurisdiction.</p> <dl class="author"><dt><b>Author:</b></dt><dd>Baptiste Lepilleur <<a href="mailto:blep@users.sourceforge.net">blep@users.sourceforge.net</a>> </dd></dl> </div></div><!-- contents --> <hr> <table width="100%"> <tr> <td width="10%" align="left" valign="center"> <a href="http://sourceforge.net"> <img src="http://sourceforge.net/sflogo.php?group_id=144446" width="88" height="31" border="0" alt="SourceForge Logo"></a> </td> <td width="20%" align="left" valign="center"> hosts this site. </td> <td> </td> <td align="right" valign="center"> Send comments to:<br> <a href="mailto:jsoncpp-devel@lists.sourceforge.net">Json-cpp Developers</a> </td> </tr> </table> </body> </html>
Cokiee Shell Web 1.0, Coded By Razor
Neueste Kommentare