Commit graph

34 commits

Author SHA1 Message Date
Niels Lohmann b21c345179
Reorganize directories (#3462)
* 🚚 move files
* 🚚 rename doc folder to docs
* 🚚 rename test folder to tests
2022-05-01 09:41:50 +02:00
Florian Albrechtskirchinger 5352856f04
Implement support for string_view (attempt no. 3) (#3423)
* Add key_compare member to ordered_map

* Replace == with key_compare in ordered_map

* Expose the actual comparison function used by object_t

nlohmann::ordered_map uses a different comparison function than the one
provided via template parameter.
* Introduce a type trait to detect if object_t has a key_compare member.
* Rename object_comparator_t to default_object_comparator_t.
* Add object_comparator_t to be conditionally defined as
  object_t::key_compare, if available, or default_object_comparator_t
  otherwise.
* Update the documentation accordingly.

Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>

* Add type traits to check if a type is usable as object key

Add type trait to check:
* if a type is a specialization of a template.
* if a type is a json_pointer.
* if a type is a basic_json::{const_,}iterator.
* if two types are comparable using a given comparison functor.
* if a type is comparable to basic_json::object_t::key_type.
* if a type has a member type is_transparent.
* if a type is usable as object key.
* if a type has an erase() function accepting a given KeyType.

Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>

* Rework basic_json element access to accept more key types

Rework basic_json element access member functions and operators to
accept any type that meets the requirements defined by type trait
detail::is_usable_as_key_type.

Member functions and operators:
* at()
* operator[]
* value()
* erase()
* find()
* count()
* contains()

Update documentation to reflect these changes.

Add unit tests to excercise the new functions using std::string_view.

Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>

Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>
2022-04-29 21:40:02 +02:00
Niels Lohmann a6ee8bf9d9
Overwork documentation (#3444)
* 📝 overwork macro documentation

* 📝 address review comments

* 🔧 add style check to Makefile

* 🙈 overwork .gitignore

* 📌 Pygments 2.12.0 is broken

* ✏️ fix links

* 🚸 adjust output to cppcheck

* 📝 add titles to more admonitions

* ✏️ fix typos

* 📝 document future behavior change
2022-04-25 22:40:45 +02:00
Florian Albrechtskirchinger 616caea27a
Re-template json_pointer on string type (#3415)
* Make exception context optional

Change exception context parameter to pointer and replace context with
nullptr where appropriate.

* Support escaping other string types

* Add string concatenation function

Add variadic concat() function for concatenating char *, char, and
string types.

* Replace string concatenations using + with concat()

* Template json_pointer on string type

Change json_pointer from being templated on basic_json to being
templated on string type.

* Add unit test for #3388

Closes #3388.

* Fix regression test for #2958

* Add backwards compatibility with json_pointer<basic_json>

* Update json_pointer docs

* Allow comparing different json_pointers

* Update version numbers
2022-04-12 14:18:16 +02:00
Niels Lohmann 6cd68ebd12
📝 add documentation for JSON Lines (#3247) 2022-01-05 09:51:29 +01:00
Niels Lohmann b5364faf9d
🔖 set version to 3.10.5 2022-01-02 22:35:35 +01:00
Niels Lohmann 29cd970b94
Consolidate documentation (#3071)
* 🔥 consolidate documentation
* ♻️ overwork std specializations
* 🚚 move images files to mkdocs
* ♻️ fix URLs
* 🔧 tweak MkDocs configuration
* 🔧 add namespaces
* 📝 document deprecations
* 📝 document documentation generation
* 🚸 improve search
* 🚸 add examples
* 🚧 start adding documentation for macros
* 📝 add note for https://github.com/nlohmann/json/issues/874#issuecomment-1001699139
* 📝 overwork example handling
* 📝 fix Markdown tables
2021-12-29 13:41:01 +01:00
Niels Lohmann a0863b8c20
📝 add support section 2021-07-17 13:44:54 +02:00
Niels Lohmann cdfe865486
📝 add documentation for numbers 2021-04-28 20:33:05 +02:00
Niels Lohmann d8d8cbf6e0
🔨 fix site URL 2020-12-07 15:30:28 +01:00
Niels Lohmann fe507a7ee8
🚚 remove < from filename to fix Windows build 2020-08-16 21:36:21 +02:00
Niels Lohmann 5c4cc20ed8
📝 add more API documentation 2020-08-16 20:48:10 +02:00
Niels Lohmann a430d25f22
📝 add more API documentation 2020-08-16 14:48:48 +02:00
Niels Lohmann fb5c20134f
📝 add more API documentation 2020-08-16 14:27:26 +02:00
Niels Lohmann d8ed98a7af
📝 add more API documentation 2020-08-15 15:18:07 +02:00
Niels Lohmann f6c2947f1e
📝 add more API documentation 2020-08-14 13:47:54 +02:00
Niels Lohmann 0356e0c75b
📝 add more API documentation 2020-08-14 13:05:16 +02:00
Niels Lohmann 6674561d6a
📝 add more API documentation 2020-08-14 10:48:32 +02:00
Niels Lohmann 298420263b
🚚 remove quotes from filename to fix Windows build 2020-08-13 15:12:41 +02:00
Niels Lohmann dd2fb3b454
📝 add more API documentation 2020-08-13 15:03:28 +02:00
Niels Lohmann ce6adc447a
📝 add more API documentation 2020-08-13 14:04:08 +02:00
Niels Lohmann 178125ff9b
📝 add docset 2020-08-13 10:52:20 +02:00
Niels Lohmann fe89049aee
📝 add more API documentation 2020-08-12 13:41:59 +02:00
Niels Lohmann c006fc9bec
📝 add more documentation 2020-07-27 14:07:13 +02:00
Niels Lohmann 6e5be17b62
📝 add more documentation 2020-07-25 14:40:50 +02:00
Niels Lohmann 58167173a2
📝 add more documentation 2020-07-24 15:25:53 +02:00
Niels Lohmann a84370c61f
📝 add more documentation 2020-07-24 14:04:58 +02:00
Niels Lohmann d740622f96
📝 add documentation for macros 2020-07-09 13:23:33 +02:00
Niels Lohmann 2df5f107a9
📝 add page on parsing and exceptions 2020-06-04 14:01:57 +02:00
Niels Lohmann e3d9b3d755
📝 add documentation of parser callbacks 2020-05-26 14:16:13 +02:00
Niels Lohmann 95a3c76643
📝 make examples collapsible 2020-05-24 22:45:38 +02:00
Niels Lohmann ddf92606ab
📝 add PlantUML 2020-05-24 21:05:35 +02:00
Niels Lohmann 3400af21cd
📝 add release page 2020-05-24 13:40:43 +02:00
Niels Lohmann a8f0cd15df
📝 add mkdocs 2020-05-24 13:03:04 +02:00