add online examples
This commit is contained in:
parent
540c58964d
commit
5ae2babf61
81 changed files with 239 additions and 1 deletions
31
doc/examples/README.cpp
Normal file
31
doc/examples/README.cpp
Normal file
|
@ -0,0 +1,31 @@
|
|||
#include <json.hpp>
|
||||
|
||||
using namespace nlohmann;
|
||||
|
||||
int main()
|
||||
{
|
||||
// create a JSON object
|
||||
json j = {
|
||||
{"pi", 3.141},
|
||||
{"happy", true},
|
||||
{"name", "Niels"},
|
||||
{"nothing", nullptr},
|
||||
{"answer", {
|
||||
{"everything", 42}
|
||||
}},
|
||||
{"list", {1, 0, 2}},
|
||||
{"object", {
|
||||
{"currency", "USD"},
|
||||
{"value", 42.99}
|
||||
}}
|
||||
};
|
||||
|
||||
// add new values
|
||||
j["new"]["key"]["value"] = {"another", "list"};
|
||||
|
||||
// count elements
|
||||
j["size"] = j.size();
|
||||
|
||||
// pretty print with indent of 4 spaces
|
||||
std::cout << std::setw(4) << j << '\n';
|
||||
}
|
1
doc/examples/README.link
Normal file
1
doc/examples/README.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/GnGKwji06WeVonlI"><b>online</b></a>
|
1
doc/examples/array.link
Normal file
1
doc/examples/array.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/NeN8wmHsQGxFXC6L"><b>online</b></a>
|
1
doc/examples/at__object_t_key_type.link
Normal file
1
doc/examples/at__object_t_key_type.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/syN4hQrhPvlUy5AG"><b>online</b></a>
|
1
doc/examples/at__object_t_key_type_const.link
Normal file
1
doc/examples/at__object_t_key_type_const.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/zwOKkXrKstDlMPjr"><b>online</b></a>
|
1
doc/examples/at__size_type.link
Normal file
1
doc/examples/at__size_type.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/wKBBW3ORmTHPlgJV"><b>online</b></a>
|
1
doc/examples/at__size_type_const.link
Normal file
1
doc/examples/at__size_type_const.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/Ti47m4DY2lV4SWNV"><b>online</b></a>
|
1
doc/examples/back.link
Normal file
1
doc/examples/back.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/zB9tSkSVYIthfgj6"><b>online</b></a>
|
1
doc/examples/basic_json.link
Normal file
1
doc/examples/basic_json.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/Hrajl95QUa1Lplou"><b>online</b></a>
|
1
doc/examples/basic_json__CompatibleArrayType.link
Normal file
1
doc/examples/basic_json__CompatibleArrayType.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/vyrjruntW4ASDBKH"><b>online</b></a>
|
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/cyithYO7sPbXxK16"><b>online</b></a>
|
1
doc/examples/basic_json__CompatibleNumberFloatType.link
Normal file
1
doc/examples/basic_json__CompatibleNumberFloatType.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/yO6SWuP9bEYvNEvX"><b>online</b></a>
|
1
doc/examples/basic_json__CompatibleObjectType.link
Normal file
1
doc/examples/basic_json__CompatibleObjectType.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/FCiYtNwovQ84DWxl"><b>online</b></a>
|
1
doc/examples/basic_json__CompatibleStringType.link
Normal file
1
doc/examples/basic_json__CompatibleStringType.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/h8c1hfORMnVrJ1Ky"><b>online</b></a>
|
1
doc/examples/basic_json__InputIt_InputIt.link
Normal file
1
doc/examples/basic_json__InputIt_InputIt.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/z2P1DpA8uSSlwgTl"><b>online</b></a>
|
1
doc/examples/basic_json__array_t.link
Normal file
1
doc/examples/basic_json__array_t.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/vwVgsv7w6YZUgctJ"><b>online</b></a>
|
1
doc/examples/basic_json__basic_json.link
Normal file
1
doc/examples/basic_json__basic_json.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/wwzBU7cK8Xr2yiKJ"><b>online</b></a>
|
1
doc/examples/basic_json__boolean_t.link
Normal file
1
doc/examples/basic_json__boolean_t.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/RzWnqhbfuvbHXCBJ"><b>online</b></a>
|
1
doc/examples/basic_json__const_int.link
Normal file
1
doc/examples/basic_json__const_int.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/BPk4vUc4kJPWX0rz"><b>online</b></a>
|
1
doc/examples/basic_json__copyassignment.link
Normal file
1
doc/examples/basic_json__copyassignment.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/P8QWpucrWhov8JRR"><b>online</b></a>
|
1
doc/examples/basic_json__list_init_t.link
Normal file
1
doc/examples/basic_json__list_init_t.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/IWIZSNthuHrT3AS6"><b>online</b></a>
|
1
doc/examples/basic_json__moveconstructor.link
Normal file
1
doc/examples/basic_json__moveconstructor.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/dvTtz7DIo8TDhYE6"><b>online</b></a>
|
1
doc/examples/basic_json__nullptr_t.link
Normal file
1
doc/examples/basic_json__nullptr_t.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/hcERmrPzjmXeSzB8"><b>online</b></a>
|
1
doc/examples/basic_json__number_float_t.link
Normal file
1
doc/examples/basic_json__number_float_t.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/47cqX7AduSWn24lA"><b>online</b></a>
|
1
doc/examples/basic_json__number_integer_t.link
Normal file
1
doc/examples/basic_json__number_integer_t.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/RUSNdk5YEAr2vL4E"><b>online</b></a>
|
1
doc/examples/basic_json__object_t.link
Normal file
1
doc/examples/basic_json__object_t.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/4IF0ofRq0nZcV8pI"><b>online</b></a>
|
1
doc/examples/basic_json__size_type_basic_json.link
Normal file
1
doc/examples/basic_json__size_type_basic_json.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/dkznQmTMqulurCqD"><b>online</b></a>
|
1
doc/examples/basic_json__string_t.link
Normal file
1
doc/examples/basic_json__string_t.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/S9jwK28ThNIGkdUI"><b>online</b></a>
|
1
doc/examples/basic_json__string_t_value_type.link
Normal file
1
doc/examples/basic_json__string_t_value_type.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/xNtouqvB2OJBOwkv"><b>online</b></a>
|
1
doc/examples/basic_json__value_t.link
Normal file
1
doc/examples/basic_json__value_t.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/ncOG8fdxNrISUNFj"><b>online</b></a>
|
1
doc/examples/begin.link
Normal file
1
doc/examples/begin.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/Nwb94PEGlvnjrqj1"><b>online</b></a>
|
1
doc/examples/cbegin.link
Normal file
1
doc/examples/cbegin.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/mWrMi5IrJjRILgir"><b>online</b></a>
|
1
doc/examples/cend.link
Normal file
1
doc/examples/cend.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/0OHrFwFGvRuDKdfx"><b>online</b></a>
|
1
doc/examples/clear.link
Normal file
1
doc/examples/clear.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/Ddggfbg18WXOIBkW"><b>online</b></a>
|
1
doc/examples/count.link
Normal file
1
doc/examples/count.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/mPQHwiNeVa872Aky"><b>online</b></a>
|
1
doc/examples/crbegin.link
Normal file
1
doc/examples/crbegin.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/XA8jRF4u0UBKMVKT"><b>online</b></a>
|
1
doc/examples/crend.link
Normal file
1
doc/examples/crend.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/XHuFmdmwqZ7Tdw2U"><b>online</b></a>
|
1
doc/examples/dump.link
Normal file
1
doc/examples/dump.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/tkZFGPekIFMEQYY0"><b>online</b></a>
|
1
doc/examples/empty.link
Normal file
1
doc/examples/empty.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/8vK2Qdo2tJk3loVq"><b>online</b></a>
|
1
doc/examples/end.link
Normal file
1
doc/examples/end.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/PTRnmRsywWUoknqU"><b>online</b></a>
|
1
doc/examples/erase__IteratorType.link
Normal file
1
doc/examples/erase__IteratorType.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/iqtEFeReXatgjqHy"><b>online</b></a>
|
1
doc/examples/erase__IteratorType_IteratorType.link
Normal file
1
doc/examples/erase__IteratorType_IteratorType.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/4ZSaQAFaqyN8Vhop"><b>online</b></a>
|
1
doc/examples/erase__key_type.link
Normal file
1
doc/examples/erase__key_type.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/vQ4ipI1dlW8IZhNh"><b>online</b></a>
|
1
doc/examples/erase__size_type.link
Normal file
1
doc/examples/erase__size_type.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/foNekpKoDDTEfKuy"><b>online</b></a>
|
1
doc/examples/find__key_type.link
Normal file
1
doc/examples/find__key_type.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/q5oRles9a6IgEOkD"><b>online</b></a>
|
1
doc/examples/front.link
Normal file
1
doc/examples/front.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/OvihNTNV4XPwoSw8"><b>online</b></a>
|
1
doc/examples/get__PointerType.link
Normal file
1
doc/examples/get__PointerType.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/fdsMCtY67vLJrlzv"><b>online</b></a>
|
1
doc/examples/get__ValueType_const.link
Normal file
1
doc/examples/get__ValueType_const.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/4OkGAXhiCsa1E5Jx"><b>online</b></a>
|
1
doc/examples/get_ptr.link
Normal file
1
doc/examples/get_ptr.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/Ka7Efl5Jo2FTDy69"><b>online</b></a>
|
1
doc/examples/is_array.link
Normal file
1
doc/examples/is_array.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/pX9pR42isGha24Up"><b>online</b></a>
|
1
doc/examples/is_boolean.link
Normal file
1
doc/examples/is_boolean.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/yBDoHvFIsRqoo7Ca"><b>online</b></a>
|
1
doc/examples/is_null.link
Normal file
1
doc/examples/is_null.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/CwckRKEAALOpqiq7"><b>online</b></a>
|
1
doc/examples/is_number.link
Normal file
1
doc/examples/is_number.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/xVKMzHSvo4XHFyxV"><b>online</b></a>
|
1
doc/examples/is_number_float.link
Normal file
1
doc/examples/is_number_float.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/SbPvCBbOwWkIH5RX"><b>online</b></a>
|
1
doc/examples/is_number_integer.link
Normal file
1
doc/examples/is_number_integer.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/CVMYqyeIFOKcBZZU"><b>online</b></a>
|
1
doc/examples/is_object.link
Normal file
1
doc/examples/is_object.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/uXT6peoqwN6DIFAr"><b>online</b></a>
|
1
doc/examples/is_primitive.link
Normal file
1
doc/examples/is_primitive.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/f5AMxY70IoQ4o0wb"><b>online</b></a>
|
1
doc/examples/is_string.link
Normal file
1
doc/examples/is_string.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/ILh5L9NsOSQ29Cg4"><b>online</b></a>
|
1
doc/examples/is_structured.link
Normal file
1
doc/examples/is_structured.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/D9WgQUo2eieU7kqs"><b>online</b></a>
|
1
doc/examples/max_size.link
Normal file
1
doc/examples/max_size.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/RLNomTjexFIzyUx4"><b>online</b></a>
|
1
doc/examples/object.link
Normal file
1
doc/examples/object.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/kQKYwNmQRJAJhCTe"><b>online</b></a>
|
1
doc/examples/operator__ValueType.link
Normal file
1
doc/examples/operator__ValueType.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/PK8Jc2HcZ1MdHOFH"><b>online</b></a>
|
1
doc/examples/operator__value_t.link
Normal file
1
doc/examples/operator__value_t.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/OTJgTuHDjzQlrONB"><b>online</b></a>
|
1
doc/examples/operator_deserialize.link
Normal file
1
doc/examples/operator_deserialize.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/q0DrCAa87X0xR7vu"><b>online</b></a>
|
1
doc/examples/operator_serialize.link
Normal file
1
doc/examples/operator_serialize.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/t8kFPBs2j2mN6VBc"><b>online</b></a>
|
1
doc/examples/operatorarray__key_type.link
Normal file
1
doc/examples/operatorarray__key_type.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/NjX5TeaQdGHer7Xu"><b>online</b></a>
|
1
doc/examples/operatorarray__key_type_const.link
Normal file
1
doc/examples/operatorarray__key_type_const.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/9X5Q8p7DlWA6v0Ey"><b>online</b></a>
|
1
doc/examples/operatorarray__size_type.link
Normal file
1
doc/examples/operatorarray__size_type.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/x5eACUyqALnEmtJa"><b>online</b></a>
|
1
doc/examples/operatorarray__size_type_const.link
Normal file
1
doc/examples/operatorarray__size_type_const.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/eyDuHRe4RnWdGv2o"><b>online</b></a>
|
1
doc/examples/parse__istream__parser_callback_t.link
Normal file
1
doc/examples/parse__istream__parser_callback_t.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/2ZxOGwFs5YLdSOlG"><b>online</b></a>
|
1
doc/examples/parse__string__parser_callback_t.link
Normal file
1
doc/examples/parse__string__parser_callback_t.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/XD9GkEmVZI9ecPEL"><b>online</b></a>
|
1
doc/examples/rbegin.link
Normal file
1
doc/examples/rbegin.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/qVpSdd1SQJeMkVQQ"><b>online</b></a>
|
1
doc/examples/rend.link
Normal file
1
doc/examples/rend.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/7oaTSGkGGPAiGxSU"><b>online</b></a>
|
1
doc/examples/size.link
Normal file
1
doc/examples/size.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/GozebkNWdjby4a8N"><b>online</b></a>
|
1
doc/examples/swap__array_t.link
Normal file
1
doc/examples/swap__array_t.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/qHbCdOUwZK6INFH8"><b>online</b></a>
|
1
doc/examples/swap__reference.link
Normal file
1
doc/examples/swap__reference.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/TKgXGJF9Cr5TXabd"><b>online</b></a>
|
1
doc/examples/type.link
Normal file
1
doc/examples/type.link
Normal file
|
@ -0,0 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/bYygSYwOFyTzN2Py"><b>online</b></a>
|
Loading…
Add table
Add a link
Reference in a new issue