Showing preview only (890K chars total). Download the full file or copy to clipboard to get everything.
Repository: WerWolv/Hekate-Toolbox
Branch: master
Commit: c3a9be6158e1
Files: 43
Total size: 862.2 KB
Directory structure:
gitextract_nw10eimf/
├── .gitignore
├── .gitmodules
├── LICENSE
├── Makefile
├── README.md
├── include/
│ ├── ams_bpc.h
│ ├── gui/
│ │ ├── button.hpp
│ │ ├── gui.hpp
│ │ ├── gui_hekate.hpp
│ │ ├── gui_main.hpp
│ │ ├── gui_override_key.hpp
│ │ ├── gui_overrides_menu.hpp
│ │ ├── gui_sysmodule.hpp
│ │ ├── gui_title_list.hpp
│ │ ├── list_selector.hpp
│ │ ├── message_box.hpp
│ │ └── theme.h
│ ├── service_guard.h
│ └── utils/
│ ├── jpeg.hpp
│ ├── json.hpp
│ ├── override_key.hpp
│ ├── threads.hpp
│ ├── titleinfo.hpp
│ ├── types.h
│ └── utils.hpp
└── source/
├── ams_bpc.c
├── gui/
│ ├── button.cpp
│ ├── gui.cpp
│ ├── gui_hekate.cpp
│ ├── gui_main.cpp
│ ├── gui_override_key.cpp
│ ├── gui_overrides_menu.cpp
│ ├── gui_sysmodule.cpp
│ ├── gui_title_list.cpp
│ ├── list_selector.cpp
│ ├── message_box.cpp
│ └── theme.c
├── main.cpp
└── utils/
├── jpeg.cpp
├── override_key.cpp
├── threads.cpp
├── titleinfo.cpp
└── utils.cpp
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
###################
#.gitignore #
###################
build/
out/
.vscode/
.build-tools.cson
*.kip
*.elf
================================================
FILE: .gitmodules
================================================
[submodule "SimpleIniParser"]
path = SimpleIniParser
url = https://github.com/NicholeMattera/Simple-INI-Parser.git
================================================
FILE: LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
================================================
FILE: Makefile
================================================
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPRO)),)
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>/devkitpro")
endif
TOPDIR ?= $(CURDIR)
include $(DEVKITPRO)/libnx/switch_rules
#---------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# DATA is a list of directories containing data files
# INCLUDES is a list of directories containing header files
# EXEFS_SRC is the optional input directory containing data copied into exefs, if anything this normally should only contain "main.npdm".
# ROMFS is the directory containing data to be added to RomFS, relative to the Makefile (Optional)
#
# NO_ICON: if set to anything, do not use icon.
# NO_NACP: if set to anything, no .nacp file is generated.
# APP_TITLE is the name of the app stored in the .nacp file (Optional)
# APP_AUTHOR is the author of the app stored in the .nacp file (Optional)
# APP_VERSION is the version of the app stored in the .nacp file (Optional)
# APP_TITLEID is the titleID of the app stored in the .nacp file (Optional)
# ICON is the filename of the icon (.jpg), relative to the project folder.
# If not set, it attempts to use one of the following (in this order):
# - <Project name>.jpg
# - icon.jpg
# - <libnx folder>/default_icon.jpg
#---------------------------------------------------------------------------------
VERSION_MAJOR := 4
VERSION_MINOR := 0
VERSION_MICRO := 4
APP_TITLE := Hekate Toolbox
APP_AUTHOR := WerWolv, cathery
APP_VERSION := ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO}
TARGET := HekateToolbox
OUTDIR := out
BUILD := build
SOURCES := source source/gui source/utils
DATA := data
INCLUDES := include include/gui include/utils
EXEFS_SRC := exefs_src
#ROMFS := romfs
CUSTOM_LIBS := SimpleIniParser
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE
CFLAGS := -g -Wall -O2 -ffunction-sections \
$(ARCH) $(DEFINES)
CFLAGS += $(INCLUDE) -D__SWITCH__ `$(PREFIX)pkg-config --cflags freetype2`
CXXFLAGS := $(CFLAGS) -fno-rtti -fexceptions -std=gnu++17
ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
LIBS := -lnx `$(PREFIX)pkg-config --libs freetype2` -lturbojpeg \
$(foreach lib,$(CUSTOM_LIBS),-l$(lib))
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(PORTLIBS) $(LIBNX) \
$(foreach dir,$(CUSTOM_LIBS),$(TOPDIR)/$(dir))
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------
export OUTPUT := $(CURDIR)/$(OUTDIR)/$(TARGET)
export TOPDIR := $(CURDIR)
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
export DEPSDIR := $(CURDIR)/$(BUILD)
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
#---------------------------------------------------------------------------------
export LD := $(CC)
#---------------------------------------------------------------------------------
else
#---------------------------------------------------------------------------------
export LD := $(CXX)
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------
export OFILES_BIN := $(addsuffix .o,$(BINFILES))
export OFILES_SRC := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
export OFILES := $(OFILES_BIN) $(OFILES_SRC)
export HFILES_BIN := $(addsuffix .h,$(subst .,_,$(BINFILES)))
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD)
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
export BUILD_EXEFS_SRC := $(TOPDIR)/$(EXEFS_SRC)
ifeq ($(strip $(ICON)),)
icons := $(wildcard *.jpg)
ifneq (,$(findstring $(TARGET).jpg,$(icons)))
export APP_ICON := $(TOPDIR)/$(TARGET).jpg
else
ifneq (,$(findstring icon.jpg,$(icons)))
export APP_ICON := $(TOPDIR)/icon.jpg
endif
endif
else
export APP_ICON := $(TOPDIR)/$(ICON)
endif
ifeq ($(strip $(NO_ICON)),)
export NROFLAGS += --icon=$(APP_ICON)
endif
ifeq ($(strip $(NO_NACP)),)
export NROFLAGS += --nacp=$(CURDIR)/$(OUTDIR)/$(TARGET).nacp
endif
ifneq ($(APP_TITLEID),)
export NACPFLAGS += --titleid=$(APP_TITLEID)
endif
ifneq ($(ROMFS),)
export NROFLAGS += --romfsdir=$(CURDIR)/$(ROMFS)
endif
.PHONY: $(CUSTOM_LIBS) $(BUILD) clean all
#---------------------------------------------------------------------------------
all: $(BUILD)
$(CUSTOM_LIBS):
@$(MAKE) -C $@
$(BUILD): $(CUSTOM_LIBS)
@[ -d $@ ] || mkdir -p $@ $(BUILD) $(OUTDIR)
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
#---------------------------------------------------------------------------------
clean:
@echo clean ...
@rm -fr $(BUILD) $(OUTDIR) $(TARGET).pfs0 $(TARGET).nso $(TARGET).nro $(TARGET).nacp $(TARGET).elf
@for lib in $(CUSTOM_LIBS); do $(MAKE) -C $$lib clean; done
#---------------------------------------------------------------------------------
else
.PHONY: all
DEPENDS := $(OFILES:.o=.d)
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
all : $(OUTPUT).pfs0 $(OUTPUT).nro
$(OUTPUT).pfs0 : $(OUTPUT).nso
$(OUTPUT).nso : $(OUTPUT).elf
ifeq ($(strip $(NO_NACP)),)
$(OUTPUT).nro : $(OUTPUT).elf $(OUTPUT).nacp
else
$(OUTPUT).nro : $(OUTPUT).elf
endif
$(OUTPUT).elf : $(OFILES)
$(OFILES_SRC) : $(HFILES_BIN)
#---------------------------------------------------------------------------------
# you need a rule like this for each extension you use as binary data
#---------------------------------------------------------------------------------
%.bin.o %_bin.h : %.bin
#---------------------------------------------------------------------------------
@echo $(notdir $<)
@$(bin2o)
-include $(DEPENDS)
#---------------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------------
================================================
FILE: README.md
================================================
# Hekate Toolbox
A Swiss Army Knife for Hekate. It was originally developed for the use with AnnsAnn's SDFiles (Later AtlasNX's Kosmos), but fully works with Hekate-based CFW configurations and some features even work without it.
## Current Features
- Reading and modifying of the hbmenu launch button combination
- Actually modifying the hbmenu config as well so settings stick across reboots
- Reading and modifying from where hbmenu launches by default
- Sysmodule hotloading and unloading
- Reboot to Hekate profiles and the Hekate menu
- Boot to UMS (SD Card)
- Mariko support (Limits features)
## Compiling
You need:
```
switch-libjpeg-turbo
switch-freetype
switch-dev
```
================================================
FILE: include/ams_bpc.h
================================================
/*
* Copyright (c) 2018-2020 Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <switch.h>
#ifdef __cplusplus
extern "C" {
#endif
Result amsBpcInitialize();
void amsBpcExit();
Service *amsBpcGetServiceSession(void);
Result amsBpcSetRebootPayload(const void *src, size_t src_size);
#ifdef __cplusplus
}
#endif
================================================
FILE: include/gui/button.hpp
================================================
#pragma once
#include <switch.h>
#include <functional>
#include <vector>
class Gui;
enum AdjacentButtonDirection {
ADJ_UP,
ADJ_DOWN,
ADJ_LEFT,
ADJ_RIGHT,
};
class Button {
public:
Button();
void draw();
bool onInput(u32 kdown);
void onTouch(HidTouchState &touch);
inline bool isActivated() {
return m_isActivated;
}
inline bool isSelected() {
return m_isSelected;
}
private:
static void _defaultDrawAction(Gui *, u16, u16, bool *) {}
static void _defaultInputAction(u32, bool *) {}
static bool _defaultUsableCondition() { return true; }
public:
std::pair<u16, u16> position{};
std::pair<u16, u16> volume{};
std::function<void(Gui *, u16, u16, bool *)> drawAction = _defaultDrawAction;
std::function<void(u32, bool *)> inputAction = _defaultInputAction;
std::function<bool()> usableCondition = _defaultUsableCondition;
std::array<s32, 4> adjacentButton = {-1, -1, -1, -1};
bool activatable = false;
private:
bool m_isActivated;
bool m_isSelected;
Gui *m_gui;
friend class Gui;
};
================================================
FILE: include/gui/gui.hpp
================================================
#pragma once
#include <switch.h>
#include <cstring>
#include <unordered_map>
#include <memory>
#include "list_selector.hpp"
#include "message_box.hpp"
#include "button.hpp"
extern "C" {
#include "theme.h"
#include "types.h"
}
#include <ft2build.h>
#include FT_FREETYPE_H
#define FONT_FACES_MAX PlSharedFontType_Total
#define fontIcons 5
#define fontHuge 4
#define font24 3
#define font20 2
#define font14 1
#define SCREEN_WIDTH 1280
#define SCREEN_HEIGHT 720
enum gui_t {
GUI_INVALID,
GUI_MAIN,
GUI_SM_SELECT,
GUI_HEKATE,
GUI_OVERRIDES_MENU,
GUI_OVERRIDE_KEY,
GUI_TITLE_LIST,
};
class Gui {
protected:
u16 m_pageOffsetX = 0;
u16 m_pageOffsetY = 0;
u16 m_targetOffsetX = 0;
u16 m_targetOffsetY = 0;
const u16 m_pageLeftmostBoundary = 100;
const u16 m_pageTopmostBoundary = 160;
const u16 m_pageRightmostBoundary = SCREEN_WIDTH - 100;
const u16 m_pageBottommostBoundary = SCREEN_HEIGHT - 160;
bool m_scrollBlocked = false;
std::vector<std::unique_ptr<Button>> m_buttons;
friend class Button;
public:
static inline enum gui_t g_nextGui = GUI_INVALID;
u8 *framebuffer;
static inline Framebuffer g_fb_obj;
static inline u32 g_framebuffer_width = 1280;
static inline u32 g_framebuffer_height = 720;
static inline bool g_exitBlocked = false;
static inline ListSelector *g_currListSelector = nullptr;
static inline MessageBox *g_currMessageBox = nullptr;
public:
Gui();
virtual ~Gui();
virtual void update();
virtual void draw() {
beginDraw();
drawButtons();
endDraw();
}
virtual void onInput(u32 kdown) {
inputButtons(kdown);
}
virtual void onTouch(HidTouchState &touch) {
touchButtons(touch);
}
virtual void onGesture(HidTouchState &startPosition, HidTouchState &endPosition){};
s16 getSelectedButtonIndex();
void selectButton(s16 buttonIndex);
void selectButtonByRef(const Button *button);
void add(Button *button);
static void resizeImage(u8 *in, u8 *out, size_t src_width, size_t src_height, size_t dest_width, size_t dest_height);
static std::vector<std::string> split(const std::string &s, const char &c);
inline u8 blendColor(u32 src, u32 dst, u8 alpha);
color_t makeColor(u8 r, u8 g, u8 b, u8 a);
void drawRectangle(s16 x, s16 y, s16 w, s16 h, color_t color);
void drawRectangled(s16 x, s16 y, s16 w, s16 h, color_t color);
bool fontInit();
void fontExit();
void drawText(u32 font, s16 x, s16 y, color_t clr, const char *text);
void drawTextAligned(u32 font, s16 x, s16 y, color_t clr, const char *text, TextAlignment alignment);
void drawTextTruncate(u32 font, s16 x, s16 y, color_t clr, const char *text, u32 max_width, const char *end_text);
void getTextDimensions(u32 font, const char *text, u32 *width_out, u32 *height_out);
void drawImage(s16 x, s16 y, s16 width, s16 height, const u8 *image, ImageMode mode);
void drawImage(s16 x, s16 y, s16 startx, s16 starty, s16 width, s16 height, const u8 *image, ImageMode mode);
void drawShadow(s16 x, s16 y, s16 width, s16 height);
protected:
void endInit() {
m_targetOffsetX = m_pageOffsetX;
m_targetOffsetY = m_pageOffsetY;
}
void beginDraw();
void endDraw();
void drawButtons() {
for (auto &btn : m_buttons)
btn->draw();
};
bool inputButtons(u32 kdown) {
for (auto &btn : m_buttons) {
if (btn->isSelected())
if (btn->onInput(kdown)) return true;
}
return false;
};
void touchButtons(HidTouchState &touch) {
for (auto &btn : m_buttons) {
btn->onTouch(touch);
}
};
private:
FT_Error m_fontLibret, m_fontFacesRet[FONT_FACES_MAX];
FT_Library m_fontLibrary;
FT_Face m_fontFaces[FONT_FACES_MAX];
FT_Face m_fontLastUsedFace;
s32 m_fontFacesTotal;
std::unordered_map<size_t, std::pair<u16, u16>> m_stringDimensions;
void drawText_(u32 font, s16 x, s16 y, color_t clr, const char *text, s32 max_width, const char *end_text);
inline void draw4PixelsRaw(s16 x, s16 y, color_t clr);
inline bool fontLoadGlyph(glyph_t *glyph, u32 font, u32 codepoint);
void drawGlyph(s16 x, s16 y, color_t clr, const glyph_t *glyph);
bool setFontType(u32 font);
inline u8 decodeByte(const char **ptr);
inline s8 decodeUTF8Cont(const char **ptr);
inline u32 decodeUTF8(const char **ptr);
inline void drawPixel(s16 x, s16 y, color_t clr);
};
#define COLOR_WHITE makeColor(255, 255, 255, 255)
#define COLOR_BLACK makeColor(0, 0, 0, 255)
================================================
FILE: include/gui/gui_hekate.hpp
================================================
#pragma once
#include "gui.hpp"
#include <vector>
#include <string>
#include <unordered_map>
#include <set>
#include "utils.hpp"
class GuiHekate : public Gui {
public:
GuiHekate();
~GuiHekate() override;
void draw() override;
void onInput(u32 kdown) override;
static inline BootEntry m_currRebootConfig{};
protected:
void initializeForRestrictedMode();
void InitializeRegular();
private:
std::vector<BootEntry> m_rebootConfigs;
bool canReboot;
bool restrictedMode;
std::string errorMessage;
};
================================================
FILE: include/gui/gui_main.hpp
================================================
#pragma once
#include "gui.hpp"
#include <vector>
#include <string>
#include <unordered_map>
#include "utils.hpp"
#include "override_key.hpp"
class GuiMain : public Gui {
public:
GuiMain();
~GuiMain() override;
void draw() override;
void onInput(u32 kdown) override;
private:
static inline int selection = 0;
OverrideKey m_albumOverrideKey;
BootEntry m_currAutoBootConfig;
std::vector<BootEntry> m_autoBootConfigs;
std::vector<std::string> m_titleNames;
std::vector<u64> m_titleIDs;
};
================================================
FILE: include/gui/gui_override_key.hpp
================================================
#pragma once
#include "gui.hpp"
#include "override_key.hpp"
class GuiOverrideKey : public Gui {
public:
GuiOverrideKey();
~GuiOverrideKey() override;
void draw() override;
void onInput(u32 kdown) override;
void loadConfigFile();
private:
ProgramOverrideKey m_override{};
bool m_inputBlocked = false;
bool m_overrideAnyApp = false;
public:
static inline int selection = 2;
static inline ProgramOverrideKey g_overrideKey{};
static inline OverrideKeyType g_keyType{};
};
================================================
FILE: include/gui/gui_overrides_menu.hpp
================================================
#pragma once
#include "gui.hpp"
#include "override_key.hpp"
enum class OverrideButtonType {
Any_Title,
Custom_Title,
Add_New,
};
class GuiOverridesMenu : public Gui {
public:
GuiOverridesMenu();
~GuiOverridesMenu() override;
void draw() override;
void onInput(u32 kdown) override;
void addButton(OverrideButtonType buttonType, OverrideKeyType keyType = OverrideKeyType::Invalid, const ProgramOverrideKey &key = ProgramOverrideKey{});
void loadConfigFile();
void removeFromList(OverrideKeyType keyEntry);
private:
ProgramOverrideKey m_overrides[8]{};
ProgramOverrideKey m_anyAppOverride{};
bool m_overrideAnyApp = false;
u8 m_buttonCount = 0;
bool displayDefaultOption = true;
bool displayAnyTitleOption = true;
OverrideKeyType m_selectedConfig;
std::vector<OverrideKeyType> m_addConfigs;
std::vector<std::tuple<OverrideButtonType, OverrideKeyType>> m_buttons;
public:
static inline int selection = 0;
};
================================================
FILE: include/gui/gui_sysmodule.hpp
================================================
#pragma once
#include "gui.hpp"
#include <vector>
#include <string>
#include <unordered_map>
#include <set>
typedef struct {
std::string name;
std::string titleID;
bool requiresReboot;
} sysModule_t;
class GuiSysmodule : public Gui {
public:
GuiSysmodule();
~GuiSysmodule() override;
void draw() override;
void onInput(u32 kdown) override;
private:
static inline int selection = 0;
std::unordered_map<std::string, sysModule_t> m_sysmodules;
std::set<std::string> m_runningSysmodules;
std::set<std::string> m_presentSysmodules;
};
================================================
FILE: include/gui/gui_title_list.hpp
================================================
#pragma once
#include "gui.hpp"
class GuiTitleList : public Gui {
public:
GuiTitleList();
~GuiTitleList() override;
void draw() override;
void onInput(u32 kdown) override;
void loadConfigFile();
static inline u64 selectedAppID = 0;
};
================================================
FILE: include/gui/list_selector.hpp
================================================
#pragma once
#include <string>
#include <functional>
#include <vector>
#include <switch.h>
class Gui;
class ListSelector {
public:
ListSelector(std::string title, std::string options, std::vector<std::string> &listItems, u16 selectedItem);
~ListSelector();
ListSelector *setInputAction(std::function<void(u32, u16)> inputActions);
void update();
void draw(Gui *gui);
void onInput(u32 kdown);
void onTouch(HidTouchState &touch);
void show();
void hide();
private:
std::string m_title, m_options;
std::vector<std::string> &m_listItems;
std::function<void(u32, u16)> m_inputActions;
u32 m_optionsWidth, m_optionsHeight;
bool m_isShown;
s16 yOffset, yOffsetNext;
s16 startYOffset, startYOffsetNext;
u16 m_selectedItem;
};
================================================
FILE: include/gui/message_box.hpp
================================================
#pragma once
#include <switch.h>
#include <string>
#include <functional>
class Gui;
class MessageBox {
public:
typedef enum {
NONE = 0,
OKAY = 1,
YES_NO = 2
} MessageBoxOptions;
enum MessageBoxOption {
BUTTON_OKAY = 0,
BUTTON_YES = 0,
BUTTON_NO = 1,
};
MessageBox(std::string message, MessageBox::MessageBoxOptions options);
~MessageBox();
MessageBox *setSelectionAction(std::function<void(s8)> selectionAction);
MessageBox *setCustomDraw(std::function<void(Gui *gui, s16 x, s16 y)> customDraw);
void draw(Gui *gui);
void onInput(u32 kdown);
void onTouch(HidTouchState &touch);
void onGesture(HidTouchState &startPosition, HidTouchState &endPosition, bool finish);
void setProgress(s8 progress);
void show();
void hide();
private:
std::string m_message;
MessageBoxOptions m_options;
u8 m_selectedOption;
s8 m_progress;
std::function<void(s8)> m_selectionAction;
std::function<void(Gui *gui, s16 x, s16 y)> m_customDraw;
};
================================================
FILE: include/gui/theme.h
================================================
#pragma once
#include <switch.h>
#include "types.h"
typedef struct {
color_t textColor;
color_t unselectedColor;
color_t backgroundColor;
color_t highlightColor;
color_t selectedColor;
color_t separatorColor;
color_t selectedButtonColor;
color_t submenuButtonColor;
color_t activatedColor;
color_t overlayColor;
color_t highlightTextColor;
} theme_t;
extern theme_t currTheme;
void setTheme(ColorSetId colorSetId);
================================================
FILE: include/service_guard.h
================================================
#pragma once
#include <switch/types.h>
#include <switch/result.h>
#include <switch/kernel/mutex.h>
#include <switch/sf/service.h>
#include <switch/services/sm.h>
typedef struct ServiceGuard {
Mutex mutex;
u32 refCount;
} ServiceGuard;
NX_INLINE bool serviceGuardBeginInit(ServiceGuard* g)
{
mutexLock(&g->mutex);
return (g->refCount++) == 0;
}
NX_INLINE Result serviceGuardEndInit(ServiceGuard* g, Result rc, void (*cleanupFunc)(void))
{
if (R_FAILED(rc)) {
cleanupFunc();
--g->refCount;
}
mutexUnlock(&g->mutex);
return rc;
}
NX_INLINE void serviceGuardExit(ServiceGuard* g, void (*cleanupFunc)(void))
{
mutexLock(&g->mutex);
if (g->refCount && (--g->refCount) == 0)
cleanupFunc();
mutexUnlock(&g->mutex);
}
#define NX_GENERATE_SERVICE_GUARD_PARAMS(name, _paramdecl, _parampass) \
\
static ServiceGuard g_##name##Guard; \
NX_INLINE Result _##name##Initialize _paramdecl; \
static void _##name##Cleanup(void); \
\
Result name##Initialize _paramdecl \
{ \
Result rc = 0; \
if (serviceGuardBeginInit(&g_##name##Guard)) \
rc = _##name##Initialize _parampass; \
return serviceGuardEndInit(&g_##name##Guard, rc, _##name##Cleanup); \
} \
\
void name##Exit(void) \
{ \
serviceGuardExit(&g_##name##Guard, _##name##Cleanup); \
}
#define NX_GENERATE_SERVICE_GUARD(name) NX_GENERATE_SERVICE_GUARD_PARAMS(name, (void), ())
================================================
FILE: include/utils/jpeg.hpp
================================================
#pragma once
#include "switch.h"
struct WidthHeight {
int width;
int height;
};
//Takes a pointer to a jpeg data array and the size of the array.
//Returns a pointer to a dynamically allocated array containing a RGBA32 bitmap image.
//If w and h are not 0, it will use that resolution instead.
//It must be freed manually!
const u8 *jpegdec(const u8 *buffer, size_t size, WidthHeight res = {});
================================================
FILE: include/utils/json.hpp
================================================
// clang-format off
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++
| | |__ | | | | | | version 3.5.0
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License <http://opensource.org/licenses/MIT>.
SPDX-License-Identifier: MIT
Copyright (c) 2013-2018 Niels Lohmann <http://nlohmann.me>.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef NLOHMANN_JSON_HPP
#define NLOHMANN_JSON_HPP
#define NLOHMANN_JSON_VERSION_MAJOR 3
#define NLOHMANN_JSON_VERSION_MINOR 5
#define NLOHMANN_JSON_VERSION_PATCH 0
#include <algorithm> // all_of, find, for_each
#include <cassert> // assert
#include <ciso646> // and, not, or
#include <cstddef> // nullptr_t, ptrdiff_t, size_t
#include <functional> // hash, less
#include <initializer_list> // initializer_list
#include <iosfwd> // istream, ostream
#include <iterator> // random_access_iterator_tag
#include <numeric> // accumulate
#include <string> // string, stoi, to_string
#include <utility> // declval, forward, move, pair, swap
// #include <nlohmann/json_fwd.hpp>
#ifndef NLOHMANN_JSON_FWD_HPP
#define NLOHMANN_JSON_FWD_HPP
#include <cstdint> // int64_t, uint64_t
#include <map> // map
#include <memory> // allocator
#include <string> // string
#include <vector> // vector
/*!
@brief namespace for Niels Lohmann
@see https://github.com/nlohmann
@since version 1.0.0
*/
namespace nlohmann
{
/*!
@brief default JSONSerializer template argument
This serializer ignores the template arguments and uses ADL
([argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl))
for serialization.
*/
template<typename T = void, typename SFINAE = void>
struct adl_serializer;
template<template<typename U, typename V, typename... Args> class ObjectType =
std::map,
template<typename U, typename... Args> class ArrayType = std::vector,
class StringType = std::string, class BooleanType = bool,
class NumberIntegerType = std::int64_t,
class NumberUnsignedType = std::uint64_t,
class NumberFloatType = double,
template<typename U> class AllocatorType = std::allocator,
template<typename T, typename SFINAE = void> class JSONSerializer =
adl_serializer>
class basic_json;
/*!
@brief JSON Pointer
A JSON pointer defines a string syntax for identifying a specific value
within a JSON document. It can be used with functions `at` and
`operator[]`. Furthermore, JSON pointers are the base for JSON patches.
@sa [RFC 6901](https://tools.ietf.org/html/rfc6901)
@since version 2.0.0
*/
template<typename BasicJsonType>
class json_pointer;
/*!
@brief default JSON class
This type is the default specialization of the @ref basic_json class which
uses the standard template types.
@since version 1.0.0
*/
using json = basic_json<>;
} // namespace nlohmann
#endif
// #include <nlohmann/detail/macro_scope.hpp>
// This file contains all internal macro definitions
// You MUST include macro_unscope.hpp at the end of json.hpp to undef all of them
// exclude unsupported compilers
#if !defined(JSON_SKIP_UNSUPPORTED_COMPILER_CHECK)
#if defined(__clang__)
#if (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) < 30400
#error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers"
#endif
#elif defined(__GNUC__) && !(defined(__ICC) || defined(__INTEL_COMPILER))
#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800
#error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers"
#endif
#endif
#endif
// disable float-equal warnings on GCC/clang
#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
#endif
// disable documentation warnings on clang
#if defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdocumentation"
#endif
// allow for portable deprecation warnings
#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__)
#define JSON_DEPRECATED __attribute__((deprecated))
#elif defined(_MSC_VER)
#define JSON_DEPRECATED __declspec(deprecated)
#else
#define JSON_DEPRECATED
#endif
// allow to disable exceptions
#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION)
#define JSON_THROW(exception) throw exception
#define JSON_TRY try
#define JSON_CATCH(exception) catch(exception)
#define JSON_INTERNAL_CATCH(exception) catch(exception)
#else
#define JSON_THROW(exception) std::abort()
#define JSON_TRY if(true)
#define JSON_CATCH(exception) if(false)
#define JSON_INTERNAL_CATCH(exception) if(false)
#endif
// override exception macros
#if defined(JSON_THROW_USER)
#undef JSON_THROW
#define JSON_THROW JSON_THROW_USER
#endif
#if defined(JSON_TRY_USER)
#undef JSON_TRY
#define JSON_TRY JSON_TRY_USER
#endif
#if defined(JSON_CATCH_USER)
#undef JSON_CATCH
#define JSON_CATCH JSON_CATCH_USER
#undef JSON_INTERNAL_CATCH
#define JSON_INTERNAL_CATCH JSON_CATCH_USER
#endif
#if defined(JSON_INTERNAL_CATCH_USER)
#undef JSON_INTERNAL_CATCH
#define JSON_INTERNAL_CATCH JSON_INTERNAL_CATCH_USER
#endif
// manual branch prediction
#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__)
#define JSON_LIKELY(x) __builtin_expect(!!(x), 1)
#define JSON_UNLIKELY(x) __builtin_expect(!!(x), 0)
#else
#define JSON_LIKELY(x) x
#define JSON_UNLIKELY(x) x
#endif
// C++ language standard detection
#if (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464
#define JSON_HAS_CPP_17
#define JSON_HAS_CPP_14
#elif (defined(__cplusplus) && __cplusplus >= 201402L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1)
#define JSON_HAS_CPP_14
#endif
/*!
@brief macro to briefly define a mapping between an enum and JSON
@def NLOHMANN_JSON_SERIALIZE_ENUM
@since version 3.4.0
*/
#define NLOHMANN_JSON_SERIALIZE_ENUM(ENUM_TYPE, ...) \
template<typename BasicJsonType> \
inline void to_json(BasicJsonType& j, const ENUM_TYPE& e) \
{ \
static_assert(std::is_enum<ENUM_TYPE>::value, #ENUM_TYPE " must be an enum!"); \
static const std::pair<ENUM_TYPE, BasicJsonType> m[] = __VA_ARGS__; \
auto it = std::find_if(std::begin(m), std::end(m), \
[e](const std::pair<ENUM_TYPE, BasicJsonType>& ej_pair) -> bool \
{ \
return ej_pair.first == e; \
}); \
j = ((it != std::end(m)) ? it : std::begin(m))->second; \
} \
template<typename BasicJsonType> \
inline void from_json(const BasicJsonType& j, ENUM_TYPE& e) \
{ \
static_assert(std::is_enum<ENUM_TYPE>::value, #ENUM_TYPE " must be an enum!"); \
static const std::pair<ENUM_TYPE, BasicJsonType> m[] = __VA_ARGS__; \
auto it = std::find_if(std::begin(m), std::end(m), \
[j](const std::pair<ENUM_TYPE, BasicJsonType>& ej_pair) -> bool \
{ \
return ej_pair.second == j; \
}); \
e = ((it != std::end(m)) ? it : std::begin(m))->first; \
}
// Ugly macros to avoid uglier copy-paste when specializing basic_json. They
// may be removed in the future once the class is split.
#define NLOHMANN_BASIC_JSON_TPL_DECLARATION \
template<template<typename, typename, typename...> class ObjectType, \
template<typename, typename...> class ArrayType, \
class StringType, class BooleanType, class NumberIntegerType, \
class NumberUnsignedType, class NumberFloatType, \
template<typename> class AllocatorType, \
template<typename, typename = void> class JSONSerializer>
#define NLOHMANN_BASIC_JSON_TPL \
basic_json<ObjectType, ArrayType, StringType, BooleanType, \
NumberIntegerType, NumberUnsignedType, NumberFloatType, \
AllocatorType, JSONSerializer>
// #include <nlohmann/detail/meta/cpp_future.hpp>
#include <ciso646> // not
#include <cstddef> // size_t
#include <type_traits> // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type
namespace nlohmann
{
namespace detail
{
// alias templates to reduce boilerplate
template<bool B, typename T = void>
using enable_if_t = typename std::enable_if<B, T>::type;
template<typename T>
using uncvref_t = typename std::remove_cv<typename std::remove_reference<T>::type>::type;
// implementation of C++14 index_sequence and affiliates
// source: https://stackoverflow.com/a/32223343
template<std::size_t... Ints>
struct index_sequence
{
using type = index_sequence;
using value_type = std::size_t;
static constexpr std::size_t size() noexcept
{
return sizeof...(Ints);
}
};
template<class Sequence1, class Sequence2>
struct merge_and_renumber;
template<std::size_t... I1, std::size_t... I2>
struct merge_and_renumber<index_sequence<I1...>, index_sequence<I2...>>
: index_sequence < I1..., (sizeof...(I1) + I2)... > {};
template<std::size_t N>
struct make_index_sequence
: merge_and_renumber < typename make_index_sequence < N / 2 >::type,
typename make_index_sequence < N - N / 2 >::type > {};
template<> struct make_index_sequence<0> : index_sequence<> {};
template<> struct make_index_sequence<1> : index_sequence<0> {};
template<typename... Ts>
using index_sequence_for = make_index_sequence<sizeof...(Ts)>;
// dispatch utility (taken from ranges-v3)
template<unsigned N> struct priority_tag : priority_tag < N - 1 > {};
template<> struct priority_tag<0> {};
// taken from ranges-v3
template<typename T>
struct static_const
{
static constexpr T value{};
};
template<typename T>
constexpr T static_const<T>::value;
} // namespace detail
} // namespace nlohmann
// #include <nlohmann/detail/meta/type_traits.hpp>
#include <ciso646> // not
#include <limits> // numeric_limits
#include <type_traits> // false_type, is_constructible, is_integral, is_same, true_type
#include <utility> // declval
// #include <nlohmann/json_fwd.hpp>
// #include <nlohmann/detail/iterators/iterator_traits.hpp>
#include <iterator> // random_access_iterator_tag
// #include <nlohmann/detail/meta/void_t.hpp>
namespace nlohmann
{
namespace detail
{
template <typename ...Ts> struct make_void
{
using type = void;
};
template <typename ...Ts> using void_t = typename make_void<Ts...>::type;
} // namespace detail
} // namespace nlohmann
// #include <nlohmann/detail/meta/cpp_future.hpp>
namespace nlohmann
{
namespace detail
{
template <typename It, typename = void>
struct iterator_types {};
template <typename It>
struct iterator_types <
It,
void_t<typename It::difference_type, typename It::value_type, typename It::pointer,
typename It::reference, typename It::iterator_category >>
{
using difference_type = typename It::difference_type;
using value_type = typename It::value_type;
using pointer = typename It::pointer;
using reference = typename It::reference;
using iterator_category = typename It::iterator_category;
};
// This is required as some compilers implement std::iterator_traits in a way that
// doesn't work with SFINAE. See https://github.com/nlohmann/json/issues/1341.
template <typename T, typename = void>
struct iterator_traits
{
};
template <typename T>
struct iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >>
: iterator_types<T>
{
};
template <typename T>
struct iterator_traits<T*, enable_if_t<std::is_object<T>::value>>
{
using iterator_category = std::random_access_iterator_tag;
using value_type = T;
using difference_type = ptrdiff_t;
using pointer = T*;
using reference = T&;
};
}
}
// #include <nlohmann/detail/meta/cpp_future.hpp>
// #include <nlohmann/detail/meta/detected.hpp>
#include <type_traits>
// #include <nlohmann/detail/meta/void_t.hpp>
// http://en.cppreference.com/w/cpp/experimental/is_detected
namespace nlohmann
{
namespace detail
{
struct nonesuch
{
nonesuch() = delete;
~nonesuch() = delete;
nonesuch(nonesuch const&) = delete;
void operator=(nonesuch const&) = delete;
};
template <class Default,
class AlwaysVoid,
template <class...> class Op,
class... Args>
struct detector
{
using value_t = std::false_type;
using type = Default;
};
template <class Default, template <class...> class Op, class... Args>
struct detector<Default, void_t<Op<Args...>>, Op, Args...>
{
using value_t = std::true_type;
using type = Op<Args...>;
};
template <template <class...> class Op, class... Args>
using is_detected = typename detector<nonesuch, void, Op, Args...>::value_t;
template <template <class...> class Op, class... Args>
using detected_t = typename detector<nonesuch, void, Op, Args...>::type;
template <class Default, template <class...> class Op, class... Args>
using detected_or = detector<Default, void, Op, Args...>;
template <class Default, template <class...> class Op, class... Args>
using detected_or_t = typename detected_or<Default, Op, Args...>::type;
template <class Expected, template <class...> class Op, class... Args>
using is_detected_exact = std::is_same<Expected, detected_t<Op, Args...>>;
template <class To, template <class...> class Op, class... Args>
using is_detected_convertible =
std::is_convertible<detected_t<Op, Args...>, To>;
} // namespace detail
} // namespace nlohmann
// #include <nlohmann/detail/macro_scope.hpp>
namespace nlohmann
{
/*!
@brief detail namespace with internal helper functions
This namespace collects functions that should not be exposed,
implementations of some @ref basic_json methods, and meta-programming helpers.
@since version 2.1.0
*/
namespace detail
{
/////////////
// helpers //
/////////////
// Note to maintainers:
//
// Every trait in this file expects a non CV-qualified type.
// The only exceptions are in the 'aliases for detected' section
// (i.e. those of the form: decltype(T::member_function(std::declval<T>())))
//
// In this case, T has to be properly CV-qualified to constraint the function arguments
// (e.g. to_json(BasicJsonType&, const T&))
template<typename> struct is_basic_json : std::false_type {};
NLOHMANN_BASIC_JSON_TPL_DECLARATION
struct is_basic_json<NLOHMANN_BASIC_JSON_TPL> : std::true_type {};
//////////////////////////
// aliases for detected //
//////////////////////////
template <typename T>
using mapped_type_t = typename T::mapped_type;
template <typename T>
using key_type_t = typename T::key_type;
template <typename T>
using value_type_t = typename T::value_type;
template <typename T>
using difference_type_t = typename T::difference_type;
template <typename T>
using pointer_t = typename T::pointer;
template <typename T>
using reference_t = typename T::reference;
template <typename T>
using iterator_category_t = typename T::iterator_category;
template <typename T>
using iterator_t = typename T::iterator;
template <typename T, typename... Args>
using to_json_function = decltype(T::to_json(std::declval<Args>()...));
template <typename T, typename... Args>
using from_json_function = decltype(T::from_json(std::declval<Args>()...));
template <typename T, typename U>
using get_template_function = decltype(std::declval<T>().template get<U>());
// trait checking if JSONSerializer<T>::from_json(json const&, udt&) exists
template <typename BasicJsonType, typename T, typename = void>
struct has_from_json : std::false_type {};
template <typename BasicJsonType, typename T>
struct has_from_json<BasicJsonType, T,
enable_if_t<not is_basic_json<T>::value>>
{
using serializer = typename BasicJsonType::template json_serializer<T, void>;
static constexpr bool value =
is_detected_exact<void, from_json_function, serializer,
const BasicJsonType&, T&>::value;
};
// This trait checks if JSONSerializer<T>::from_json(json const&) exists
// this overload is used for non-default-constructible user-defined-types
template <typename BasicJsonType, typename T, typename = void>
struct has_non_default_from_json : std::false_type {};
template<typename BasicJsonType, typename T>
struct has_non_default_from_json<BasicJsonType, T, enable_if_t<not is_basic_json<T>::value>>
{
using serializer = typename BasicJsonType::template json_serializer<T, void>;
static constexpr bool value =
is_detected_exact<T, from_json_function, serializer,
const BasicJsonType&>::value;
};
// This trait checks if BasicJsonType::json_serializer<T>::to_json exists
// Do not evaluate the trait when T is a basic_json type, to avoid template instantiation infinite recursion.
template <typename BasicJsonType, typename T, typename = void>
struct has_to_json : std::false_type {};
template <typename BasicJsonType, typename T>
struct has_to_json<BasicJsonType, T, enable_if_t<not is_basic_json<T>::value>>
{
using serializer = typename BasicJsonType::template json_serializer<T, void>;
static constexpr bool value =
is_detected_exact<void, to_json_function, serializer, BasicJsonType&,
T>::value;
};
///////////////////
// is_ functions //
///////////////////
template <typename T, typename = void>
struct is_iterator_traits : std::false_type {};
template <typename T>
struct is_iterator_traits<iterator_traits<T>>
{
private:
using traits = iterator_traits<T>;
public:
static constexpr auto value =
is_detected<value_type_t, traits>::value &&
is_detected<difference_type_t, traits>::value &&
is_detected<pointer_t, traits>::value &&
is_detected<iterator_category_t, traits>::value &&
is_detected<reference_t, traits>::value;
};
// source: https://stackoverflow.com/a/37193089/4116453
template <typename T, typename = void>
struct is_complete_type : std::false_type {};
template <typename T>
struct is_complete_type<T, decltype(void(sizeof(T)))> : std::true_type {};
template <typename BasicJsonType, typename CompatibleObjectType,
typename = void>
struct is_compatible_object_type_impl : std::false_type {};
template <typename BasicJsonType, typename CompatibleObjectType>
struct is_compatible_object_type_impl <
BasicJsonType, CompatibleObjectType,
enable_if_t<is_detected<mapped_type_t, CompatibleObjectType>::value and
is_detected<key_type_t, CompatibleObjectType>::value >>
{
using object_t = typename BasicJsonType::object_t;
// macOS's is_constructible does not play well with nonesuch...
static constexpr bool value =
std::is_constructible<typename object_t::key_type,
typename CompatibleObjectType::key_type>::value and
std::is_constructible<typename object_t::mapped_type,
typename CompatibleObjectType::mapped_type>::value;
};
template <typename BasicJsonType, typename CompatibleObjectType>
struct is_compatible_object_type
: is_compatible_object_type_impl<BasicJsonType, CompatibleObjectType> {};
template <typename BasicJsonType, typename ConstructibleObjectType,
typename = void>
struct is_constructible_object_type_impl : std::false_type {};
template <typename BasicJsonType, typename ConstructibleObjectType>
struct is_constructible_object_type_impl <
BasicJsonType, ConstructibleObjectType,
enable_if_t<is_detected<mapped_type_t, ConstructibleObjectType>::value and
is_detected<key_type_t, ConstructibleObjectType>::value >>
{
using object_t = typename BasicJsonType::object_t;
static constexpr bool value =
(std::is_constructible<typename ConstructibleObjectType::key_type, typename object_t::key_type>::value and
std::is_same<typename object_t::mapped_type, typename ConstructibleObjectType::mapped_type>::value) or
(has_from_json<BasicJsonType, typename ConstructibleObjectType::mapped_type>::value or
has_non_default_from_json<BasicJsonType, typename ConstructibleObjectType::mapped_type >::value);
};
template <typename BasicJsonType, typename ConstructibleObjectType>
struct is_constructible_object_type
: is_constructible_object_type_impl<BasicJsonType,
ConstructibleObjectType> {};
template <typename BasicJsonType, typename CompatibleStringType,
typename = void>
struct is_compatible_string_type_impl : std::false_type {};
template <typename BasicJsonType, typename CompatibleStringType>
struct is_compatible_string_type_impl <
BasicJsonType, CompatibleStringType,
enable_if_t<is_detected_exact<typename BasicJsonType::string_t::value_type,
value_type_t, CompatibleStringType>::value >>
{
static constexpr auto value =
std::is_constructible<typename BasicJsonType::string_t, CompatibleStringType>::value;
};
template <typename BasicJsonType, typename ConstructibleStringType>
struct is_compatible_string_type
: is_compatible_string_type_impl<BasicJsonType, ConstructibleStringType> {};
template <typename BasicJsonType, typename ConstructibleStringType,
typename = void>
struct is_constructible_string_type_impl : std::false_type {};
template <typename BasicJsonType, typename ConstructibleStringType>
struct is_constructible_string_type_impl <
BasicJsonType, ConstructibleStringType,
enable_if_t<is_detected_exact<typename BasicJsonType::string_t::value_type,
value_type_t, ConstructibleStringType>::value >>
{
static constexpr auto value =
std::is_constructible<ConstructibleStringType,
typename BasicJsonType::string_t>::value;
};
template <typename BasicJsonType, typename ConstructibleStringType>
struct is_constructible_string_type
: is_constructible_string_type_impl<BasicJsonType, ConstructibleStringType> {};
template <typename BasicJsonType, typename CompatibleArrayType, typename = void>
struct is_compatible_array_type_impl : std::false_type {};
template <typename BasicJsonType, typename CompatibleArrayType>
struct is_compatible_array_type_impl <
BasicJsonType, CompatibleArrayType,
enable_if_t<is_detected<value_type_t, CompatibleArrayType>::value and
is_detected<iterator_t, CompatibleArrayType>::value and
// This is needed because json_reverse_iterator has a ::iterator type...
// Therefore it is detected as a CompatibleArrayType.
// The real fix would be to have an Iterable concept.
not is_iterator_traits<
iterator_traits<CompatibleArrayType>>::value >>
{
static constexpr bool value =
std::is_constructible<BasicJsonType,
typename CompatibleArrayType::value_type>::value;
};
template <typename BasicJsonType, typename CompatibleArrayType>
struct is_compatible_array_type
: is_compatible_array_type_impl<BasicJsonType, CompatibleArrayType> {};
template <typename BasicJsonType, typename ConstructibleArrayType, typename = void>
struct is_constructible_array_type_impl : std::false_type {};
template <typename BasicJsonType, typename ConstructibleArrayType>
struct is_constructible_array_type_impl <
BasicJsonType, ConstructibleArrayType,
enable_if_t<std::is_same<ConstructibleArrayType,
typename BasicJsonType::value_type>::value >>
: std::true_type {};
template <typename BasicJsonType, typename ConstructibleArrayType>
struct is_constructible_array_type_impl <
BasicJsonType, ConstructibleArrayType,
enable_if_t<not std::is_same<ConstructibleArrayType,
typename BasicJsonType::value_type>::value and
is_detected<value_type_t, ConstructibleArrayType>::value and
is_detected<iterator_t, ConstructibleArrayType>::value and
is_complete_type<
detected_t<value_type_t, ConstructibleArrayType>>::value >>
{
static constexpr bool value =
// This is needed because json_reverse_iterator has a ::iterator type,
// furthermore, std::back_insert_iterator (and other iterators) have a base class `iterator`...
// Therefore it is detected as a ConstructibleArrayType.
// The real fix would be to have an Iterable concept.
not is_iterator_traits <
iterator_traits<ConstructibleArrayType >>::value and
(std::is_same<typename ConstructibleArrayType::value_type, typename BasicJsonType::array_t::value_type>::value or
has_from_json<BasicJsonType,
typename ConstructibleArrayType::value_type>::value or
has_non_default_from_json <
BasicJsonType, typename ConstructibleArrayType::value_type >::value);
};
template <typename BasicJsonType, typename ConstructibleArrayType>
struct is_constructible_array_type
: is_constructible_array_type_impl<BasicJsonType, ConstructibleArrayType> {};
template <typename RealIntegerType, typename CompatibleNumberIntegerType,
typename = void>
struct is_compatible_integer_type_impl : std::false_type {};
template <typename RealIntegerType, typename CompatibleNumberIntegerType>
struct is_compatible_integer_type_impl <
RealIntegerType, CompatibleNumberIntegerType,
enable_if_t<std::is_integral<RealIntegerType>::value and
std::is_integral<CompatibleNumberIntegerType>::value and
not std::is_same<bool, CompatibleNumberIntegerType>::value >>
{
// is there an assert somewhere on overflows?
using RealLimits = std::numeric_limits<RealIntegerType>;
using CompatibleLimits = std::numeric_limits<CompatibleNumberIntegerType>;
static constexpr auto value =
std::is_constructible<RealIntegerType,
CompatibleNumberIntegerType>::value and
CompatibleLimits::is_integer and
RealLimits::is_signed == CompatibleLimits::is_signed;
};
template <typename RealIntegerType, typename CompatibleNumberIntegerType>
struct is_compatible_integer_type
: is_compatible_integer_type_impl<RealIntegerType,
CompatibleNumberIntegerType> {};
template <typename BasicJsonType, typename CompatibleType, typename = void>
struct is_compatible_type_impl: std::false_type {};
template <typename BasicJsonType, typename CompatibleType>
struct is_compatible_type_impl <
BasicJsonType, CompatibleType,
enable_if_t<is_complete_type<CompatibleType>::value >>
{
static constexpr bool value =
has_to_json<BasicJsonType, CompatibleType>::value;
};
template <typename BasicJsonType, typename CompatibleType>
struct is_compatible_type
: is_compatible_type_impl<BasicJsonType, CompatibleType> {};
} // namespace detail
} // namespace nlohmann
// #include <nlohmann/detail/exceptions.hpp>
#include <exception> // exception
#include <stdexcept> // runtime_error
#include <string> // to_string
// #include <nlohmann/detail/input/position_t.hpp>
#include <cstddef> // size_t
namespace nlohmann
{
namespace detail
{
/// struct to capture the start position of the current token
struct position_t
{
/// the total number of characters read
std::size_t chars_read_total = 0;
/// the number of characters read in the current line
std::size_t chars_read_current_line = 0;
/// the number of lines read
std::size_t lines_read = 0;
/// conversion to size_t to preserve SAX interface
constexpr operator size_t() const
{
return chars_read_total;
}
};
}
}
namespace nlohmann
{
namespace detail
{
////////////////
// exceptions //
////////////////
/*!
@brief general exception of the @ref basic_json class
This class is an extension of `std::exception` objects with a member @a id for
exception ids. It is used as the base class for all exceptions thrown by the
@ref basic_json class. This class can hence be used as "wildcard" to catch
exceptions.
Subclasses:
- @ref parse_error for exceptions indicating a parse error
- @ref invalid_iterator for exceptions indicating errors with iterators
- @ref type_error for exceptions indicating executing a member function with
a wrong type
- @ref out_of_range for exceptions indicating access out of the defined range
- @ref other_error for exceptions indicating other library errors
@internal
@note To have nothrow-copy-constructible exceptions, we internally use
`std::runtime_error` which can cope with arbitrary-length error messages.
Intermediate strings are built with static functions and then passed to
the actual constructor.
@endinternal
@liveexample{The following code shows how arbitrary library exceptions can be
caught.,exception}
@since version 3.0.0
*/
class exception : public std::exception
{
public:
/// returns the explanatory string
const char* what() const noexcept override
{
return m.what();
}
/// the id of the exception
const int id;
protected:
exception(int id_, const char* what_arg) : id(id_), m(what_arg) {}
static std::string name(const std::string& ename, int id_)
{
return "[json.exception." + ename + "." + std::to_string(id_) + "] ";
}
private:
/// an exception object as storage for error messages
std::runtime_error m;
};
/*!
@brief exception indicating a parse error
This exception is thrown by the library when a parse error occurs. Parse errors
can occur during the deserialization of JSON text, CBOR, MessagePack, as well
as when using JSON Patch.
Member @a byte holds the byte index of the last read character in the input
file.
Exceptions have ids 1xx.
name / id | example message | description
------------------------------ | --------------- | -------------------------
json.exception.parse_error.101 | parse error at 2: unexpected end of input; expected string literal | This error indicates a syntax error while deserializing a JSON text. The error message describes that an unexpected token (character) was encountered, and the member @a byte indicates the error position.
json.exception.parse_error.102 | parse error at 14: missing or wrong low surrogate | JSON uses the `\uxxxx` format to describe Unicode characters. Code points above above 0xFFFF are split into two `\uxxxx` entries ("surrogate pairs"). This error indicates that the surrogate pair is incomplete or contains an invalid code point.
json.exception.parse_error.103 | parse error: code points above 0x10FFFF are invalid | Unicode supports code points up to 0x10FFFF. Code points above 0x10FFFF are invalid.
json.exception.parse_error.104 | parse error: JSON patch must be an array of objects | [RFC 6902](https://tools.ietf.org/html/rfc6902) requires a JSON Patch document to be a JSON document that represents an array of objects.
json.exception.parse_error.105 | parse error: operation must have string member 'op' | An operation of a JSON Patch document must contain exactly one "op" member, whose value indicates the operation to perform. Its value must be one of "add", "remove", "replace", "move", "copy", or "test"; other values are errors.
json.exception.parse_error.106 | parse error: array index '01' must not begin with '0' | An array index in a JSON Pointer ([RFC 6901](https://tools.ietf.org/html/rfc6901)) may be `0` or any number without a leading `0`.
json.exception.parse_error.107 | parse error: JSON pointer must be empty or begin with '/' - was: 'foo' | A JSON Pointer must be a Unicode string containing a sequence of zero or more reference tokens, each prefixed by a `/` character.
json.exception.parse_error.108 | parse error: escape character '~' must be followed with '0' or '1' | In a JSON Pointer, only `~0` and `~1` are valid escape sequences.
json.exception.parse_error.109 | parse error: array index 'one' is not a number | A JSON Pointer array index must be a number.
json.exception.parse_error.110 | parse error at 1: cannot read 2 bytes from vector | When parsing CBOR or MessagePack, the byte vector ends before the complete value has been read.
json.exception.parse_error.112 | parse error at 1: error reading CBOR; last byte: 0xF8 | Not all types of CBOR or MessagePack are supported. This exception occurs if an unsupported byte was read.
json.exception.parse_error.113 | parse error at 2: expected a CBOR string; last byte: 0x98 | While parsing a map key, a value that is not a string has been read.
json.exception.parse_error.114 | parse error: Unsupported BSON record type 0x0F | The parsing of the corresponding BSON record type is not implemented (yet).
@note For an input with n bytes, 1 is the index of the first character and n+1
is the index of the terminating null byte or the end of file. This also
holds true when reading a byte vector (CBOR or MessagePack).
@liveexample{The following code shows how a `parse_error` exception can be
caught.,parse_error}
@sa @ref exception for the base class of the library exceptions
@sa @ref invalid_iterator for exceptions indicating errors with iterators
@sa @ref type_error for exceptions indicating executing a member function with
a wrong type
@sa @ref out_of_range for exceptions indicating access out of the defined range
@sa @ref other_error for exceptions indicating other library errors
@since version 3.0.0
*/
class parse_error : public exception
{
public:
/*!
@brief create a parse error exception
@param[in] id_ the id of the exception
@param[in] position the position where the error occurred (or with
chars_read_total=0 if the position cannot be
determined)
@param[in] what_arg the explanatory string
@return parse_error object
*/
static parse_error create(int id_, const position_t& pos, const std::string& what_arg)
{
std::string w = exception::name("parse_error", id_) + "parse error" +
position_string(pos) + ": " + what_arg;
return parse_error(id_, pos.chars_read_total, w.c_str());
}
static parse_error create(int id_, std::size_t byte_, const std::string& what_arg)
{
std::string w = exception::name("parse_error", id_) + "parse error" +
(byte_ != 0 ? (" at byte " + std::to_string(byte_)) : "") +
": " + what_arg;
return parse_error(id_, byte_, w.c_str());
}
/*!
@brief byte index of the parse error
The byte index of the last read character in the input file.
@note For an input with n bytes, 1 is the index of the first character and
n+1 is the index of the terminating null byte or the end of file.
This also holds true when reading a byte vector (CBOR or MessagePack).
*/
const std::size_t byte;
private:
parse_error(int id_, std::size_t byte_, const char* what_arg)
: exception(id_, what_arg), byte(byte_) {}
static std::string position_string(const position_t& pos)
{
return " at line " + std::to_string(pos.lines_read + 1) +
", column " + std::to_string(pos.chars_read_current_line);
}
};
/*!
@brief exception indicating errors with iterators
This exception is thrown if iterators passed to a library function do not match
the expected semantics.
Exceptions have ids 2xx.
name / id | example message | description
----------------------------------- | --------------- | -------------------------
json.exception.invalid_iterator.201 | iterators are not compatible | The iterators passed to constructor @ref basic_json(InputIT first, InputIT last) are not compatible, meaning they do not belong to the same container. Therefore, the range (@a first, @a last) is invalid.
json.exception.invalid_iterator.202 | iterator does not fit current value | In an erase or insert function, the passed iterator @a pos does not belong to the JSON value for which the function was called. It hence does not define a valid position for the deletion/insertion.
json.exception.invalid_iterator.203 | iterators do not fit current value | Either iterator passed to function @ref erase(IteratorType first, IteratorType last) does not belong to the JSON value from which values shall be erased. It hence does not define a valid range to delete values from.
json.exception.invalid_iterator.204 | iterators out of range | When an iterator range for a primitive type (number, boolean, or string) is passed to a constructor or an erase function, this range has to be exactly (@ref begin(), @ref end()), because this is the only way the single stored value is expressed. All other ranges are invalid.
json.exception.invalid_iterator.205 | iterator out of range | When an iterator for a primitive type (number, boolean, or string) is passed to an erase function, the iterator has to be the @ref begin() iterator, because it is the only way to address the stored value. All other iterators are invalid.
json.exception.invalid_iterator.206 | cannot construct with iterators from null | The iterators passed to constructor @ref basic_json(InputIT first, InputIT last) belong to a JSON null value and hence to not define a valid range.
json.exception.invalid_iterator.207 | cannot use key() for non-object iterators | The key() member function can only be used on iterators belonging to a JSON object, because other types do not have a concept of a key.
json.exception.invalid_iterator.208 | cannot use operator[] for object iterators | The operator[] to specify a concrete offset cannot be used on iterators belonging to a JSON object, because JSON objects are unordered.
json.exception.invalid_iterator.209 | cannot use offsets with object iterators | The offset operators (+, -, +=, -=) cannot be used on iterators belonging to a JSON object, because JSON objects are unordered.
json.exception.invalid_iterator.210 | iterators do not fit | The iterator range passed to the insert function are not compatible, meaning they do not belong to the same container. Therefore, the range (@a first, @a last) is invalid.
json.exception.invalid_iterator.211 | passed iterators may not belong to container | The iterator range passed to the insert function must not be a subrange of the container to insert to.
json.exception.invalid_iterator.212 | cannot compare iterators of different containers | When two iterators are compared, they must belong to the same container.
json.exception.invalid_iterator.213 | cannot compare order of object iterators | The order of object iterators cannot be compared, because JSON objects are unordered.
json.exception.invalid_iterator.214 | cannot get value | Cannot get value for iterator: Either the iterator belongs to a null value or it is an iterator to a primitive type (number, boolean, or string), but the iterator is different to @ref begin().
@liveexample{The following code shows how an `invalid_iterator` exception can be
caught.,invalid_iterator}
@sa @ref exception for the base class of the library exceptions
@sa @ref parse_error for exceptions indicating a parse error
@sa @ref type_error for exceptions indicating executing a member function with
a wrong type
@sa @ref out_of_range for exceptions indicating access out of the defined range
@sa @ref other_error for exceptions indicating other library errors
@since version 3.0.0
*/
class invalid_iterator : public exception
{
public:
static invalid_iterator create(int id_, const std::string& what_arg)
{
std::string w = exception::name("invalid_iterator", id_) + what_arg;
return invalid_iterator(id_, w.c_str());
}
private:
invalid_iterator(int id_, const char* what_arg)
: exception(id_, what_arg) {}
};
/*!
@brief exception indicating executing a member function with a wrong type
This exception is thrown in case of a type error; that is, a library function is
executed on a JSON value whose type does not match the expected semantics.
Exceptions have ids 3xx.
name / id | example message | description
----------------------------- | --------------- | -------------------------
json.exception.type_error.301 | cannot create object from initializer list | To create an object from an initializer list, the initializer list must consist only of a list of pairs whose first element is a string. When this constraint is violated, an array is created instead.
json.exception.type_error.302 | type must be object, but is array | During implicit or explicit value conversion, the JSON type must be compatible to the target type. For instance, a JSON string can only be converted into string types, but not into numbers or boolean types.
json.exception.type_error.303 | incompatible ReferenceType for get_ref, actual type is object | To retrieve a reference to a value stored in a @ref basic_json object with @ref get_ref, the type of the reference must match the value type. For instance, for a JSON array, the @a ReferenceType must be @ref array_t&.
json.exception.type_error.304 | cannot use at() with string | The @ref at() member functions can only be executed for certain JSON types.
json.exception.type_error.305 | cannot use operator[] with string | The @ref operator[] member functions can only be executed for certain JSON types.
json.exception.type_error.306 | cannot use value() with string | The @ref value() member functions can only be executed for certain JSON types.
json.exception.type_error.307 | cannot use erase() with string | The @ref erase() member functions can only be executed for certain JSON types.
json.exception.type_error.308 | cannot use push_back() with string | The @ref push_back() and @ref operator+= member functions can only be executed for certain JSON types.
json.exception.type_error.309 | cannot use insert() with | The @ref insert() member functions can only be executed for certain JSON types.
json.exception.type_error.310 | cannot use swap() with number | The @ref swap() member functions can only be executed for certain JSON types.
json.exception.type_error.311 | cannot use emplace_back() with string | The @ref emplace_back() member function can only be executed for certain JSON types.
json.exception.type_error.312 | cannot use update() with string | The @ref update() member functions can only be executed for certain JSON types.
json.exception.type_error.313 | invalid value to unflatten | The @ref unflatten function converts an object whose keys are JSON Pointers back into an arbitrary nested JSON value. The JSON Pointers must not overlap, because then the resulting value would not be well defined.
json.exception.type_error.314 | only objects can be unflattened | The @ref unflatten function only works for an object whose keys are JSON Pointers.
json.exception.type_error.315 | values in object must be primitive | The @ref unflatten function only works for an object whose keys are JSON Pointers and whose values are primitive.
json.exception.type_error.316 | invalid UTF-8 byte at index 10: 0x7E | The @ref dump function only works with UTF-8 encoded strings; that is, if you assign a `std::string` to a JSON value, make sure it is UTF-8 encoded. |
json.exception.type_error.317 | JSON value cannot be serialized to requested format | The dynamic type of the object cannot be represented in the requested serialization format (e.g. a raw `true` or `null` JSON object cannot be serialized to BSON) |
@liveexample{The following code shows how a `type_error` exception can be
caught.,type_error}
@sa @ref exception for the base class of the library exceptions
@sa @ref parse_error for exceptions indicating a parse error
@sa @ref invalid_iterator for exceptions indicating errors with iterators
@sa @ref out_of_range for exceptions indicating access out of the defined range
@sa @ref other_error for exceptions indicating other library errors
@since version 3.0.0
*/
class type_error : public exception
{
public:
static type_error create(int id_, const std::string& what_arg)
{
std::string w = exception::name("type_error", id_) + what_arg;
return type_error(id_, w.c_str());
}
private:
type_error(int id_, const char* what_arg) : exception(id_, what_arg) {}
};
/*!
@brief exception indicating access out of the defined range
This exception is thrown in case a library function is called on an input
parameter that exceeds the expected range, for instance in case of array
indices or nonexisting object keys.
Exceptions have ids 4xx.
name / id | example message | description
------------------------------- | --------------- | -------------------------
json.exception.out_of_range.401 | array index 3 is out of range | The provided array index @a i is larger than @a size-1.
json.exception.out_of_range.402 | array index '-' (3) is out of range | The special array index `-` in a JSON Pointer never describes a valid element of the array, but the index past the end. That is, it can only be used to add elements at this position, but not to read it.
json.exception.out_of_range.403 | key 'foo' not found | The provided key was not found in the JSON object.
json.exception.out_of_range.404 | unresolved reference token 'foo' | A reference token in a JSON Pointer could not be resolved.
json.exception.out_of_range.405 | JSON pointer has no parent | The JSON Patch operations 'remove' and 'add' can not be applied to the root element of the JSON value.
json.exception.out_of_range.406 | number overflow parsing '10E1000' | A parsed number could not be stored as without changing it to NaN or INF.
json.exception.out_of_range.407 | number overflow serializing '9223372036854775808' | UBJSON and BSON only support integer numbers up to 9223372036854775807. |
json.exception.out_of_range.408 | excessive array size: 8658170730974374167 | The size (following `#`) of an UBJSON array or object exceeds the maximal capacity. |
json.exception.out_of_range.409 | BSON key cannot contain code point U+0000 (at byte 2) | Key identifiers to be serialized to BSON cannot contain code point U+0000, since the key is stored as zero-terminated c-string |
@liveexample{The following code shows how an `out_of_range` exception can be
caught.,out_of_range}
@sa @ref exception for the base class of the library exceptions
@sa @ref parse_error for exceptions indicating a parse error
@sa @ref invalid_iterator for exceptions indicating errors with iterators
@sa @ref type_error for exceptions indicating executing a member function with
a wrong type
@sa @ref other_error for exceptions indicating other library errors
@since version 3.0.0
*/
class out_of_range : public exception
{
public:
static out_of_range create(int id_, const std::string& what_arg)
{
std::string w = exception::name("out_of_range", id_) + what_arg;
return out_of_range(id_, w.c_str());
}
private:
out_of_range(int id_, const char* what_arg) : exception(id_, what_arg) {}
};
/*!
@brief exception indicating other library errors
This exception is thrown in case of errors that cannot be classified with the
other exception types.
Exceptions have ids 5xx.
name / id | example message | description
------------------------------ | --------------- | -------------------------
json.exception.other_error.501 | unsuccessful: {"op":"test","path":"/baz", "value":"bar"} | A JSON Patch operation 'test' failed. The unsuccessful operation is also printed.
@sa @ref exception for the base class of the library exceptions
@sa @ref parse_error for exceptions indicating a parse error
@sa @ref invalid_iterator for exceptions indicating errors with iterators
@sa @ref type_error for exceptions indicating executing a member function with
a wrong type
@sa @ref out_of_range for exceptions indicating access out of the defined range
@liveexample{The following code shows how an `other_error` exception can be
caught.,other_error}
@since version 3.0.0
*/
class other_error : public exception
{
public:
static other_error create(int id_, const std::string& what_arg)
{
std::string w = exception::name("other_error", id_) + what_arg;
return other_error(id_, w.c_str());
}
private:
other_error(int id_, const char* what_arg) : exception(id_, what_arg) {}
};
} // namespace detail
} // namespace nlohmann
// #include <nlohmann/detail/value_t.hpp>
#include <array> // array
#include <ciso646> // and
#include <cstddef> // size_t
#include <cstdint> // uint8_t
namespace nlohmann
{
namespace detail
{
///////////////////////////
// JSON type enumeration //
///////////////////////////
/*!
@brief the JSON type enumeration
This enumeration collects the different JSON types. It is internally used to
distinguish the stored values, and the functions @ref basic_json::is_null(),
@ref basic_json::is_object(), @ref basic_json::is_array(),
@ref basic_json::is_string(), @ref basic_json::is_boolean(),
@ref basic_json::is_number() (with @ref basic_json::is_number_integer(),
@ref basic_json::is_number_unsigned(), and @ref basic_json::is_number_float()),
@ref basic_json::is_discarded(), @ref basic_json::is_primitive(), and
@ref basic_json::is_structured() rely on it.
@note There are three enumeration entries (number_integer, number_unsigned, and
number_float), because the library distinguishes these three types for numbers:
@ref basic_json::number_unsigned_t is used for unsigned integers,
@ref basic_json::number_integer_t is used for signed integers, and
@ref basic_json::number_float_t is used for floating-point numbers or to
approximate integers which do not fit in the limits of their respective type.
@sa @ref basic_json::basic_json(const value_t value_type) -- create a JSON
value with the default value for a given type
@since version 1.0.0
*/
enum class value_t : std::uint8_t
{
null, ///< null value
object, ///< object (unordered set of name/value pairs)
array, ///< array (ordered collection of values)
string, ///< string value
boolean, ///< boolean value
number_integer, ///< number value (signed integer)
number_unsigned, ///< number value (unsigned integer)
number_float, ///< number value (floating-point)
discarded ///< discarded by the the parser callback function
};
/*!
@brief comparison operator for JSON types
Returns an ordering that is similar to Python:
- order: null < boolean < number < object < array < string
- furthermore, each type is not smaller than itself
- discarded values are not comparable
@since version 1.0.0
*/
inline bool operator<(const value_t lhs, const value_t rhs) noexcept
{
static constexpr std::array<std::uint8_t, 8> order = {{
0 /* null */, 3 /* object */, 4 /* array */, 5 /* string */,
1 /* boolean */, 2 /* integer */, 2 /* unsigned */, 2 /* float */
}
};
const auto l_index = static_cast<std::size_t>(lhs);
const auto r_index = static_cast<std::size_t>(rhs);
return l_index < order.size() and r_index < order.size() and order[l_index] < order[r_index];
}
} // namespace detail
} // namespace nlohmann
// #include <nlohmann/detail/conversions/from_json.hpp>
#include <algorithm> // transform
#include <array> // array
#include <ciso646> // and, not
#include <forward_list> // forward_list
#include <iterator> // inserter, front_inserter, end
#include <map> // map
#include <string> // string
#include <tuple> // tuple, make_tuple
#include <type_traits> // is_arithmetic, is_same, is_enum, underlying_type, is_convertible
#include <unordered_map> // unordered_map
#include <utility> // pair, declval
#include <valarray> // valarray
// #include <nlohmann/detail/exceptions.hpp>
// #include <nlohmann/detail/macro_scope.hpp>
// #include <nlohmann/detail/meta/cpp_future.hpp>
// #include <nlohmann/detail/meta/type_traits.hpp>
// #include <nlohmann/detail/value_t.hpp>
namespace nlohmann
{
namespace detail
{
template<typename BasicJsonType>
void from_json(const BasicJsonType& j, typename std::nullptr_t& n)
{
if (JSON_UNLIKELY(not j.is_null()))
{
JSON_THROW(type_error::create(302, "type must be null, but is " + std::string(j.type_name())));
}
n = nullptr;
}
// overloads for basic_json template parameters
template<typename BasicJsonType, typename ArithmeticType,
enable_if_t<std::is_arithmetic<ArithmeticType>::value and
not std::is_same<ArithmeticType, typename BasicJsonType::boolean_t>::value,
int> = 0>
void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val)
{
switch (static_cast<value_t>(j))
{
case value_t::number_unsigned:
{
val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_unsigned_t*>());
break;
}
case value_t::number_integer:
{
val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_integer_t*>());
break;
}
case value_t::number_float:
{
val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_float_t*>());
break;
}
default:
JSON_THROW(type_error::create(302, "type must be number, but is " + std::string(j.type_name())));
}
}
template<typename BasicJsonType>
void from_json(const BasicJsonType& j, typename BasicJsonType::boolean_t& b)
{
if (JSON_UNLIKELY(not j.is_boolean()))
{
JSON_THROW(type_error::create(302, "type must be boolean, but is " + std::string(j.type_name())));
}
b = *j.template get_ptr<const typename BasicJsonType::boolean_t*>();
}
template<typename BasicJsonType>
void from_json(const BasicJsonType& j, typename BasicJsonType::string_t& s)
{
if (JSON_UNLIKELY(not j.is_string()))
{
JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name())));
}
s = *j.template get_ptr<const typename BasicJsonType::string_t*>();
}
template <
typename BasicJsonType, typename ConstructibleStringType,
enable_if_t <
is_constructible_string_type<BasicJsonType, ConstructibleStringType>::value and
not std::is_same<typename BasicJsonType::string_t,
ConstructibleStringType>::value,
int > = 0 >
void from_json(const BasicJsonType& j, ConstructibleStringType& s)
{
if (JSON_UNLIKELY(not j.is_string()))
{
JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name())));
}
s = *j.template get_ptr<const typename BasicJsonType::string_t*>();
}
template<typename BasicJsonType>
void from_json(const BasicJsonType& j, typename BasicJsonType::number_float_t& val)
{
get_arithmetic_value(j, val);
}
template<typename BasicJsonType>
void from_json(const BasicJsonType& j, typename BasicJsonType::number_unsigned_t& val)
{
get_arithmetic_value(j, val);
}
template<typename BasicJsonType>
void from_json(const BasicJsonType& j, typename BasicJsonType::number_integer_t& val)
{
get_arithmetic_value(j, val);
}
template<typename BasicJsonType, typename EnumType,
enable_if_t<std::is_enum<EnumType>::value, int> = 0>
void from_json(const BasicJsonType& j, EnumType& e)
{
typename std::underlying_type<EnumType>::type val;
get_arithmetic_value(j, val);
e = static_cast<EnumType>(val);
}
// forward_list doesn't have an insert method
template<typename BasicJsonType, typename T, typename Allocator,
enable_if_t<std::is_convertible<BasicJsonType, T>::value, int> = 0>
void from_json(const BasicJsonType& j, std::forward_list<T, Allocator>& l)
{
if (JSON_UNLIKELY(not j.is_array()))
{
JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name())));
}
std::transform(j.rbegin(), j.rend(),
std::front_inserter(l), [](const BasicJsonType & i)
{
return i.template get<T>();
});
}
// valarray doesn't have an insert method
template<typename BasicJsonType, typename T,
enable_if_t<std::is_convertible<BasicJsonType, T>::value, int> = 0>
void from_json(const BasicJsonType& j, std::valarray<T>& l)
{
if (JSON_UNLIKELY(not j.is_array()))
{
JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name())));
}
l.resize(j.size());
std::copy(j.m_value.array->begin(), j.m_value.array->end(), std::begin(l));
}
template<typename BasicJsonType>
void from_json_array_impl(const BasicJsonType& j, typename BasicJsonType::array_t& arr, priority_tag<3> /*unused*/)
{
arr = *j.template get_ptr<const typename BasicJsonType::array_t*>();
}
template <typename BasicJsonType, typename T, std::size_t N>
auto from_json_array_impl(const BasicJsonType& j, std::array<T, N>& arr,
priority_tag<2> /*unused*/)
-> decltype(j.template get<T>(), void())
{
for (std::size_t i = 0; i < N; ++i)
{
arr[i] = j.at(i).template get<T>();
}
}
template<typename BasicJsonType, typename ConstructibleArrayType>
auto from_json_array_impl(const BasicJsonType& j, ConstructibleArrayType& arr, priority_tag<1> /*unused*/)
-> decltype(
arr.reserve(std::declval<typename ConstructibleArrayType::size_type>()),
j.template get<typename ConstructibleArrayType::value_type>(),
void())
{
using std::end;
arr.reserve(j.size());
std::transform(j.begin(), j.end(),
std::inserter(arr, end(arr)), [](const BasicJsonType & i)
{
// get<BasicJsonType>() returns *this, this won't call a from_json
// method when value_type is BasicJsonType
return i.template get<typename ConstructibleArrayType::value_type>();
});
}
template <typename BasicJsonType, typename ConstructibleArrayType>
void from_json_array_impl(const BasicJsonType& j, ConstructibleArrayType& arr,
priority_tag<0> /*unused*/)
{
using std::end;
std::transform(
j.begin(), j.end(), std::inserter(arr, end(arr)),
[](const BasicJsonType & i)
{
// get<BasicJsonType>() returns *this, this won't call a from_json
// method when value_type is BasicJsonType
return i.template get<typename ConstructibleArrayType::value_type>();
});
}
template <typename BasicJsonType, typename ConstructibleArrayType,
enable_if_t <
is_constructible_array_type<BasicJsonType, ConstructibleArrayType>::value and
not is_constructible_object_type<BasicJsonType, ConstructibleArrayType>::value and
not is_constructible_string_type<BasicJsonType, ConstructibleArrayType>::value and
not is_basic_json<ConstructibleArrayType>::value,
int > = 0 >
auto from_json(const BasicJsonType& j, ConstructibleArrayType& arr)
-> decltype(from_json_array_impl(j, arr, priority_tag<3> {}),
j.template get<typename ConstructibleArrayType::value_type>(),
void())
{
if (JSON_UNLIKELY(not j.is_array()))
{
JSON_THROW(type_error::create(302, "type must be array, but is " +
std::string(j.type_name())));
}
from_json_array_impl(j, arr, priority_tag<3> {});
}
template<typename BasicJsonType, typename ConstructibleObjectType,
enable_if_t<is_constructible_object_type<BasicJsonType, ConstructibleObjectType>::value, int> = 0>
void from_json(const BasicJsonType& j, ConstructibleObjectType& obj)
{
if (JSON_UNLIKELY(not j.is_object()))
{
JSON_THROW(type_error::create(302, "type must be object, but is " + std::string(j.type_name())));
}
auto inner_object = j.template get_ptr<const typename BasicJsonType::object_t*>();
using value_type = typename ConstructibleObjectType::value_type;
std::transform(
inner_object->begin(), inner_object->end(),
std::inserter(obj, obj.begin()),
[](typename BasicJsonType::object_t::value_type const & p)
{
return value_type(p.first, p.second.template get<typename ConstructibleObjectType::mapped_type>());
});
}
// overload for arithmetic types, not chosen for basic_json template arguments
// (BooleanType, etc..); note: Is it really necessary to provide explicit
// overloads for boolean_t etc. in case of a custom BooleanType which is not
// an arithmetic type?
template<typename BasicJsonType, typename ArithmeticType,
enable_if_t <
std::is_arithmetic<ArithmeticType>::value and
not std::is_same<ArithmeticType, typename BasicJsonType::number_unsigned_t>::value and
not std::is_same<ArithmeticType, typename BasicJsonType::number_integer_t>::value and
not std::is_same<ArithmeticType, typename BasicJsonType::number_float_t>::value and
not std::is_same<ArithmeticType, typename BasicJsonType::boolean_t>::value,
int> = 0>
void from_json(const BasicJsonType& j, ArithmeticType& val)
{
switch (static_cast<value_t>(j))
{
case value_t::number_unsigned:
{
val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_unsigned_t*>());
break;
}
case value_t::number_integer:
{
val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_integer_t*>());
break;
}
case value_t::number_float:
{
val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_float_t*>());
break;
}
case value_t::boolean:
{
val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::boolean_t*>());
break;
}
default:
JSON_THROW(type_error::create(302, "type must be number, but is " + std::string(j.type_name())));
}
}
template<typename BasicJsonType, typename A1, typename A2>
void from_json(const BasicJsonType& j, std::pair<A1, A2>& p)
{
p = {j.at(0).template get<A1>(), j.at(1).template get<A2>()};
}
template<typename BasicJsonType, typename Tuple, std::size_t... Idx>
void from_json_tuple_impl(const BasicJsonType& j, Tuple& t, index_sequence<Idx...> /*unused*/)
{
t = std::make_tuple(j.at(Idx).template get<typename std::tuple_element<Idx, Tuple>::type>()...);
}
template<typename BasicJsonType, typename... Args>
void from_json(const BasicJsonType& j, std::tuple<Args...>& t)
{
from_json_tuple_impl(j, t, index_sequence_for<Args...> {});
}
template <typename BasicJsonType, typename Key, typename Value, typename Compare, typename Allocator,
typename = enable_if_t<not std::is_constructible<
typename BasicJsonType::string_t, Key>::value>>
void from_json(const BasicJsonType& j, std::map<Key, Value, Compare, Allocator>& m)
{
if (JSON_UNLIKELY(not j.is_array()))
{
JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name())));
}
for (const auto& p : j)
{
if (JSON_UNLIKELY(not p.is_array()))
{
JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(p.type_name())));
}
m.emplace(p.at(0).template get<Key>(), p.at(1).template get<Value>());
}
}
template <typename BasicJsonType, typename Key, typename Value, typename Hash, typename KeyEqual, typename Allocator,
typename = enable_if_t<not std::is_constructible<
typename BasicJsonType::string_t, Key>::value>>
void from_json(const BasicJsonType& j, std::unordered_map<Key, Value, Hash, KeyEqual, Allocator>& m)
{
if (JSON_UNLIKELY(not j.is_array()))
{
JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name())));
}
for (const auto& p : j)
{
if (JSON_UNLIKELY(not p.is_array()))
{
JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(p.type_name())));
}
m.emplace(p.at(0).template get<Key>(), p.at(1).template get<Value>());
}
}
struct from_json_fn
{
template<typename BasicJsonType, typename T>
auto operator()(const BasicJsonType& j, T& val) const
noexcept(noexcept(from_json(j, val)))
-> decltype(from_json(j, val), void())
{
return from_json(j, val);
}
};
} // namespace detail
/// namespace to hold default `from_json` function
/// to see why this is required:
/// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4381.html
namespace
{
constexpr const auto& from_json = detail::static_const<detail::from_json_fn>::value;
} // namespace
} // namespace nlohmann
// #include <nlohmann/detail/conversions/to_json.hpp>
#include <ciso646> // or, and, not
#include <iterator> // begin, end
#include <tuple> // tuple, get
#include <type_traits> // is_same, is_constructible, is_floating_point, is_enum, underlying_type
#include <utility> // move, forward, declval, pair
#include <valarray> // valarray
#include <vector> // vector
// #include <nlohmann/detail/meta/cpp_future.hpp>
// #include <nlohmann/detail/meta/type_traits.hpp>
// #include <nlohmann/detail/value_t.hpp>
// #include <nlohmann/detail/iterators/iteration_proxy.hpp>
#include <cstddef> // size_t
#include <string> // string, to_string
#include <iterator> // input_iterator_tag
#include <tuple> // tuple_size, get, tuple_element
// #include <nlohmann/detail/value_t.hpp>
// #include <nlohmann/detail/meta/type_traits.hpp>
namespace nlohmann
{
namespace detail
{
template <typename IteratorType> class iteration_proxy_value
{
public:
using difference_type = std::ptrdiff_t;
using value_type = iteration_proxy_value;
using pointer = value_type * ;
using reference = value_type & ;
using iterator_category = std::input_iterator_tag;
private:
/// the iterator
IteratorType anchor;
/// an index for arrays (used to create key names)
std::size_t array_index = 0;
/// last stringified array index
mutable std::size_t array_index_last = 0;
/// a string representation of the array index
mutable std::string array_index_str = "0";
/// an empty string (to return a reference for primitive values)
const std::string empty_str = "";
public:
explicit iteration_proxy_value(IteratorType it) noexcept : anchor(it) {}
/// dereference operator (needed for range-based for)
iteration_proxy_value& operator*()
{
return *this;
}
/// increment operator (needed for range-based for)
iteration_proxy_value& operator++()
{
++anchor;
++array_index;
return *this;
}
/// equality operator (needed for InputIterator)
bool operator==(const iteration_proxy_value& o) const noexcept
{
return anchor == o.anchor;
}
/// inequality operator (needed for range-based for)
bool operator!=(const iteration_proxy_value& o) const noexcept
{
return anchor != o.anchor;
}
/// return key of the iterator
const std::string& key() const
{
assert(anchor.m_object != nullptr);
switch (anchor.m_object->type())
{
// use integer array index as key
case value_t::array:
{
if (array_index != array_index_last)
{
array_index_str = std::to_string(array_index);
array_index_last = array_index;
}
return array_index_str;
}
// use key from the object
case value_t::object:
return anchor.key();
// use an empty key for all primitive types
default:
return empty_str;
}
}
/// return value of the iterator
typename IteratorType::reference value() const
{
return anchor.value();
}
};
/// proxy class for the items() function
template<typename IteratorType> class iteration_proxy
{
private:
/// the container to iterate
typename IteratorType::reference container;
public:
/// construct iteration proxy from a container
explicit iteration_proxy(typename IteratorType::reference cont) noexcept
: container(cont) {}
/// return iterator begin (needed for range-based for)
iteration_proxy_value<IteratorType> begin() noexcept
{
return iteration_proxy_value<IteratorType>(container.begin());
}
/// return iterator end (needed for range-based for)
iteration_proxy_value<IteratorType> end() noexcept
{
return iteration_proxy_value<IteratorType>(container.end());
}
};
// Structured Bindings Support
// For further reference see https://blog.tartanllama.xyz/structured-bindings/
// And see https://github.com/nlohmann/json/pull/1391
template <std::size_t N, typename IteratorType, enable_if_t<N == 0, int> = 0>
auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>& i) -> decltype(i.key())
{
return i.key();
}
// Structured Bindings Support
// For further reference see https://blog.tartanllama.xyz/structured-bindings/
// And see https://github.com/nlohmann/json/pull/1391
template <std::size_t N, typename IteratorType, enable_if_t<N == 1, int> = 0>
auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>& i) -> decltype(i.value())
{
return i.value();
}
} // namespace detail
} // namespace nlohmann
// The Addition to the STD Namespace is required to add
// Structured Bindings Support to the iteration_proxy_value class
// For further reference see https://blog.tartanllama.xyz/structured-bindings/
// And see https://github.com/nlohmann/json/pull/1391
namespace std
{
template <typename IteratorType>
class tuple_size<::nlohmann::detail::iteration_proxy_value<IteratorType>>
: public std::integral_constant<std::size_t, 2> {};
template <std::size_t N, typename IteratorType>
class tuple_element<N, ::nlohmann::detail::iteration_proxy_value<IteratorType >>
{
public:
using type = decltype(
get<N>(std::declval <
::nlohmann::detail::iteration_proxy_value<IteratorType >> ()));
};
}
namespace nlohmann
{
namespace detail
{
//////////////////
// constructors //
//////////////////
template<value_t> struct external_constructor;
template<>
struct external_constructor<value_t::boolean>
{
template<typename BasicJsonType>
static void construct(BasicJsonType& j, typename BasicJsonType::boolean_t b) noexcept
{
j.m_type = value_t::boolean;
j.m_value = b;
j.assert_invariant();
}
};
template<>
struct external_constructor<value_t::string>
{
template<typename BasicJsonType>
static void construct(BasicJsonType& j, const typename BasicJsonType::string_t& s)
{
j.m_type = value_t::string;
j.m_value = s;
j.assert_invariant();
}
template<typename BasicJsonType>
static void construct(BasicJsonType& j, typename BasicJsonType::string_t&& s)
{
j.m_type = value_t::string;
j.m_value = std::move(s);
j.assert_invariant();
}
template<typename BasicJsonType, typename CompatibleStringType,
enable_if_t<not std::is_same<CompatibleStringType, typename BasicJsonType::string_t>::value,
int> = 0>
static void construct(BasicJsonType& j, const CompatibleStringType& str)
{
j.m_type = value_t::string;
j.m_value.string = j.template create<typename BasicJsonType::string_t>(str);
j.assert_invariant();
}
};
template<>
struct external_constructor<value_t::number_float>
{
template<typename BasicJsonType>
static void construct(BasicJsonType& j, typename BasicJsonType::number_float_t val) noexcept
{
j.m_type = value_t::number_float;
j.m_value = val;
j.assert_invariant();
}
};
template<>
struct external_constructor<value_t::number_unsigned>
{
template<typename BasicJsonType>
static void construct(BasicJsonType& j, typename BasicJsonType::number_unsigned_t val) noexcept
{
j.m_type = value_t::number_unsigned;
j.m_value = val;
j.assert_invariant();
}
};
template<>
struct external_constructor<value_t::number_integer>
{
template<typename BasicJsonType>
static void construct(BasicJsonType& j, typename BasicJsonType::number_integer_t val) noexcept
{
j.m_type = value_t::number_integer;
j.m_value = val;
j.assert_invariant();
}
};
template<>
struct external_constructor<value_t::array>
{
template<typename BasicJsonType>
static void construct(BasicJsonType& j, const typename BasicJsonType::array_t& arr)
{
j.m_type = value_t::array;
j.m_value = arr;
j.assert_invariant();
}
template<typename BasicJsonType>
static void construct(BasicJsonType& j, typename BasicJsonType::array_t&& arr)
{
j.m_type = value_t::array;
j.m_value = std::move(arr);
j.assert_invariant();
}
template<typename BasicJsonType, typename CompatibleArrayType,
enable_if_t<not std::is_same<CompatibleArrayType, typename BasicJsonType::array_t>::value,
int> = 0>
static void construct(BasicJsonType& j, const CompatibleArrayType& arr)
{
using std::begin;
using std::end;
j.m_type = value_t::array;
j.m_value.array = j.template create<typename BasicJsonType::array_t>(begin(arr), end(arr));
j.assert_invariant();
}
template<typename BasicJsonType>
static void construct(BasicJsonType& j, const std::vector<bool>& arr)
{
j.m_type = value_t::array;
j.m_value = value_t::array;
j.m_value.array->reserve(arr.size());
for (const bool x : arr)
{
j.m_value.array->push_back(x);
}
j.assert_invariant();
}
template<typename BasicJsonType, typename T,
enable_if_t<std::is_convertible<T, BasicJsonType>::value, int> = 0>
static void construct(BasicJsonType& j, const std::valarray<T>& arr)
{
j.m_type = value_t::array;
j.m_value = value_t::array;
j.m_value.array->resize(arr.size());
std::copy(std::begin(arr), std::end(arr), j.m_value.array->begin());
j.assert_invariant();
}
};
template<>
struct external_constructor<value_t::object>
{
template<typename BasicJsonType>
static void construct(BasicJsonType& j, const typename BasicJsonType::object_t& obj)
{
j.m_type = value_t::object;
j.m_value = obj;
j.assert_invariant();
}
template<typename BasicJsonType>
static void construct(BasicJsonType& j, typename BasicJsonType::object_t&& obj)
{
j.m_type = value_t::object;
j.m_value = std::move(obj);
j.assert_invariant();
}
template<typename BasicJsonType, typename CompatibleObjectType,
enable_if_t<not std::is_same<CompatibleObjectType, typename BasicJsonType::object_t>::value, int> = 0>
static void construct(BasicJsonType& j, const CompatibleObjectType& obj)
{
using std::begin;
using std::end;
j.m_type = value_t::object;
j.m_value.object = j.template create<typename BasicJsonType::object_t>(begin(obj), end(obj));
j.assert_invariant();
}
};
/////////////
// to_json //
/////////////
template<typename BasicJsonType, typename T,
enable_if_t<std::is_same<T, typename BasicJsonType::boolean_t>::value, int> = 0>
void to_json(BasicJsonType& j, T b) noexcept
{
external_constructor<value_t::boolean>::construct(j, b);
}
template<typename BasicJsonType, typename CompatibleString,
enable_if_t<std::is_constructible<typename BasicJsonType::string_t, CompatibleString>::value, int> = 0>
void to_json(BasicJsonType& j, const CompatibleString& s)
{
external_constructor<value_t::string>::construct(j, s);
}
template<typename BasicJsonType>
void to_json(BasicJsonType& j, typename BasicJsonType::string_t&& s)
{
external_constructor<value_t::string>::construct(j, std::move(s));
}
template<typename BasicJsonType, typename FloatType,
enable_if_t<std::is_floating_point<FloatType>::value, int> = 0>
void to_json(BasicJsonType& j, FloatType val) noexcept
{
external_constructor<value_t::number_float>::construct(j, static_cast<typename BasicJsonType::number_float_t>(val));
}
template<typename BasicJsonType, typename CompatibleNumberUnsignedType,
enable_if_t<is_compatible_integer_type<typename BasicJsonType::number_unsigned_t, CompatibleNumberUnsignedType>::value, int> = 0>
void to_json(BasicJsonType& j, CompatibleNumberUnsignedType val) noexcept
{
external_constructor<value_t::number_unsigned>::construct(j, static_cast<typename BasicJsonType::number_unsigned_t>(val));
}
template<typename BasicJsonType, typename CompatibleNumberIntegerType,
enable_if_t<is_compatible_integer_type<typename BasicJsonType::number_integer_t, CompatibleNumberIntegerType>::value, int> = 0>
void to_json(BasicJsonType& j, CompatibleNumberIntegerType val) noexcept
{
external_constructor<value_t::number_integer>::construct(j, static_cast<typename BasicJsonType::number_integer_t>(val));
}
template<typename BasicJsonType, typename EnumType,
enable_if_t<std::is_enum<EnumType>::value, int> = 0>
void to_json(BasicJsonType& j, EnumType e) noexcept
{
using underlying_type = typename std::underlying_type<EnumType>::type;
external_constructor<value_t::number_integer>::construct(j, static_cast<underlying_type>(e));
}
template<typename BasicJsonType>
void to_json(BasicJsonType& j, const std::vector<bool>& e)
{
external_constructor<value_t::array>::construct(j, e);
}
template <typename BasicJsonType, typename CompatibleArrayType,
enable_if_t<is_compatible_array_type<BasicJsonType,
CompatibleArrayType>::value and
not is_compatible_object_type<
BasicJsonType, CompatibleArrayType>::value and
not is_compatible_string_type<BasicJsonType, CompatibleArrayType>::value and
not is_basic_json<CompatibleArrayType>::value,
int> = 0>
void to_json(BasicJsonType& j, const CompatibleArrayType& arr)
{
external_constructor<value_t::array>::construct(j, arr);
}
template<typename BasicJsonType, typename T,
enable_if_t<std::is_convertible<T, BasicJsonType>::value, int> = 0>
void to_json(BasicJsonType& j, const std::valarray<T>& arr)
{
external_constructor<value_t::array>::construct(j, std::move(arr));
}
template<typename BasicJsonType>
void to_json(BasicJsonType& j, typename BasicJsonType::array_t&& arr)
{
external_constructor<value_t::array>::construct(j, std::move(arr));
}
template<typename BasicJsonType, typename CompatibleObjectType,
enable_if_t<is_compatible_object_type<BasicJsonType, CompatibleObjectType>::value and not is_basic_json<CompatibleObjectType>::value, int> = 0>
void to_json(BasicJsonType& j, const CompatibleObjectType& obj)
{
external_constructor<value_t::object>::construct(j, obj);
}
template<typename BasicJsonType>
void to_json(BasicJsonType& j, typename BasicJsonType::object_t&& obj)
{
external_constructor<value_t::object>::construct(j, std::move(obj));
}
template <
typename BasicJsonType, typename T, std::size_t N,
enable_if_t<not std::is_constructible<typename BasicJsonType::string_t,
const T(&)[N]>::value,
int> = 0 >
void to_json(BasicJsonType& j, const T(&arr)[N])
{
external_constructor<value_t::array>::construct(j, arr);
}
template<typename BasicJsonType, typename... Args>
void to_json(BasicJsonType& j, const std::pair<Args...>& p)
{
j = { p.first, p.second };
}
// for https://github.com/nlohmann/json/pull/1134
template < typename BasicJsonType, typename T,
enable_if_t<std::is_same<T, iteration_proxy_value<typename BasicJsonType::iterator>>::value, int> = 0>
void to_json(BasicJsonType& j, const T& b)
{
j = { {b.key(), b.value()} };
}
template<typename BasicJsonType, typename Tuple, std::size_t... Idx>
void to_json_tuple_impl(BasicJsonType& j, const Tuple& t, index_sequence<Idx...> /*unused*/)
{
j = { std::get<Idx>(t)... };
}
template<typename BasicJsonType, typename... Args>
void to_json(BasicJsonType& j, const std::tuple<Args...>& t)
{
to_json_tuple_impl(j, t, index_sequence_for<Args...> {});
}
struct to_json_fn
{
template<typename BasicJsonType, typename T>
auto operator()(BasicJsonType& j, T&& val) const noexcept(noexcept(to_json(j, std::forward<T>(val))))
-> decltype(to_json(j, std::forward<T>(val)), void())
{
return to_json(j, std::forward<T>(val));
}
};
} // namespace detail
/// namespace to hold default `to_json` function
namespace
{
constexpr const auto& to_json = detail::static_const<detail::to_json_fn>::value;
} // namespace
} // namespace nlohmann
// #include <nlohmann/detail/input/input_adapters.hpp>
#include <cassert> // assert
#include <cstddef> // size_t
#include <cstring> // strlen
#include <istream> // istream
#include <iterator> // begin, end, iterator_traits, random_access_iterator_tag, distance, next
#include <memory> // shared_ptr, make_shared, addressof
#include <numeric> // accumulate
#include <string> // string, char_traits
#include <type_traits> // enable_if, is_base_of, is_pointer, is_integral, remove_pointer
#include <utility> // pair, declval
#include <cstdio> //FILE *
// #include <nlohmann/detail/macro_scope.hpp>
namespace nlohmann
{
namespace detail
{
/// the supported input formats
enum class input_format_t { json, cbor, msgpack, ubjson, bson };
////////////////////
// input adapters //
////////////////////
/*!
@brief abstract input adapter interface
Produces a stream of std::char_traits<char>::int_type characters from a
std::istream, a buffer, or some other input type. Accepts the return of
exactly one non-EOF character for future input. The int_type characters
returned consist of all valid char values as positive values (typically
unsigned char), plus an EOF value outside that range, specified by the value
of the function std::char_traits<char>::eof(). This value is typically -1, but
could be any arbitrary value which is not a valid char value.
*/
struct input_adapter_protocol
{
/// get a character [0,255] or std::char_traits<char>::eof().
virtual std::char_traits<char>::int_type get_character() = 0;
virtual ~input_adapter_protocol() = default;
};
/// a type to simplify interfaces
using input_adapter_t = std::shared_ptr<input_adapter_protocol>;
/*!
Input adapter for stdio file access. This adapter read only 1 byte and do not use any
buffer. This adapter is a very low level adapter.
*/
class file_input_adapter : public input_adapter_protocol
{
public:
explicit file_input_adapter(std::FILE* f) noexcept
: m_file(f)
{}
std::char_traits<char>::int_type get_character() noexcept override
{
return std::fgetc(m_file);
}
private:
/// the file pointer to read from
std::FILE* m_file;
};
/*!
Input adapter for a (caching) istream. Ignores a UFT Byte Order Mark at
beginning of input. Does not support changing the underlying std::streambuf
in mid-input. Maintains underlying std::istream and std::streambuf to support
subsequent use of standard std::istream operations to process any input
characters following those used in parsing the JSON input. Clears the
std::istream flags; any input errors (e.g., EOF) will be detected by the first
subsequent call for input from the std::istream.
*/
class input_stream_adapter : public input_adapter_protocol
{
public:
~input_stream_adapter() override
{
// clear stream flags; we use underlying streambuf I/O, do not
// maintain ifstream flags, except eof
is.clear(is.rdstate() & std::ios::eofbit);
}
explicit input_stream_adapter(std::istream& i)
: is(i), sb(*i.rdbuf())
{}
// delete because of pointer members
input_stream_adapter(const input_stream_adapter&) = delete;
input_stream_adapter& operator=(input_stream_adapter&) = delete;
input_stream_adapter(input_stream_adapter&&) = delete;
input_stream_adapter& operator=(input_stream_adapter&&) = delete;
// std::istream/std::streambuf use std::char_traits<char>::to_int_type, to
// ensure that std::char_traits<char>::eof() and the character 0xFF do not
// end up as the same value, eg. 0xFFFFFFFF.
std::char_traits<char>::int_type get_character() override
{
auto res = sb.sbumpc();
// set eof manually, as we don't use the istream interface.
if (res == EOF)
{
is.clear(is.rdstate() | std::ios::eofbit);
}
return res;
}
private:
/// the associated input stream
std::istream& is;
std::streambuf& sb;
};
/// input adapter for buffer input
class input_buffer_adapter : public input_adapter_protocol
{
public:
input_buffer_adapter(const char* b, const std::size_t l) noexcept
: cursor(b), limit(b + l)
{}
// delete because of pointer members
input_buffer_adapter(const input_buffer_adapter&) = delete;
input_buffer_adapter& operator=(input_buffer_adapter&) = delete;
input_buffer_adapter(input_buffer_adapter&&) = delete;
input_buffer_adapter& operator=(input_buffer_adapter&&) = delete;
~input_buffer_adapter() override = default;
std::char_traits<char>::int_type get_character() noexcept override
{
if (JSON_LIKELY(cursor < limit))
{
return std::char_traits<char>::to_int_type(*(cursor++));
}
return std::char_traits<char>::eof();
}
private:
/// pointer to the current character
const char* cursor;
/// pointer past the last character
const char* const limit;
};
template<typename WideStringType, size_t T>
struct wide_string_input_helper
{
// UTF-32
static void fill_buffer(const WideStringType& str, size_t& current_wchar, std::array<std::char_traits<char>::int_type, 4>& utf8_bytes, size_t& utf8_bytes_index, size_t& utf8_bytes_filled)
{
utf8_bytes_index = 0;
if (current_wchar == str.size())
{
utf8_bytes[0] = std::char_traits<char>::eof();
utf8_bytes_filled = 1;
}
else
{
// get the current character
const auto wc = static_cast<int>(str[current_wchar++]);
// UTF-32 to UTF-8 encoding
if (wc < 0x80)
{
utf8_bytes[0] = wc;
utf8_bytes_filled = 1;
}
else if (wc <= 0x7FF)
{
utf8_bytes[0] = 0xC0 | ((wc >> 6) & 0x1F);
utf8_bytes[1] = 0x80 | (wc & 0x3F);
utf8_bytes_filled = 2;
}
else if (wc <= 0xFFFF)
{
utf8_bytes[0] = 0xE0 | ((wc >> 12) & 0x0F);
utf8_bytes[1] = 0x80 | ((wc >> 6) & 0x3F);
utf8_bytes[2] = 0x80 | (wc & 0x3F);
utf8_bytes_filled = 3;
}
else if (wc <= 0x10FFFF)
{
utf8_bytes[0] = 0xF0 | ((wc >> 18) & 0x07);
utf8_bytes[1] = 0x80 | ((wc >> 12) & 0x3F);
utf8_bytes[2] = 0x80 | ((wc >> 6) & 0x3F);
utf8_bytes[3] = 0x80 | (wc & 0x3F);
utf8_bytes_filled = 4;
}
else
{
// unknown character
utf8_bytes[0] = wc;
utf8_bytes_filled = 1;
}
}
}
};
template<typename WideStringType>
struct wide_string_input_helper<WideStringType, 2>
{
// UTF-16
static void fill_buffer(const WideStringType& str, size_t& current_wchar, std::array<std::char_traits<char>::int_type, 4>& utf8_bytes, size_t& utf8_bytes_index, size_t& utf8_bytes_filled)
{
utf8_bytes_index = 0;
if (current_wchar == str.size())
{
utf8_bytes[0] = std::char_traits<char>::eof();
utf8_bytes_filled = 1;
}
else
{
// get the current character
const auto wc = static_cast<int>(str[current_wchar++]);
// UTF-16 to UTF-8 encoding
if (wc < 0x80)
{
utf8_bytes[0] = wc;
utf8_bytes_filled = 1;
}
else if (wc <= 0x7FF)
{
utf8_bytes[0] = 0xC0 | ((wc >> 6));
utf8_bytes[1] = 0x80 | (wc & 0x3F);
utf8_bytes_filled = 2;
}
else if (0xD800 > wc or wc >= 0xE000)
{
utf8_bytes[0] = 0xE0 | ((wc >> 12));
utf8_bytes[1] = 0x80 | ((wc >> 6) & 0x3F);
utf8_bytes[2] = 0x80 | (wc & 0x3F);
utf8_bytes_filled = 3;
}
else
{
if (current_wchar < str.size())
{
const auto wc2 = static_cast<int>(str[current_wchar++]);
const int charcode = 0x10000 + (((wc & 0x3FF) << 10) | (wc2 & 0x3FF));
utf8_bytes[0] = 0xf0 | (charcode >> 18);
utf8_bytes[1] = 0x80 | ((charcode >> 12) & 0x3F);
utf8_bytes[2] = 0x80 | ((charcode >> 6) & 0x3F);
utf8_bytes[3] = 0x80 | (charcode & 0x3F);
utf8_bytes_filled = 4;
}
else
{
// unknown character
++current_wchar;
utf8_bytes[0] = wc;
utf8_bytes_filled = 1;
}
}
}
}
};
template<typename WideStringType>
class wide_string_input_adapter : public input_adapter_protocol
{
public:
explicit wide_string_input_adapter(const WideStringType& w) noexcept
: str(w)
{}
std::char_traits<char>::int_type get_character() noexcept override
{
// check if buffer needs to be filled
if (utf8_bytes_index == utf8_bytes_filled)
{
fill_buffer<sizeof(typename WideStringType::value_type)>();
assert(utf8_bytes_filled > 0);
assert(utf8_bytes_index == 0);
}
// use buffer
assert(utf8_bytes_filled > 0);
assert(utf8_bytes_index < utf8_bytes_filled);
return utf8_bytes[utf8_bytes_index++];
}
private:
template<size_t T>
void fill_buffer()
{
wide_string_input_helper<WideStringType, T>::fill_buffer(str, current_wchar, utf8_bytes, utf8_bytes_index, utf8_bytes_filled);
}
/// the wstring to process
const WideStringType& str;
/// index of the current wchar in str
std::size_t current_wchar = 0;
/// a buffer for UTF-8 bytes
std::array<std::char_traits<char>::int_type, 4> utf8_bytes = {{0, 0, 0, 0}};
/// index to the utf8_codes array for the next valid byte
std::size_t utf8_bytes_index = 0;
/// number of valid bytes in the utf8_codes array
std::size_t utf8_bytes_filled = 0;
};
class input_adapter
{
public:
// native support
input_adapter(std::FILE* file)
: ia(std::make_shared<file_input_adapter>(file)) {}
/// input adapter for input stream
input_adapter(std::istream& i)
: ia(std::make_shared<input_stream_adapter>(i)) {}
/// input adapter for input stream
input_adapter(std::istream&& i)
: ia(std::make_shared<input_stream_adapter>(i)) {}
input_adapter(const std::wstring& ws)
: ia(std::make_shared<wide_string_input_adapter<std::wstring>>(ws)) {}
input_adapter(const std::u16string& ws)
: ia(std::make_shared<wide_string_input_adapter<std::u16string>>(ws)) {}
input_adapter(const std::u32string& ws)
: ia(std::make_shared<wide_string_input_adapter<std::u32string>>(ws)) {}
/// input adapter for buffer
template<typename CharT,
typename std::enable_if<
std::is_pointer<CharT>::value and
std::is_integral<typename std::remove_pointer<CharT>::type>::value and
sizeof(typename std::remove_pointer<CharT>::type) == 1,
int>::type = 0>
input_adapter(CharT b, std::size_t l)
: ia(std::make_shared<input_buffer_adapter>(reinterpret_cast<const char*>(b), l)) {}
// derived support
/// input adapter for string literal
template<typename CharT,
typename std::enable_if<
std::is_pointer<CharT>::value and
std::is_integral<typename std::remove_pointer<CharT>::type>::value and
sizeof(typename std::remove_pointer<CharT>::type) == 1,
int>::type = 0>
input_adapter(CharT b)
: input_adapter(reinterpret_cast<const char*>(b),
std::strlen(reinterpret_cast<const char*>(b))) {}
/// input adapter for iterator range with contiguous storage
template<class IteratorType,
typename std::enable_if<
std::is_same<typename iterator_traits<IteratorType>::iterator_category, std::random_access_iterator_tag>::value,
int>::type = 0>
input_adapter(IteratorType first, IteratorType last)
{
#ifndef NDEBUG
// assertion to check that the iterator range is indeed contiguous,
// see http://stackoverflow.com/a/35008842/266378 for more discussion
const auto is_contiguous = std::accumulate(
first, last, std::pair<bool, int>(true, 0),
[&first](std::pair<bool, int> res, decltype(*first) val)
{
res.first &= (val == *(std::next(std::addressof(*first), res.second++)));
return res;
}).first;
assert(is_contiguous);
#endif
// assertion to check that each element is 1 byte long
static_assert(
sizeof(typename iterator_traits<IteratorType>::value_type) == 1,
"each element in the iterator range must have the size of 1 byte");
const auto len = static_cast<size_t>(std::distance(first, last));
if (JSON_LIKELY(len > 0))
{
// there is at least one element: use the address of first
ia = std::make_shared<input_buffer_adapter>(reinterpret_cast<const char*>(&(*first)), len);
}
else
{
// the address of first cannot be used: use nullptr
ia = std::make_shared<input_buffer_adapter>(nullptr, len);
}
}
/// input adapter for array
template<class T, std::size_t N>
input_adapter(T (&array)[N])
: input_adapter(std::begin(array), std::end(array)) {}
/// input adapter for contiguous container
template<class ContiguousContainer, typename
std::enable_if<not std::is_pointer<ContiguousContainer>::value and
std::is_base_of<std::random_access_iterator_tag, typename iterator_traits<decltype(std::begin(std::declval<ContiguousContainer const>()))>::iterator_category>::value,
int>::type = 0>
input_adapter(const ContiguousContainer& c)
: input_adapter(std::begin(c), std::end(c)) {}
operator input_adapter_t()
{
return ia;
}
private:
/// the actual adapter
input_adapter_t ia = nullptr;
};
} // namespace detail
} // namespace nlohmann
// #include <nlohmann/detail/input/lexer.hpp>
#include <clocale> // localeconv
#include <cstddef> // size_t
#include <cstdlib> // strtof, strtod, strtold, strtoll, strtoull
#include <cstdio> // snprintf
#include <initializer_list> // initializer_list
#include <string> // char_traits, string
#include <vector> // vector
// #include <nlohmann/detail/macro_scope.hpp>
// #include <nlohmann/detail/input/input_adapters.hpp>
// #include <nlohmann/detail/input/position_t.hpp>
namespace nlohmann
{
namespace detail
{
///////////
// lexer //
///////////
/*!
@brief lexical analysis
This class organizes the lexical analysis during JSON deserialization.
*/
template<typename BasicJsonType>
class lexer
{
using number_integer_t = typename BasicJsonType::number_integer_t;
using number_unsigned_t = typename BasicJsonType::number_unsigned_t;
using number_float_t = typename BasicJsonType::number_float_t;
using string_t = typename BasicJsonType::string_t;
public:
/// token types for the parser
enum class token_type
{
uninitialized, ///< indicating the scanner is uninitialized
literal_true, ///< the `true` literal
literal_false, ///< the `false` literal
literal_null, ///< the `null` literal
value_string, ///< a string -- use get_string() for actual value
value_unsigned, ///< an unsigned integer -- use get_number_unsigned() for actual value
value_integer, ///< a signed integer -- use get_number_integer() for actual value
value_float, ///< an floating point number -- use get_number_float() for actual value
begin_array, ///< the character for array begin `[`
begin_object, ///< the character for object begin `{`
end_array, ///< the character for array end `]`
end_object, ///< the character for object end `}`
name_separator, ///< the name separator `:`
value_separator, ///< the value separator `,`
parse_error, ///< indicating a parse error
end_of_input, ///< indicating the end of the input buffer
literal_or_value ///< a literal or the begin of a value (only for diagnostics)
};
/// return name of values of type token_type (only used for errors)
static const char* token_type_name(const token_type t) noexcept
{
switch (t)
{
case token_type::uninitialized:
return "<uninitialized>";
case token_type::literal_true:
return "true literal";
case token_type::literal_false:
return "false literal";
case token_type::literal_null:
return "null literal";
case token_type::value_string:
return "string literal";
case lexer::token_type::value_unsigned:
case lexer::token_type::value_integer:
case lexer::token_type::value_float:
return "number literal";
case token_type::begin_array:
return "'['";
case token_type::begin_object:
return "'{'";
case token_type::end_array:
return "']'";
case token_type::end_object:
return "'}'";
case token_type::name_separator:
return "':'";
case token_type::value_separator:
return "','";
case token_type::parse_error:
return "<parse error>";
case token_type::end_of_input:
return "end of input";
case token_type::literal_or_value:
return "'[', '{', or a literal";
// LCOV_EXCL_START
default: // catch non-enum values
return "unknown token";
// LCOV_EXCL_STOP
}
}
explicit lexer(detail::input_adapter_t&& adapter)
: ia(std::move(adapter)), decimal_point_char(get_decimal_point()) {}
// delete because of pointer members
lexer(const lexer&) = delete;
lexer(lexer&&) = delete;
lexer& operator=(lexer&) = delete;
lexer& operator=(lexer&&) = delete;
~lexer() = default;
private:
/////////////////////
// locales
/////////////////////
/// return the locale-dependent decimal point
static char get_decimal_point() noexcept
{
const auto loc = localeconv();
assert(loc != nullptr);
return (loc->decimal_point == nullptr) ? '.' : *(loc->decimal_point);
}
/////////////////////
// scan functions
/////////////////////
/*!
@brief get codepoint from 4 hex characters following `\u`
For input "\u c1 c2 c3 c4" the codepoint is:
(c1 * 0x1000) + (c2 * 0x0100) + (c3 * 0x0010) + c4
= (c1 << 12) + (c2 << 8) + (c3 << 4) + (c4 << 0)
Furthermore, the possible characters '0'..'9', 'A'..'F', and 'a'..'f'
must be converted to the integers 0x0..0x9, 0xA..0xF, 0xA..0xF, resp. The
conversion is done by subtracting the offset (0x30, 0x37, and 0x57)
between the ASCII value of the character and the desired integer value.
@return codepoint (0x0000..0xFFFF) or -1 in case of an error (e.g. EOF or
non-hex character)
*/
int get_codepoint()
{
// this function only makes sense after reading `\u`
assert(current == 'u');
int codepoint = 0;
const auto factors = { 12, 8, 4, 0 };
for (const auto factor : factors)
{
get();
if (current >= '0' and current <= '9')
{
codepoint += ((current - 0x30) << factor);
}
else if (current >= 'A' and current <= 'F')
{
codepoint += ((current - 0x37) << factor);
}
else if (current >= 'a' and current <= 'f')
{
codepoint += ((current - 0x57) << factor);
}
else
{
return -1;
}
}
assert(0x0000 <= codepoint and codepoint <= 0xFFFF);
return codepoint;
}
/*!
@brief check if the next byte(s) are inside a given range
Adds the current byte and, for each passed range, reads a new byte and
checks if it is inside the range. If a violation was detected, set up an
error message and return false. Otherwise, return true.
@param[in] ranges list of integers; interpreted as list of pairs of
inclusive lower and upper bound, respectively
@pre The passed list @a ranges must have 2, 4, or 6 elements; that is,
1, 2, or 3 pairs. This precondition is enforced by an assertion.
@return true if and only if no range violation was detected
*/
bool next_byte_in_range(std::initializer_list<int> ranges)
{
assert(ranges.size() == 2 or ranges.size() == 4 or ranges.size() == 6);
add(current);
for (auto range = ranges.begin(); range != ranges.end(); ++range)
{
get();
if (JSON_LIKELY(*range <= current and current <= *(++range)))
{
add(current);
}
else
{
error_message = "invalid string: ill-formed UTF-8 byte";
return false;
}
}
return true;
}
/*!
@brief scan a string literal
This function scans a string according to Sect. 7 of RFC 7159. While
scanning, bytes are escaped and copied into buffer token_buffer. Then the
function returns successfully, token_buffer is *not* null-terminated (as it
may contain \0 bytes), and token_buffer.size() is the number of bytes in the
string.
@return token_type::value_string if string could be successfully scanned,
token_type::parse_error otherwise
@note In case of errors, variable error_message contains a textual
description.
*/
token_type scan_string()
{
// reset token_buffer (ignore opening quote)
reset();
// we entered the function by reading an open quote
assert(current == '\"');
while (true)
{
// get next character
switch (get())
{
// end of file while parsing string
case std::char_traits<char>::eof():
{
error_message = "invalid string: missing closing quote";
return token_type::parse_error;
}
// closing quote
case '\"':
{
return token_type::value_string;
}
// escapes
case '\\':
{
switch (get())
{
// quotation mark
case '\"':
add('\"');
break;
// reverse solidus
case '\\':
add('\\');
break;
// solidus
case '/':
add('/');
break;
// backspace
case 'b':
add('\b');
break;
// form feed
case 'f':
add('\f');
break;
// line feed
case 'n':
add('\n');
break;
// carriage return
case 'r':
add('\r');
break;
// tab
case 't':
add('\t');
break;
// unicode escapes
case 'u':
{
const int codepoint1 = get_codepoint();
int codepoint = codepoint1; // start with codepoint1
if (JSON_UNLIKELY(codepoint1 == -1))
{
error_message = "invalid string: '\\u' must be followed by 4 hex digits";
return token_type::parse_error;
}
// check if code point is a high surrogate
if (0xD800 <= codepoint1 and codepoint1 <= 0xDBFF)
{
// expect next \uxxxx entry
if (JSON_LIKELY(get() == '\\' and get() == 'u'))
{
const int codepoint2 = get_codepoint();
if (JSON_UNLIKELY(codepoint2 == -1))
{
error_message = "invalid string: '\\u' must be followed by 4 hex digits";
return token_type::parse_error;
}
// check if codepoint2 is a low surrogate
if (JSON_LIKELY(0xDC00 <= codepoint2 and codepoint2 <= 0xDFFF))
{
// overwrite codepoint
codepoint =
// high surrogate occupies the most significant 22 bits
(codepoint1 << 10)
// low surrogate occupies the least significant 15 bits
+ codepoint2
// there is still the 0xD800, 0xDC00 and 0x10000 noise
// in the result so we have to subtract with:
// (0xD800 << 10) + DC00 - 0x10000 = 0x35FDC00
- 0x35FDC00;
}
else
{
error_message = "invalid string: surrogate U+DC00..U+DFFF must be followed by U+DC00..U+DFFF";
return token_type::parse_error;
}
}
else
{
error_message = "invalid string: surrogate U+DC00..U+DFFF must be followed by U+DC00..U+DFFF";
return token_type::parse_error;
}
}
else
{
if (JSON_UNLIKELY(0xDC00 <= codepoint1 and codepoint1 <= 0xDFFF))
{
error_message = "invalid string: surrogate U+DC00..U+DFFF must follow U+D800..U+DBFF";
return token_type::parse_error;
}
}
// result of the above calculation yields a proper codepoint
assert(0x00 <= codepoint and codepoint <= 0x10FFFF);
// translate codepoint into bytes
if (codepoint < 0x80)
{
// 1-byte characters: 0xxxxxxx (ASCII)
add(codepoint);
}
else if (codepoint <= 0x7FF)
{
// 2-byte characters: 110xxxxx 10xxxxxx
add(0xC0 | (codepoint >> 6));
add(0x80 | (codepoint & 0x3F));
}
else if (codepoint <= 0xFFFF)
{
// 3-byte characters: 1110xxxx 10xxxxxx 10xxxxxx
add(0xE0 | (codepoint >> 12));
add(0x80 | ((codepoint >> 6) & 0x3F));
add(0x80 | (codepoint & 0x3F));
}
else
{
// 4-byte characters: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
add(0xF0 | (codepoint >> 18));
add(0x80 | ((codepoint >> 12) & 0x3F));
add(0x80 | ((codepoint >> 6) & 0x3F));
add(0x80 | (codepoint & 0x3F));
}
break;
}
// other characters after escape
default:
error_message = "invalid string: forbidden character after backslash";
return token_type::parse_error;
}
break;
}
// invalid control characters
case 0x00:
{
error_message = "invalid string: control character U+0000 (NUL) must be escaped to \\u0000";
return token_type::parse_error;
}
case 0x01:
{
error_message = "invalid string: control character U+0001 (SOH) must be escaped to \\u0001";
return token_type::parse_error;
}
case 0x02:
{
error_message = "invalid string: control character U+0002 (STX) must be escaped to \\u0002";
return token_type::parse_error;
}
case 0x03:
{
error_message = "invalid string: control character U+0003 (ETX) must be escaped to \\u0003";
return token_type::parse_error;
}
case 0x04:
{
error_message = "invalid string: control character U+0004 (EOT) must be escaped to \\u0004";
return token_type::parse_error;
}
case 0x05:
{
error_message = "invalid string: control character U+0005 (ENQ) must be escaped to \\u0005";
return token_type::parse_error;
}
case 0x06:
{
error_message = "invalid string: control character U+0006 (ACK) must be escaped to \\u0006";
return token_type::parse_error;
}
case 0x07:
{
error_message = "invalid string: control character U+0007 (BEL) must be escaped to \\u0007";
return token_type::parse_error;
}
case 0x08:
{
error_message = "invalid string: control character U+0008 (BS) must be escaped to \\u0008 or \\b";
return token_type::parse_error;
}
case 0x09:
{
error_message = "invalid string: control character U+0009 (HT) must be escaped to \\u0009 or \\t";
return token_type::parse_error;
}
case 0x0A:
{
error_message = "invalid string: control character U+000A (LF) must be escaped to \\u000A or \\n";
return token_type::parse_error;
}
case 0x0B:
{
error_message = "invalid string: control character U+000B (VT) must be escaped to \\u000B";
return token_type::parse_error;
}
case 0x0C:
{
error_message = "invalid string: control character U+000C (FF) must be escaped to \\u000C or \\f";
return token_type::parse_error;
}
case 0x0D:
{
error_message = "invalid string: control character U+000D (CR) must be escaped to \\u000D or \\r";
return token_type::parse_error;
}
case 0x0E:
{
error_message = "invalid string: control character U+000E (SO) must be escaped to \\u000E";
return token_type::parse_error;
}
case 0x0F:
{
error_message = "invalid string: control character U+000F (SI) must be escaped to \\u000F";
return token_type::parse_error;
}
case 0x10:
{
error_message = "invalid string: control character U+0010 (DLE) must be escaped to \\u0010";
return token_type::parse_error;
}
case 0x11:
{
error_message = "invalid string: control character U+0011 (DC1) must be escaped to \\u0011";
return token_type::parse_error;
}
case 0x12:
{
error_message = "invalid string: control character U+0012 (DC2) must be escaped to \\u0012";
return token_type::parse_error;
}
case 0x13:
{
error_message = "invalid string: control character U+0013 (DC3) must be escaped to \\u0013";
return token_type::parse_error;
}
case 0x14:
{
error_message = "invalid string: control character U+0014 (DC4) must be escaped to \\u0014";
return token_type::parse_error;
}
case 0x15:
{
error_message = "invalid string: control character U+0015 (NAK) must be escaped to \\u0015";
return token_type::parse_error;
}
case 0x16:
{
error_message = "invalid string: control character U+0016 (SYN) must be escaped to \\u0016";
return token_type::parse_error;
}
case 0x17:
{
error_message = "invalid string: control character U+0017 (ETB) must be escaped to \\u0017";
return token_type::parse_error;
}
case 0x18:
{
error_message = "invalid string: control character U+0018 (CAN) must be escaped to \\u0018";
return token_type::parse_error;
}
case 0x19:
{
error_message = "invalid string: control character U+0019 (EM) must be escaped to \\u0019";
return token_type::parse_error;
}
case 0x1A:
{
error_message = "invalid string: control character U+001A (SUB) must be escaped to \\u001A";
return token_type::parse_error;
}
case 0x1B:
{
error_message = "invalid string: control character U+001B (ESC) must be escaped to \\u001B";
return token_type::parse_error;
}
case 0x1C:
{
error_message = "invalid string: control character U+001C (FS) must be escaped to \\u001C";
return token_type::parse_error;
}
case 0x1D:
{
error_message = "invalid string: control character U+001D (GS) must be escaped to \\u001D";
return token_type::parse_error;
}
case 0x1E:
{
error_message = "invalid string: control character U+001E (RS) must be escaped to \\u001E";
return token_type::parse_error;
}
case 0x1F:
{
error_message = "invalid string: control character U+001F (US) must be escaped to \\u001F";
return token_type::parse_error;
}
// U+0020..U+007F (except U+0022 (quote) and U+005C (backspace))
case 0x20:
case 0x21:
case 0x23:
case 0x24:
case 0x25:
case 0x26:
case 0x27:
case 0x28:
case 0x29:
case 0x2A:
case 0x2B:
case 0x2C:
case 0x2D:
case 0x2E:
case 0x2F:
case 0x30:
case 0x31:
case 0x32:
case 0x33:
case 0x34:
case 0x35:
case 0x36:
case 0x37:
case 0x38:
case 0x39:
case 0x3A:
case 0x3B:
case 0x3C:
case 0x3D:
case 0x3E:
case 0x3F:
case 0x40:
case 0x41:
case 0x42:
case 0x43:
case 0x44:
case 0x45:
case 0x46:
case 0x47:
case 0x48:
case 0x49:
case 0x4A:
case 0x4B:
case 0x4C:
case 0x4D:
case 0x4E:
case 0x4F:
case 0x50:
case 0x51:
case 0x52:
case 0x53:
case 0x54:
case 0x55:
case 0x56:
case 0x57:
case 0x58:
case 0x59:
case 0x5A:
case 0x5B:
case 0x5D:
case 0x5E:
case 0x5F:
case 0x60:
case 0x61:
case 0x62:
case 0x63:
case 0x64:
case 0x65:
case 0x66:
case 0x67:
case 0x68:
case 0x69:
case 0x6A:
case 0x6B:
case 0x6C:
case 0x6D:
case 0x6E:
case 0x6F:
case 0x70:
case 0x71:
case 0x72:
case 0x73:
case 0x74:
case 0x75:
case 0x76:
case 0x77:
case 0x78:
case 0x79:
case 0x7A:
case 0x7B:
case 0x7C:
case 0x7D:
case 0x7E:
case 0x7F:
{
add(current);
break;
}
// U+0080..U+07FF: bytes C2..DF 80..BF
case 0xC2:
case 0xC3:
case 0xC4:
case 0xC5:
case 0xC6:
case 0xC7:
case 0xC8:
case 0xC9:
case 0xCA:
case 0xCB:
case 0xCC:
case 0xCD:
case 0xCE:
case 0xCF:
case 0xD0:
case 0xD1:
case 0xD2:
case 0xD3:
case 0xD4:
case 0xD5:
case 0xD6:
case 0xD7:
case 0xD8:
case 0xD9:
case 0xDA:
case 0xDB:
case 0xDC:
case 0xDD:
case 0xDE:
case 0xDF:
{
if (JSON_UNLIKELY(not next_byte_in_range({0x80, 0xBF})))
{
return token_type::parse_error;
}
break;
}
// U+0800..U+0FFF: bytes E0 A0..BF 80..BF
case 0xE0:
{
if (JSON_UNLIKELY(not (next_byte_in_range({0xA0, 0xBF, 0x80, 0xBF}))))
{
return token_type::parse_error;
}
break;
}
// U+1000..U+CFFF: bytes E1..EC 80..BF 80..BF
// U+E000..U+FFFF: bytes EE..EF 80..BF 80..BF
case 0xE1:
case 0xE2:
case 0xE3:
case 0xE4:
case 0xE5:
case 0xE6:
case 0xE7:
case 0xE8:
case 0xE9:
case 0xEA:
case 0xEB:
case 0xEC:
case 0xEE:
case 0xEF:
{
if (JSON_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF}))))
{
return token_type::parse_error;
}
break;
}
// U+D000..U+D7FF: bytes ED 80..9F 80..BF
case 0xED:
{
if (JSON_UNLIKELY(not (next_byte_in_range({0x80, 0x9F, 0x80, 0xBF}))))
{
return token_type::parse_error;
}
break;
}
// U+10000..U+3FFFF F0 90..BF 80..BF 80..BF
case 0xF0:
{
if (JSON_UNLIKELY(not (next_byte_in_range({0x90, 0xBF, 0x80, 0xBF, 0x80, 0xBF}))))
{
return token_type::parse_error;
}
break;
}
// U+40000..U+FFFFF F1..F3 80..BF 80..BF 80..BF
case 0xF1:
case 0xF2:
case 0xF3:
{
if (JSON_UNLIKELY(not (next_byte_in_range({0x80, 0xBF, 0x80, 0xBF, 0x80, 0xBF}))))
{
return token_type::parse_error;
}
break;
}
// U+100000..U+10FFFF F4 80..8F 80..BF 80..BF
case 0xF4:
{
if (JSON_UNLIKELY(not (next_byte_in_range({0x80, 0x8F, 0x80, 0xBF, 0x80, 0xBF}))))
{
return token_type::parse_error;
}
break;
}
// remaining bytes (80..C1 and F5..FF) are ill-formed
default:
{
error_message = "invalid string: ill-formed UTF-8 byte";
return token_type::parse_error;
}
}
}
}
static void strtof(float& f, const char* str, char** endptr) noexcept
{
f = std::strtof(str, endptr);
}
static void strtof(double& f, const char* str, char** endptr) noexcept
{
f = std::strtod(str, endptr);
}
static void strtof(long double& f, const char* str, char** endptr) noexcept
{
f = std::strtold(str, endptr);
}
/*!
@brief scan a number literal
This function scans a string according to Sect. 6 of RFC 7159.
The function is realized with a deterministic finite state machine derived
from the grammar described in RFC 7159. Starting in state "init", the
input is read and used to determined the next state. Only state "done"
accepts the number. State "error" is a trap state to model errors. In the
table below, "anything" means any character but the ones listed before.
state | 0 | 1-9 | e E | + | - | . | anything
---------|----------|----------|----------|---------|---------|----------|-----------
init | zero | any1 | [error] | [error] | minus | [error] | [error]
minus | zero | any1 | [error] | [error] | [error] | [error] | [error]
zero | done | done | exponent | done | done | decimal1 | done
any1 | any1 | any1 | exponent | done | done | decimal1 | done
decimal1 | decimal2 | [error] | [error] | [error] | [error] | [error] | [error]
decimal2 | decimal2 | decimal2 | exponent | done | done | done | done
exponent | any2 | any2 | [error] | sign | sign | [error] | [error]
sign | any2 | any2 | [error] | [error] | [error] | [error] | [error]
any2 | any2 | any2 | done | done | done | done | done
The state machine is realized with one label per state (prefixed with
"scan_number_") and `goto` statements between them. The state machine
contains cycles, but any cycle can be left when EOF is read. Therefore,
the function is guaranteed to terminate.
During scanning, the read bytes are stored in token_buffer. This string is
then converted to a signed integer, an unsigned integer, or a
floating-point number.
@return token_type::value_unsigned, token_type::value_integer, or
token_type::value_float if number could be successfully scanned,
token_type::parse_error otherwise
@note The scanner is independent of the current locale. Internally, the
locale's decimal point is used instead of `.` to work with the
locale-dependent converters.
*/
token_type scan_number() // lgtm [cpp/use-of-goto]
{
// reset token_buffer to store the number's bytes
reset();
// the type of the parsed number; initially set to unsigned; will be
// changed if minus sign, decimal point or exponent is read
token_type number_type = token_type::value_unsigned;
// state (init): we just found out we need to scan a number
switch (current)
{
case '-':
{
add(current);
goto scan_number_minus;
}
case '0':
{
add(current);
goto scan_number_zero;
}
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
{
add(current);
goto scan_number_any1;
}
// LCOV_EXCL_START
default:
{
// all other characters are rejected outside scan_number()
assert(false);
}
// LCOV_EXCL_STOP
}
scan_number_minus:
// state: we just parsed a leading minus sign
number_type = token_type::value_integer;
switch (get())
{
case '0':
{
add(current);
goto scan_number_zero;
}
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
{
add(current);
goto scan_number_any1;
}
default:
{
error_message = "invalid number; expected digit after '-'";
return token_type::parse_error;
}
}
scan_number_zero:
// state: we just parse a zero (maybe with a leading minus sign)
switch (get())
{
case '.':
{
add(decimal_point_char);
goto scan_number_decimal1;
}
case 'e':
case 'E':
{
add(current);
goto scan_number_exponent;
}
default:
goto scan_number_done;
}
scan_number_any1:
// state: we just parsed a number 0-9 (maybe with a leading minus sign)
switch (get())
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
{
add(current);
goto scan_number_any1;
}
case '.':
{
add(decimal_point_char);
goto scan_number_decimal1;
}
case 'e':
case 'E':
{
add(current);
goto scan_number_exponent;
}
default:
goto scan_number_done;
}
scan_number_decimal1:
// state: we just parsed a decimal point
number_type = token_type::value_float;
switch (get())
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
{
add(current);
goto scan_number_decimal2;
}
default:
{
error_message = "invalid number; expected digit after '.'";
return token_type::parse_error;
}
}
scan_number_decimal2:
// we just parsed at least one number after a decimal point
switch (get())
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
{
add(current);
goto scan_number_decimal2;
}
case 'e':
case 'E':
{
add(current);
goto scan_number_exponent;
}
default:
goto scan_number_done;
}
scan_number_exponent:
// we just parsed an exponent
number_type = token_type::value_float;
switch (get())
{
case '+':
case '-':
{
add(current);
goto scan_number_sign;
}
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
{
add(current);
goto scan_number_any2;
}
default:
{
error_message =
"invalid number; expected '+', '-', or digit after exponent";
return token_type::parse_error;
}
}
scan_number_sign:
// we just parsed an exponent sign
switch (get())
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
{
add(current);
goto scan_number_any2;
}
default:
{
error_message = "invalid number; expected digit after exponent sign";
return token_type::parse_error;
}
}
scan_number_any2:
// we just parsed a number after the exponent or exponent sign
switch (get())
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
{
add(current);
goto scan_number_any2;
}
default:
goto scan_number_done;
}
scan_number_done:
// unget the character after the number (we only read it to know that
// we are done scanning a number)
unget();
char* endptr = nullptr;
errno = 0;
// try to parse integers first and fall back to floats
if (number_type == token_type::value_unsigned)
{
const auto x = std::strtoull(token_buffer.data(), &endptr, 10);
// we checked the number format before
assert(endptr == token_buffer.data() + token_buffer.size());
if (errno == 0)
{
value_unsigned = static_cast<number_unsigned_t>(x);
if (value_unsigned == x)
{
return token_type::value_unsigned;
}
}
}
else if (number_type == token_type::value_integer)
{
const auto x = std::strtoll(token_buffer.data(), &endptr, 10);
// we checked the number format before
assert(endptr == token_buffer.data() + token_buffer.size());
if (errno == 0)
{
value_integer = static_cast<number_integer_t>(x);
if (value_integer == x)
{
return token_type::value_integer;
}
}
}
// this code is reached if we parse a floating-point number or if an
// integer conversion above failed
strtof(value_float, token_buffer.data(), &endptr);
// we checked the number format before
assert(endptr == token_buffer.data() + token_buffer.size());
return token_type::value_float;
}
/*!
@param[in] literal_text the literal text to expect
@param[in] length the length of the passed literal text
@param[in] return_type the token type to return on success
*/
token_type scan_literal(const char* literal_text, const std::size_t length,
token_type return_type)
{
assert(current == literal_text[0]);
for (std::size_t i = 1; i < length; ++i)
{
if (JSON_UNLIKELY(get() != literal_text[i]))
{
error_message = "invalid literal";
return token_type::parse_error;
}
}
return return_type;
}
/////////////////////
// input management
/////////////////////
/// reset token_buffer; current character is beginning of token
void reset() noexcept
{
token_buffer.clear();
token_string.clear();
token_string.push_back(std::char_traits<char>::to_char_type(current));
}
/*
@brief get next character from the input
This function provides the interface to the used input adapter. It does
not throw in case the input reached EOF, but returns a
`std::char_traits<char>::eof()` in that case. Stores the scanned characters
for use in error messages.
@return charac
gitextract_nw10eimf/
├── .gitignore
├── .gitmodules
├── LICENSE
├── Makefile
├── README.md
├── include/
│ ├── ams_bpc.h
│ ├── gui/
│ │ ├── button.hpp
│ │ ├── gui.hpp
│ │ ├── gui_hekate.hpp
│ │ ├── gui_main.hpp
│ │ ├── gui_override_key.hpp
│ │ ├── gui_overrides_menu.hpp
│ │ ├── gui_sysmodule.hpp
│ │ ├── gui_title_list.hpp
│ │ ├── list_selector.hpp
│ │ ├── message_box.hpp
│ │ └── theme.h
│ ├── service_guard.h
│ └── utils/
│ ├── jpeg.hpp
│ ├── json.hpp
│ ├── override_key.hpp
│ ├── threads.hpp
│ ├── titleinfo.hpp
│ ├── types.h
│ └── utils.hpp
└── source/
├── ams_bpc.c
├── gui/
│ ├── button.cpp
│ ├── gui.cpp
│ ├── gui_hekate.cpp
│ ├── gui_main.cpp
│ ├── gui_override_key.cpp
│ ├── gui_overrides_menu.cpp
│ ├── gui_sysmodule.cpp
│ ├── gui_title_list.cpp
│ ├── list_selector.cpp
│ ├── message_box.cpp
│ └── theme.c
├── main.cpp
└── utils/
├── jpeg.cpp
├── override_key.cpp
├── threads.cpp
├── titleinfo.cpp
└── utils.cpp
Copy disabled (too large)
Download .txt
Showing preview only (34,993K chars total). Download the full file to get everything.
SYMBOL INDEX (785 symbols across 32 files)
FILE: include/gui/button.hpp
class Gui (line 8) | class Gui
type AdjacentButtonDirection (line 10) | enum AdjacentButtonDirection {
class Button (line 17) | class Button {
method isActivated (line 25) | inline bool isActivated() {
method isSelected (line 29) | inline bool isSelected() {
method _defaultDrawAction (line 34) | static void _defaultDrawAction(Gui *, u16, u16, bool *) {}
method _defaultInputAction (line 35) | static void _defaultInputAction(u32, bool *) {}
method _defaultUsableCondition (line 36) | static bool _defaultUsableCondition() { return true; }
FILE: include/gui/gui.hpp
type gui_t (line 31) | enum gui_t {
class Gui (line 41) | class Gui {
type gui_t (line 57) | enum gui_t
method draw (line 73) | virtual void draw() {
method onInput (line 78) | virtual void onInput(u32 kdown) {
method onTouch (line 81) | virtual void onTouch(HidTouchState &touch) {
method endInit (line 110) | void endInit() {
method drawButtons (line 116) | void drawButtons() {
method inputButtons (line 121) | bool inputButtons(u32 kdown) {
method touchButtons (line 129) | void touchButtons(HidTouchState &touch) {
FILE: include/gui/gui_hekate.hpp
class GuiHekate (line 11) | class GuiHekate : public Gui {
FILE: include/gui/gui_main.hpp
class GuiMain (line 11) | class GuiMain : public Gui {
FILE: include/gui/gui_override_key.hpp
class GuiOverrideKey (line 6) | class GuiOverrideKey : public Gui {
FILE: include/gui/gui_overrides_menu.hpp
type OverrideButtonType (line 6) | enum class OverrideButtonType {
class GuiOverridesMenu (line 12) | class GuiOverridesMenu : public Gui {
FILE: include/gui/gui_sysmodule.hpp
class GuiSysmodule (line 16) | class GuiSysmodule : public Gui {
FILE: include/gui/gui_title_list.hpp
class GuiTitleList (line 5) | class GuiTitleList : public Gui {
FILE: include/gui/list_selector.hpp
class Gui (line 9) | class Gui
class ListSelector (line 11) | class ListSelector {
FILE: include/gui/message_box.hpp
class Gui (line 7) | class Gui
class MessageBox (line 9) | class MessageBox {
type MessageBoxOption (line 17) | enum MessageBoxOption {
FILE: include/gui/theme.h
type theme_t (line 6) | typedef struct {
FILE: include/service_guard.h
type ServiceGuard (line 8) | typedef struct ServiceGuard {
function NX_INLINE (line 13) | NX_INLINE bool serviceGuardBeginInit(ServiceGuard* g)
function NX_INLINE (line 19) | NX_INLINE Result serviceGuardEndInit(ServiceGuard* g, Result rc, void (*...
function NX_INLINE (line 29) | NX_INLINE void serviceGuardExit(ServiceGuard* g, void (*cleanupFunc)(void))
FILE: include/utils/jpeg.hpp
type WidthHeight (line 4) | struct WidthHeight {
FILE: include/utils/json.hpp
type nlohmann (line 65) | namespace nlohmann
type adl_serializer (line 75) | struct adl_serializer
method from_json (line 12426) | static auto from_json(BasicJsonType&& j, ValueType& val) noexcept(
method to_json (line 12443) | static auto to_json(BasicJsonType& j, ValueType&& val) noexcept(
class basic_json (line 87) | class basic_json
class json_pointer (line 101) | class json_pointer
class basic_json (line 11721) | class basic_json
method json_pointer (line 11745) | explicit json_pointer(const std::string& s = "")
method to_string (line 11764) | std::string to_string() const
method array_index (line 11787) | static int array_index(const std::string& s)
method pop_back (line 11806) | std::string pop_back()
method is_root (line 11819) | bool is_root() const noexcept
method json_pointer (line 11824) | json_pointer top() const
method BasicJsonType (line 11844) | BasicJsonType& get_and_create(BasicJsonType& j) const
type detail (line 262) | namespace detail
type index_sequence (line 274) | struct index_sequence
method size (line 278) | static constexpr std::size_t size() noexcept
type merge_and_renumber (line 285) | struct merge_and_renumber
type make_index_sequence (line 292) | struct make_index_sequence
type make_index_sequence<0> (line 296) | struct make_index_sequence<0> : index_sequence<> {}
type make_index_sequence<1> (line 297) | struct make_index_sequence<1> : index_sequence<0> {}
type priority_tag (line 303) | struct priority_tag : priority_tag < N - 1 > {}
type priority_tag<0> (line 304) | struct priority_tag<0> {}
type static_const (line 308) | struct static_const
type make_void (line 340) | struct make_void
type iterator_types (line 356) | struct iterator_types {}
type iterator_types <
It,
void_t<typename It::difference_type, typename It::value_type, typename It::pointer,
typename It::reference, typename It::iterator_category >> (line 359) | struct iterator_types <
type iterator_traits (line 374) | struct iterator_traits
type iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >> (line 379) | struct iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >>
type iterator_traits<T*, enable_if_t<std::is_object<T>::value>> (line 385) | struct iterator_traits<T*, enable_if_t<std::is_object<T>::value>>
type nonesuch (line 411) | struct nonesuch
method nonesuch (line 413) | nonesuch() = delete;
method nonesuch (line 415) | nonesuch(nonesuch const&) = delete;
type detector (line 423) | struct detector
type is_basic_json (line 485) | struct is_basic_json : std::false_type {}
type has_from_json (line 529) | struct has_from_json : std::false_type {}
type has_from_json<BasicJsonType, T,
enable_if_t<not is_basic_json<T>::value>> (line 532) | struct has_from_json<BasicJsonType, T,
type has_non_default_from_json (line 545) | struct has_non_default_from_json : std::false_type {}
type has_non_default_from_json<BasicJsonType, T, enable_if_t<not is_basic_json<T>::value>> (line 548) | struct has_non_default_from_json<BasicJsonType, T, enable_if_t<not i...
type has_to_json (line 560) | struct has_to_json : std::false_type {}
type has_to_json<BasicJsonType, T, enable_if_t<not is_basic_json<T>::value>> (line 563) | struct has_to_json<BasicJsonType, T, enable_if_t<not is_basic_json<T...
type is_iterator_traits (line 578) | struct is_iterator_traits : std::false_type {}
type is_iterator_traits<iterator_traits<T>> (line 581) | struct is_iterator_traits<iterator_traits<T>>
type is_complete_type (line 598) | struct is_complete_type : std::false_type {}
type is_complete_type<T, decltype(void(sizeof(T)))> (line 601) | struct is_complete_type<T, decltype(void(sizeof(T)))> : std::true_ty...
type is_compatible_object_type_impl (line 605) | struct is_compatible_object_type_impl : std::false_type {}
type is_compatible_object_type_impl <
BasicJsonType, CompatibleObjectType,
enable_if_t<is_detected<mapped_type_t, CompatibleObjectType>::value and
is_detected<key_type_t, CompatibleObjectType>::value >> (line 608) | struct is_compatible_object_type_impl <
type is_compatible_object_type (line 625) | struct is_compatible_object_type
type is_constructible_object_type_impl (line 630) | struct is_constructible_object_type_impl : std::false_type {}
type is_constructible_object_type_impl <
BasicJsonType, ConstructibleObjectType,
enable_if_t<is_detected<mapped_type_t, ConstructibleObjectType>::value and
is_detected<key_type_t, ConstructibleObjectType>::value >> (line 633) | struct is_constructible_object_type_impl <
type is_constructible_object_type (line 648) | struct is_constructible_object_type
type is_compatible_string_type_impl (line 654) | struct is_compatible_string_type_impl : std::false_type {}
type is_compatible_string_type_impl <
BasicJsonType, CompatibleStringType,
enable_if_t<is_detected_exact<typename BasicJsonType::string_t::value_type,
value_type_t, CompatibleStringType>::value >> (line 657) | struct is_compatible_string_type_impl <
type is_compatible_string_type (line 667) | struct is_compatible_string_type
type is_constructible_string_type_impl (line 672) | struct is_constructible_string_type_impl : std::false_type {}
type is_constructible_string_type_impl <
BasicJsonType, ConstructibleStringType,
enable_if_t<is_detected_exact<typename BasicJsonType::string_t::value_type,
value_type_t, ConstructibleStringType>::value >> (line 675) | struct is_constructible_string_type_impl <
type is_constructible_string_type (line 686) | struct is_constructible_string_type
type is_compatible_array_type_impl (line 690) | struct is_compatible_array_type_impl : std::false_type {}
type is_compatible_array_type (line 709) | struct is_compatible_array_type
type is_constructible_array_type_impl (line 713) | struct is_constructible_array_type_impl : std::false_type {}
type is_constructible_array_type_impl <
BasicJsonType, ConstructibleArrayType,
enable_if_t<std::is_same<ConstructibleArrayType,
typename BasicJsonType::value_type>::value >> (line 716) | struct is_constructible_array_type_impl <
type is_constructible_array_type_impl <
BasicJsonType, ConstructibleArrayType,
enable_if_t<not std::is_same<ConstructibleArrayType,
typename BasicJsonType::value_type>::value and
is_detected<value_type_t, ConstructibleArrayType>::value and
is_detected<iterator_t, ConstructibleArrayType>::value and
is_complete_type<
detected_t<value_type_t, ConstructibleArrayType>>::value >> (line 723) | struct is_constructible_array_type_impl <
type is_constructible_array_type (line 748) | struct is_constructible_array_type
type is_compatible_integer_type_impl (line 753) | struct is_compatible_integer_type_impl : std::false_type {}
type is_compatible_integer_type_impl <
RealIntegerType, CompatibleNumberIntegerType,
enable_if_t<std::is_integral<RealIntegerType>::value and
std::is_integral<CompatibleNumberIntegerType>::value and
not std::is_same<bool, CompatibleNumberIntegerType>::value >> (line 756) | struct is_compatible_integer_type_impl <
type is_compatible_integer_type (line 774) | struct is_compatible_integer_type
type is_compatible_type_impl (line 779) | struct is_compatible_type_impl: std::false_type {}
type is_compatible_type_impl <
BasicJsonType, CompatibleType,
enable_if_t<is_complete_type<CompatibleType>::value >> (line 782) | struct is_compatible_type_impl <
type is_compatible_type (line 791) | struct is_compatible_type
type position_t (line 813) | struct position_t
class exception (line 869) | class exception : public std::exception
method exception (line 882) | exception(int id_, const char* what_arg) : id(id_), m(what_arg) {}
method name (line 884) | static std::string name(const std::string& ename, int id_)
class parse_error (line 938) | class parse_error : public exception
method parse_error (line 950) | static parse_error create(int id_, const position_t& pos, const st...
method parse_error (line 957) | static parse_error create(int id_, std::size_t byte_, const std::s...
method parse_error (line 977) | parse_error(int id_, std::size_t byte_, const char* what_arg)
method position_string (line 980) | static std::string position_string(const position_t& pos)
class invalid_iterator (line 1024) | class invalid_iterator : public exception
method invalid_iterator (line 1027) | static invalid_iterator create(int id_, const std::string& what_arg)
method invalid_iterator (line 1034) | invalid_iterator(int id_, const char* what_arg)
class type_error (line 1077) | class type_error : public exception
method type_error (line 1080) | static type_error create(int id_, const std::string& what_arg)
method type_error (line 1087) | type_error(int id_, const char* what_arg) : exception(id_, what_ar...
class out_of_range (line 1123) | class out_of_range : public exception
method out_of_range (line 1126) | static out_of_range create(int id_, const std::string& what_arg)
method out_of_range (line 1133) | out_of_range(int id_, const char* what_arg) : exception(id_, what_...
class other_error (line 1160) | class other_error : public exception
method other_error (line 1163) | static other_error create(int id_, const std::string& what_arg)
method other_error (line 1170) | other_error(int id_, const char* what_arg) : exception(id_, what_a...
type value_t (line 1215) | enum class value_t : std::uint8_t
function from_json (line 1285) | void from_json(const BasicJsonType& j, typename std::nullptr_t& n)
function get_arithmetic_value (line 1299) | void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val)
function from_json (line 1325) | void from_json(const BasicJsonType& j, typename BasicJsonType::boole...
function from_json (line 1335) | void from_json(const BasicJsonType& j, typename BasicJsonType::strin...
function from_json (line 1351) | void from_json(const BasicJsonType& j, ConstructibleStringType& s)
function from_json (line 1362) | void from_json(const BasicJsonType& j, typename BasicJsonType::numbe...
function from_json (line 1368) | void from_json(const BasicJsonType& j, typename BasicJsonType::numbe...
function from_json (line 1374) | void from_json(const BasicJsonType& j, typename BasicJsonType::numbe...
function from_json (line 1381) | void from_json(const BasicJsonType& j, EnumType& e)
function from_json (line 1391) | void from_json(const BasicJsonType& j, std::forward_list<T, Allocato...
function from_json (line 1407) | void from_json(const BasicJsonType& j, std::valarray<T>& l)
function from_json_array_impl (line 1418) | void from_json_array_impl(const BasicJsonType& j, typename BasicJson...
function from_json_array_impl (line 1424) | auto from_json_array_impl(const BasicJsonType& j, std::array<T, N>& ...
function from_json_array_impl (line 1435) | auto from_json_array_impl(const BasicJsonType& j, ConstructibleArray...
function from_json_array_impl (line 1454) | void from_json_array_impl(const BasicJsonType& j, ConstructibleArray...
function from_json (line 1477) | auto from_json(const BasicJsonType& j, ConstructibleArrayType& arr)
function from_json (line 1493) | void from_json(const BasicJsonType& j, ConstructibleObjectType& obj)
function from_json (line 1523) | void from_json(const BasicJsonType& j, ArithmeticType& val)
function from_json (line 1554) | void from_json(const BasicJsonType& j, std::pair<A1, A2>& p)
function from_json_tuple_impl (line 1560) | void from_json_tuple_impl(const BasicJsonType& j, Tuple& t, index_se...
function from_json (line 1566) | void from_json(const BasicJsonType& j, std::tuple<Args...>& t)
function from_json (line 1574) | void from_json(const BasicJsonType& j, std::map<Key, Value, Compare,...
function from_json (line 1593) | void from_json(const BasicJsonType& j, std::unordered_map<Key, Value...
type from_json_fn (line 1609) | struct from_json_fn
class iteration_proxy_value (line 1664) | class iteration_proxy_value
method iteration_proxy_value (line 1686) | explicit iteration_proxy_value(IteratorType it) noexcept : anchor(...
method iteration_proxy_value (line 1689) | iteration_proxy_value& operator*()
method iteration_proxy_value (line 1695) | iteration_proxy_value& operator++()
method value (line 1744) | typename IteratorType::reference value() const
class iteration_proxy (line 1751) | class iteration_proxy
method iteration_proxy (line 1759) | explicit iteration_proxy(typename IteratorType::reference cont) no...
method begin (line 1763) | iteration_proxy_value<IteratorType> begin() noexcept
method end (line 1769) | iteration_proxy_value<IteratorType> end() noexcept
function get (line 1778) | auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>...
function get (line 1786) | auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>...
type external_constructor (line 1821) | struct external_constructor
type external_constructor<value_t::boolean> (line 1824) | struct external_constructor<value_t::boolean>
method construct (line 1827) | static void construct(BasicJsonType& j, typename BasicJsonType::bo...
type external_constructor<value_t::string> (line 1836) | struct external_constructor<value_t::string>
method construct (line 1839) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
method construct (line 1847) | static void construct(BasicJsonType& j, typename BasicJsonType::st...
method construct (line 1857) | static void construct(BasicJsonType& j, const CompatibleStringType...
type external_constructor<value_t::number_float> (line 1866) | struct external_constructor<value_t::number_float>
method construct (line 1869) | static void construct(BasicJsonType& j, typename BasicJsonType::nu...
type external_constructor<value_t::number_unsigned> (line 1878) | struct external_constructor<value_t::number_unsigned>
method construct (line 1881) | static void construct(BasicJsonType& j, typename BasicJsonType::nu...
type external_constructor<value_t::number_integer> (line 1890) | struct external_constructor<value_t::number_integer>
method construct (line 1893) | static void construct(BasicJsonType& j, typename BasicJsonType::nu...
type external_constructor<value_t::array> (line 1902) | struct external_constructor<value_t::array>
method construct (line 1905) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
method construct (line 1913) | static void construct(BasicJsonType& j, typename BasicJsonType::ar...
method construct (line 1923) | static void construct(BasicJsonType& j, const CompatibleArrayType&...
method construct (line 1933) | static void construct(BasicJsonType& j, const std::vector<bool>& arr)
method construct (line 1947) | static void construct(BasicJsonType& j, const std::valarray<T>& arr)
type external_constructor<value_t::object> (line 1958) | struct external_constructor<value_t::object>
method construct (line 1961) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
method construct (line 1969) | static void construct(BasicJsonType& j, typename BasicJsonType::ob...
method construct (line 1978) | static void construct(BasicJsonType& j, const CompatibleObjectType...
function to_json (line 1995) | void to_json(BasicJsonType& j, T b) noexcept
function to_json (line 2002) | void to_json(BasicJsonType& j, const CompatibleString& s)
function to_json (line 2008) | void to_json(BasicJsonType& j, typename BasicJsonType::string_t&& s)
function to_json (line 2015) | void to_json(BasicJsonType& j, FloatType val) noexcept
function to_json (line 2022) | void to_json(BasicJsonType& j, CompatibleNumberUnsignedType val) noe...
function to_json (line 2029) | void to_json(BasicJsonType& j, CompatibleNumberIntegerType val) noex...
function to_json (line 2036) | void to_json(BasicJsonType& j, EnumType e) noexcept
function to_json (line 2043) | void to_json(BasicJsonType& j, const std::vector<bool>& e)
function to_json (line 2056) | void to_json(BasicJsonType& j, const CompatibleArrayType& arr)
function to_json (line 2063) | void to_json(BasicJsonType& j, const std::valarray<T>& arr)
function to_json (line 2069) | void to_json(BasicJsonType& j, typename BasicJsonType::array_t&& arr)
function to_json (line 2076) | void to_json(BasicJsonType& j, const CompatibleObjectType& obj)
function to_json (line 2082) | void to_json(BasicJsonType& j, typename BasicJsonType::object_t&& obj)
function to_json (line 2092) | void to_json(BasicJsonType& j, const T(&arr)[N])
function to_json (line 2098) | void to_json(BasicJsonType& j, const std::pair<Args...>& p)
function to_json (line 2106) | void to_json(BasicJsonType& j, const T& b)
function to_json_tuple_impl (line 2112) | void to_json_tuple_impl(BasicJsonType& j, const Tuple& t, index_sequ...
function to_json (line 2118) | void to_json(BasicJsonType& j, const std::tuple<Args...>& t)
type to_json_fn (line 2123) | struct to_json_fn
type input_format_t (line 2164) | enum class input_format_t { json, cbor, msgpack, ubjson, bson }
type input_adapter_protocol (line 2181) | struct input_adapter_protocol
class file_input_adapter (line 2195) | class file_input_adapter : public input_adapter_protocol
method file_input_adapter (line 2198) | explicit file_input_adapter(std::FILE* f) noexcept
method get_character (line 2202) | std::char_traits<char>::int_type get_character() noexcept override
class input_stream_adapter (line 2221) | class input_stream_adapter : public input_adapter_protocol
method input_stream_adapter (line 2231) | explicit input_stream_adapter(std::istream& i)
method input_stream_adapter (line 2236) | input_stream_adapter(const input_stream_adapter&) = delete;
method input_stream_adapter (line 2237) | input_stream_adapter& operator=(input_stream_adapter&) = delete;
method input_stream_adapter (line 2238) | input_stream_adapter(input_stream_adapter&&) = delete;
method input_stream_adapter (line 2239) | input_stream_adapter& operator=(input_stream_adapter&&) = delete;
method get_character (line 2244) | std::char_traits<char>::int_type get_character() override
class input_buffer_adapter (line 2262) | class input_buffer_adapter : public input_adapter_protocol
method input_buffer_adapter (line 2265) | input_buffer_adapter(const char* b, const std::size_t l) noexcept
method input_buffer_adapter (line 2270) | input_buffer_adapter(const input_buffer_adapter&) = delete;
method input_buffer_adapter (line 2271) | input_buffer_adapter& operator=(input_buffer_adapter&) = delete;
method input_buffer_adapter (line 2272) | input_buffer_adapter(input_buffer_adapter&&) = delete;
method input_buffer_adapter (line 2273) | input_buffer_adapter& operator=(input_buffer_adapter&&) = delete;
method get_character (line 2276) | std::char_traits<char>::int_type get_character() noexcept override
type wide_string_input_helper (line 2294) | struct wide_string_input_helper
method fill_buffer (line 2297) | static void fill_buffer(const WideStringType& str, size_t& current...
type wide_string_input_helper<WideStringType, 2> (line 2349) | struct wide_string_input_helper<WideStringType, 2>
method fill_buffer (line 2352) | static void fill_buffer(const WideStringType& str, size_t& current...
class wide_string_input_adapter (line 2410) | class wide_string_input_adapter : public input_adapter_protocol
method wide_string_input_adapter (line 2413) | explicit wide_string_input_adapter(const WideStringType& w) noexcept
method get_character (line 2417) | std::char_traits<char>::int_type get_character() noexcept override
method fill_buffer (line 2436) | void fill_buffer()
class input_adapter (line 2456) | class input_adapter
method input_adapter (line 2460) | input_adapter(std::FILE* file)
method input_adapter (line 2463) | input_adapter(std::istream& i)
method input_adapter (line 2467) | input_adapter(std::istream&& i)
method input_adapter (line 2470) | input_adapter(const std::wstring& ws)
method input_adapter (line 2473) | input_adapter(const std::u16string& ws)
method input_adapter (line 2476) | input_adapter(const std::u32string& ws)
method input_adapter (line 2486) | input_adapter(CharT b, std::size_t l)
method input_adapter (line 2498) | input_adapter(CharT b)
method input_adapter (line 2507) | input_adapter(IteratorType first, IteratorType last)
method input_adapter (line 2542) | input_adapter(T (&array)[N])
method input_adapter (line 2550) | input_adapter(const ContiguousContainer& c)
class lexer (line 2597) | class lexer
type token_type (line 2606) | enum class token_type
method lexer (line 2671) | explicit lexer(detail::input_adapter_t&& adapter)
method lexer (line 2675) | lexer(const lexer&) = delete;
method lexer (line 2676) | lexer(lexer&&) = delete;
method lexer (line 2677) | lexer& operator=(lexer&) = delete;
method lexer (line 2678) | lexer& operator=(lexer&&) = delete;
method get_decimal_point (line 2687) | static char get_decimal_point() noexcept
method get_codepoint (line 2713) | int get_codepoint()
method next_byte_in_range (line 2761) | bool next_byte_in_range(std::initializer_list<int> ranges)
method token_type (line 2798) | token_type scan_string()
method strtof (line 3384) | static void strtof(float& f, const char* str, char** endptr) noexcept
method strtof (line 3389) | static void strtof(double& f, const char* str, char** endptr) noex...
method strtof (line 3394) | static void strtof(long double& f, const char* str, char** endptr)...
method token_type (line 3439) | token_type scan_number() // lgtm [cpp/use-of-goto]
method token_type (line 3773) | token_type scan_literal(const char* literal_text, const std::size_...
method reset (line 3793) | void reset() noexcept
method get (line 3810) | std::char_traits<char>::int_type get()
method unget (line 3847) | void unget()
method add (line 3874) | void add(int c)
method number_integer_t (line 3885) | constexpr number_integer_t get_number_integer() const noexcept
method number_unsigned_t (line 3891) | constexpr number_unsigned_t get_number_unsigned() const noexcept
method number_float_t (line 3897) | constexpr number_float_t get_number_float() const noexcept
method string_t (line 3903) | string_t& get_string()
method position_t (line 3913) | constexpr position_t get_position() const noexcept
method get_token_string (line 3921) | std::string get_token_string() const
method skip_bom (line 3958) | bool skip_bom()
method token_type (line 3972) | token_type scan()
type is_sax (line 4152) | struct is_sax
type is_sax_static_asserts (line 4184) | struct is_sax_static_asserts
class json_sax_dom_parser (line 4382) | class json_sax_dom_parser
method json_sax_dom_parser (line 4395) | explicit json_sax_dom_parser(BasicJsonType& r, const bool allow_ex...
method null (line 4399) | bool null()
method boolean (line 4405) | bool boolean(bool val)
method number_integer (line 4411) | bool number_integer(number_integer_t val)
method number_unsigned (line 4417) | bool number_unsigned(number_unsigned_t val)
method number_float (line 4423) | bool number_float(number_float_t val, const string_t& /*unused*/)
method string (line 4429) | bool string(string_t& val)
method start_object (line 4435) | bool start_object(std::size_t len)
method key (line 4448) | bool key(string_t& val)
method end_object (line 4455) | bool end_object()
method start_array (line 4461) | bool start_array(std::size_t len)
method end_array (line 4474) | bool end_array()
method parse_error (line 4480) | bool parse_error(std::size_t /*unused*/, const std::string& /*unus...
method is_errored (line 4508) | constexpr bool is_errored() const
method BasicJsonType (line 4521) | BasicJsonType* handle_value(Value&& v)
class json_sax_dom_callback_parser (line 4557) | class json_sax_dom_callback_parser
method json_sax_dom_callback_parser (line 4567) | json_sax_dom_callback_parser(BasicJsonType& r,
method null (line 4575) | bool null()
method boolean (line 4581) | bool boolean(bool val)
method number_integer (line 4587) | bool number_integer(number_integer_t val)
method number_unsigned (line 4593) | bool number_unsigned(number_unsigned_t val)
method number_float (line 4599) | bool number_float(number_float_t val, const string_t& /*unused*/)
method string (line 4605) | bool string(string_t& val)
method start_object (line 4611) | bool start_object(std::size_t len)
method key (line 4633) | bool key(string_t& val)
method end_object (line 4650) | bool end_object()
method start_array (line 4685) | bool start_array(std::size_t len)
method end_array (line 4706) | bool end_array()
method parse_error (line 4737) | bool parse_error(std::size_t /*unused*/, const std::string& /*unus...
method is_errored (line 4765) | constexpr bool is_errored() const
method handle_value (line 4787) | std::pair<bool, BasicJsonType*> handle_value(Value&& v, const bool...
class json_sax_acceptor (line 4870) | class json_sax_acceptor
method null (line 4878) | bool null()
method boolean (line 4883) | bool boolean(bool /*unused*/)
method number_integer (line 4888) | bool number_integer(number_integer_t /*unused*/)
method number_unsigned (line 4893) | bool number_unsigned(number_unsigned_t /*unused*/)
method number_float (line 4898) | bool number_float(number_float_t /*unused*/, const string_t& /*unu...
method string (line 4903) | bool string(string_t& /*unused*/)
method start_object (line 4908) | bool start_object(std::size_t /*unused*/ = std::size_t(-1))
method key (line 4913) | bool key(string_t& /*unused*/)
method end_object (line 4918) | bool end_object()
method start_array (line 4923) | bool start_array(std::size_t /*unused*/ = std::size_t(-1))
method end_array (line 4928) | bool end_array()
method parse_error (line 4933) | bool parse_error(std::size_t /*unused*/, const std::string& /*unus...
class parser (line 4961) | class parser
type parse_event_t (line 4971) | enum class parse_event_t : uint8_t
method parser (line 4991) | explicit parser(detail::input_adapter_t&& adapter,
method parse (line 5010) | void parse(const bool strict, BasicJsonType& result)
method accept (line 5071) | bool accept(const bool strict = true)
method sax_parse (line 5078) | bool sax_parse(SAX* sax, const bool strict = true)
method sax_parse_internal (line 5097) | bool sax_parse_internal(SAX* sax)
method token_type (line 5388) | token_type get_token()
method exception_message (line 5393) | std::string exception_message(const token_type expected, const std...
class primitive_iterator_t (line 5454) | class primitive_iterator_t
method difference_type (line 5465) | constexpr difference_type get_value() const noexcept
method set_begin (line 5471) | void set_begin() noexcept
method set_end (line 5477) | void set_end() noexcept
method is_begin (line 5483) | constexpr bool is_begin() const noexcept
method is_end (line 5489) | constexpr bool is_end() const noexcept
method primitive_iterator_t (line 5504) | primitive_iterator_t operator+(difference_type n) noexcept
method difference_type (line 5511) | constexpr difference_type operator-(primitive_iterator_t lhs, prim...
method primitive_iterator_t (line 5516) | primitive_iterator_t& operator++() noexcept
method primitive_iterator_t (line 5522) | primitive_iterator_t const operator++(int) noexcept
method primitive_iterator_t (line 5529) | primitive_iterator_t& operator--() noexcept
method primitive_iterator_t (line 5535) | primitive_iterator_t const operator--(int) noexcept
method primitive_iterator_t (line 5542) | primitive_iterator_t& operator+=(difference_type n) noexcept
method primitive_iterator_t (line 5548) | primitive_iterator_t& operator-=(difference_type n) noexcept
type internal_iterator (line 5573) | struct internal_iterator
class iteration_proxy (line 5610) | class iteration_proxy
method iteration_proxy (line 1759) | explicit iteration_proxy(typename IteratorType::reference cont) no...
method begin (line 1763) | iteration_proxy_value<IteratorType> begin() noexcept
method end (line 1769) | iteration_proxy_value<IteratorType> end() noexcept
class iteration_proxy_value (line 5611) | class iteration_proxy_value
method iteration_proxy_value (line 1686) | explicit iteration_proxy_value(IteratorType it) noexcept : anchor(...
method iteration_proxy_value (line 1689) | iteration_proxy_value& operator*()
method iteration_proxy_value (line 1695) | iteration_proxy_value& operator++()
method value (line 1744) | typename IteratorType::reference value() const
class iter_impl (line 5630) | class iter_impl
method iter_impl (line 5668) | iter_impl() = default;
method iter_impl (line 5676) | explicit iter_impl(pointer object) noexcept : m_object(object)
method iter_impl (line 5716) | iter_impl(const iter_impl<typename std::remove_const<BasicJsonType...
method iter_impl (line 5725) | iter_impl& operator=(const iter_impl<typename std::remove_const<Ba...
method set_begin (line 5737) | void set_begin() noexcept
method set_end (line 5774) | void set_end() noexcept
method reference (line 5805) | reference operator*() const
method pointer (line 5842) | pointer operator->() const
method iter_impl (line 5876) | iter_impl const operator++(int)
method iter_impl (line 5887) | iter_impl& operator++()
method iter_impl (line 5919) | iter_impl const operator--(int)
method iter_impl (line 5930) | iter_impl& operator--()
method iter_impl (line 6052) | iter_impl& operator+=(difference_type i)
method iter_impl (line 6081) | iter_impl& operator-=(difference_type i)
method iter_impl (line 6090) | iter_impl operator+(difference_type i) const
method iter_impl (line 6101) | iter_impl operator+(difference_type i, const iter_impl& it)
method iter_impl (line 6112) | iter_impl operator-(difference_type i) const
method difference_type (line 6123) | difference_type operator-(const iter_impl& other) const
method reference (line 6144) | reference operator[](difference_type n) const
method reference (line 6191) | reference value() const
class json_reverse_iterator (line 6240) | class json_reverse_iterator : public std::reverse_iterator<Base>
method json_reverse_iterator (line 6250) | explicit json_reverse_iterator(const typename base_iterator::itera...
method json_reverse_iterator (line 6254) | explicit json_reverse_iterator(const base_iterator& it) noexcept :...
method json_reverse_iterator (line 6257) | json_reverse_iterator const operator++(int)
method json_reverse_iterator (line 6263) | json_reverse_iterator& operator++()
method json_reverse_iterator (line 6269) | json_reverse_iterator const operator--(int)
method json_reverse_iterator (line 6275) | json_reverse_iterator& operator--()
method json_reverse_iterator (line 6281) | json_reverse_iterator& operator+=(difference_type i)
method json_reverse_iterator (line 6287) | json_reverse_iterator operator+(difference_type i) const
method json_reverse_iterator (line 6293) | json_reverse_iterator operator-(difference_type i) const
method difference_type (line 6299) | difference_type operator-(const json_reverse_iterator& other) const
method reference (line 6305) | reference operator[](difference_type n) const
method key (line 6311) | auto key() const -> decltype(std::declval<Base>().key())
method reference (line 6318) | reference value() const
type output_adapter_protocol (line 6344) | struct output_adapter_protocol
class output_vector_adapter (line 6357) | class output_vector_adapter : public output_adapter_protocol<CharType>
method output_vector_adapter (line 6360) | explicit output_vector_adapter(std::vector<CharType>& vec) noexcept
method write_character (line 6364) | void write_character(CharType c) override
method write_characters (line 6369) | void write_characters(const CharType* s, std::size_t length) override
class output_stream_adapter (line 6380) | class output_stream_adapter : public output_adapter_protocol<CharType>
method output_stream_adapter (line 6383) | explicit output_stream_adapter(std::basic_ostream<CharType>& s) no...
method write_character (line 6387) | void write_character(CharType c) override
method write_characters (line 6392) | void write_characters(const CharType* s, std::size_t length) override
class output_string_adapter (line 6403) | class output_string_adapter : public output_adapter_protocol<CharType>
method output_string_adapter (line 6406) | explicit output_string_adapter(StringType& s) noexcept
method write_character (line 6410) | void write_character(CharType c) override
method write_characters (line 6415) | void write_characters(const CharType* s, std::size_t length) override
class output_adapter (line 6425) | class output_adapter
method output_adapter (line 6428) | output_adapter(std::vector<CharType>& vec)
method output_adapter (line 6431) | output_adapter(std::basic_ostream<CharType>& s)
method output_adapter (line 6434) | output_adapter(StringType& s)
class binary_reader (line 6489) | class binary_reader
method binary_reader (line 6503) | explicit binary_reader(input_adapter_t adapter) : ia(std::move(ada...
method sax_parse (line 6516) | bool sax_parse(const input_format_t format,
method little_endianess (line 6576) | static constexpr bool little_endianess(int num = 1) noexcept
method parse_bson_internal (line 6590) | bool parse_bson_internal()
method get_bson_cstr (line 6615) | bool get_bson_cstr(string_t& result)
method get_bson_string (line 6647) | bool get_bson_string(const NumberType len, string_t& result)
method parse_bson_element_internal (line 6668) | bool parse_bson_element_internal(const int element_type,
method parse_bson_element_list (line 6739) | bool parse_bson_element_list(const bool is_array)
method parse_bson_array (line 6779) | bool parse_bson_array()
method parse_cbor_internal (line 6808) | bool parse_cbor_internal(const bool get_char = true)
method get_cbor_string (line 7150) | bool get_cbor_string(string_t& result)
method get_cbor_array (line 7239) | bool get_cbor_array(const std::size_t len)
method get_cbor_object (line 7275) | bool get_cbor_object(const std::size_t len)
method parse_msgpack_internal (line 7327) | bool parse_msgpack_internal()
method get_msgpack_string (line 7696) | bool get_msgpack_string(string_t& result)
method get_msgpack_array (line 7772) | bool get_msgpack_array(const std::size_t len)
method get_msgpack_object (line 7794) | bool get_msgpack_object(const std::size_t len)
method parse_ubjson_internal (line 7831) | bool parse_ubjson_internal(const bool get_char = true)
method get_ubjson_string (line 7850) | bool get_ubjson_string(string_t& result, const bool get_char = true)
method get_ubjson_size_value (line 7904) | bool get_ubjson_size_value(std::size_t& result)
method get_ubjson_size_type (line 7981) | bool get_ubjson_size_type(std::pair<std::size_t, int>& result)
method get_ubjson_value (line 8020) | bool get_ubjson_value(const int prefix)
method get_ubjson_array (line 8116) | bool get_ubjson_array()
method get_ubjson_object (line 8178) | bool get_ubjson_object()
method get (line 8263) | int get()
method get_ignore_noop (line 8272) | int get_ignore_noop()
method get_number (line 8297) | bool get_number(const input_format_t format, NumberType& result)
method get_string (line 8340) | bool get_string(const input_format_t format,
method unexpect_eof (line 8362) | bool unexpect_eof(const input_format_t format, const char* context...
method get_token_string (line 8375) | std::string get_token_string() const
method exception_message (line 8388) | std::string exception_message(const input_format_t format,
class binary_writer (line 8466) | class binary_writer
method binary_writer (line 8476) | explicit binary_writer(output_adapter_t<CharType> adapter) : oa(ad...
method write_bson (line 8485) | void write_bson(const BasicJsonType& j)
method write_cbor (line 8505) | void write_cbor(const BasicJsonType& j)
method write_msgpack (line 8749) | void write_msgpack(const BasicJsonType& j)
method write_ubjson (line 8991) | void write_ubjson(const BasicJsonType& j, const bool use_count,
method calc_bson_entry_header_size (line 9155) | static std::size_t calc_bson_entry_header_size(const string_t& name)
method write_bson_entry_header (line 9170) | void write_bson_entry_header(const string_t& name,
method write_bson_boolean (line 9182) | void write_bson_boolean(const string_t& name,
method write_bson_double (line 9192) | void write_bson_double(const string_t& name,
method calc_bson_string_size (line 9202) | static std::size_t calc_bson_string_size(const string_t& value)
method write_bson_string (line 9210) | void write_bson_string(const string_t& name,
method write_bson_null (line 9224) | void write_bson_null(const string_t& name)
method calc_bson_integer_size (line 9232) | static std::size_t calc_bson_integer_size(const std::int64_t value)
method write_bson_integer (line 9247) | void write_bson_integer(const string_t& name,
method calc_bson_unsigned_size (line 9265) | static constexpr std::size_t calc_bson_unsigned_size(const std::ui...
method write_bson_unsigned (line 9275) | void write_bson_unsigned(const string_t& name,
method write_bson_object_entry (line 9297) | void write_bson_object_entry(const string_t& name,
method calc_bson_array_size (line 9307) | static std::size_t calc_bson_array_size(const typename BasicJsonTy...
method write_bson_array (line 9323) | void write_bson_array(const string_t& name,
method calc_bson_element_size (line 9343) | static std::size_t calc_bson_element_size(const string_t& name,
method write_bson_element (line 9388) | void write_bson_element(const string_t& name,
method calc_bson_object_size (line 9431) | static std::size_t calc_bson_object_size(const typename BasicJsonT...
method write_bson_object (line 9446) | void write_bson_object(const typename BasicJsonType::object_t& value)
method CharType (line 9462) | static constexpr CharType get_cbor_float_prefix(float /*unused*/)
method CharType (line 9467) | static constexpr CharType get_cbor_float_prefix(double /*unused*/)
method CharType (line 9476) | static constexpr CharType get_msgpack_float_prefix(float /*unused*/)
method CharType (line 9481) | static constexpr CharType get_msgpack_float_prefix(double /*unused*/)
method write_number_with_ubjson_prefix (line 9493) | void write_number_with_ubjson_prefix(const NumberType n,
method write_number_with_ubjson_prefix (line 9506) | void write_number_with_ubjson_prefix(const NumberType n,
method write_number_with_ubjson_prefix (line 9559) | void write_number_with_ubjson_prefix(const NumberType n,
method CharType (line 9619) | CharType ubjson_prefix(const BasicJsonType& j) const noexcept
method CharType (line 9690) | static constexpr CharType get_ubjson_float_prefix(float /*unused*/)
method CharType (line 9695) | static constexpr CharType get_ubjson_float_prefix(double /*unused*/)
method write_number (line 9716) | void write_number(const NumberType n)
method CharType (line 9739) | static constexpr CharType to_char_type(std::uint8_t x) noexcept
method CharType (line 9746) | static CharType to_char_type(std::uint8_t x) noexcept
method CharType (line 9757) | static constexpr CharType to_char_type(std::uint8_t x) noexcept
method CharType (line 9768) | static constexpr CharType to_char_type(InputCharType x) noexcept
type dtoa_impl (line 9834) | namespace dtoa_impl
function Target (line 9838) | Target reinterpret_bits(const Source source)
type diyfp (line 9847) | struct diyfp // f * 2^e
method diyfp (line 9854) | constexpr diyfp(uint64_t f_, int e_) noexcept : f(f_), e(e_) {}
method diyfp (line 9860) | static diyfp sub(const diyfp& x, const diyfp& y) noexcept
method diyfp (line 9872) | static diyfp mul(const diyfp& x, const diyfp& y) noexcept
method diyfp (line 9937) | static diyfp normalize(diyfp x) noexcept
method diyfp (line 9954) | static diyfp normalize_to(const diyfp& x, const int target_expon...
type boundaries (line 9965) | struct boundaries
function boundaries (line 9979) | boundaries compute_boundaries(FloatType value)
type cached_power (line 10104) | struct cached_power // c = f * 2^e ~= 10^k
function cached_power (line 10118) | inline cached_power get_cached_power_for_binary_exponent(int e)
function find_largest_pow10 (line 10282) | inline int find_largest_pow10(const uint32_t n, uint32_t& pow10)
function grisu2_round (line 10338) | inline void grisu2_round(char* buf, int len, uint64_t dist, uint64...
function grisu2_digit_gen (line 10379) | inline void grisu2_digit_gen(char* buffer, int& length, int& decim...
function grisu2 (line 10619) | inline void grisu2(char* buf, int& len, int& decimal_exponent,
function grisu2 (line 10678) | void grisu2(char* buf, int& len, int& decimal_exponent, FloatType ...
type error_handler_t (line 10917) | enum class error_handler_t
class serializer (line 10925) | class serializer
method serializer (line 10940) | serializer(output_adapter_t<char> s, const char ichar,
method serializer (line 10952) | serializer(const serializer&) = delete;
method serializer (line 10953) | serializer& operator=(const serializer&) = delete;
method serializer (line 10954) | serializer(serializer&&) = delete;
method serializer (line 10955) | serializer& operator=(serializer&&) = delete;
method dump (line 10975) | void dump(const BasicJsonType& val, const bool pretty_print,
method dump_escaped (line 11182) | void dump_escaped(const string_t& s, const bool ensure_ascii)
method dump_integer (line 11427) | void dump_integer(NumberType x)
method dump_float (line 11468) | void dump_float(number_float_t x)
method dump_float (line 11489) | void dump_float(number_float_t x, std::true_type /*is_ieee_single_...
method dump_float (line 11497) | void dump_float(number_float_t x, std::false_type /*is_ieee_single...
method decode (line 11567) | static uint8_t decode(uint8_t& state, uint32_t& codep, const uint8...
class json_ref (line 11641) | class json_ref
method json_ref (line 11646) | json_ref(value_type&& value)
method json_ref (line 11650) | json_ref(const value_type& value)
method json_ref (line 11654) | json_ref(std::initializer_list<json_ref> init)
method json_ref (line 11661) | json_ref(Args && ... args)
method json_ref (line 11666) | json_ref(json_ref&&) = default;
method json_ref (line 11667) | json_ref(const json_ref&) = delete;
method json_ref (line 11668) | json_ref& operator=(const json_ref&) = delete;
method json_ref (line 11669) | json_ref& operator=(json_ref&&) = delete;
method value_type (line 11672) | value_type moved_or_copied() const
method value_type (line 11681) | value_type const& operator*() const
method value_type (line 11686) | value_type const* operator->() const
type detail (line 338) | namespace detail
type index_sequence (line 274) | struct index_sequence
method size (line 278) | static constexpr std::size_t size() noexcept
type merge_and_renumber (line 285) | struct merge_and_renumber
type make_index_sequence (line 292) | struct make_index_sequence
type make_index_sequence<0> (line 296) | struct make_index_sequence<0> : index_sequence<> {}
type make_index_sequence<1> (line 297) | struct make_index_sequence<1> : index_sequence<0> {}
type priority_tag (line 303) | struct priority_tag : priority_tag < N - 1 > {}
type priority_tag<0> (line 304) | struct priority_tag<0> {}
type static_const (line 308) | struct static_const
type make_void (line 340) | struct make_void
type iterator_types (line 356) | struct iterator_types {}
type iterator_types <
It,
void_t<typename It::difference_type, typename It::value_type, typename It::pointer,
typename It::reference, typename It::iterator_category >> (line 359) | struct iterator_types <
type iterator_traits (line 374) | struct iterator_traits
type iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >> (line 379) | struct iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >>
type iterator_traits<T*, enable_if_t<std::is_object<T>::value>> (line 385) | struct iterator_traits<T*, enable_if_t<std::is_object<T>::value>>
type nonesuch (line 411) | struct nonesuch
method nonesuch (line 413) | nonesuch() = delete;
method nonesuch (line 415) | nonesuch(nonesuch const&) = delete;
type detector (line 423) | struct detector
type is_basic_json (line 485) | struct is_basic_json : std::false_type {}
type has_from_json (line 529) | struct has_from_json : std::false_type {}
type has_from_json<BasicJsonType, T,
enable_if_t<not is_basic_json<T>::value>> (line 532) | struct has_from_json<BasicJsonType, T,
type has_non_default_from_json (line 545) | struct has_non_default_from_json : std::false_type {}
type has_non_default_from_json<BasicJsonType, T, enable_if_t<not is_basic_json<T>::value>> (line 548) | struct has_non_default_from_json<BasicJsonType, T, enable_if_t<not i...
type has_to_json (line 560) | struct has_to_json : std::false_type {}
type has_to_json<BasicJsonType, T, enable_if_t<not is_basic_json<T>::value>> (line 563) | struct has_to_json<BasicJsonType, T, enable_if_t<not is_basic_json<T...
type is_iterator_traits (line 578) | struct is_iterator_traits : std::false_type {}
type is_iterator_traits<iterator_traits<T>> (line 581) | struct is_iterator_traits<iterator_traits<T>>
type is_complete_type (line 598) | struct is_complete_type : std::false_type {}
type is_complete_type<T, decltype(void(sizeof(T)))> (line 601) | struct is_complete_type<T, decltype(void(sizeof(T)))> : std::true_ty...
type is_compatible_object_type_impl (line 605) | struct is_compatible_object_type_impl : std::false_type {}
type is_compatible_object_type_impl <
BasicJsonType, CompatibleObjectType,
enable_if_t<is_detected<mapped_type_t, CompatibleObjectType>::value and
is_detected<key_type_t, CompatibleObjectType>::value >> (line 608) | struct is_compatible_object_type_impl <
type is_compatible_object_type (line 625) | struct is_compatible_object_type
type is_constructible_object_type_impl (line 630) | struct is_constructible_object_type_impl : std::false_type {}
type is_constructible_object_type_impl <
BasicJsonType, ConstructibleObjectType,
enable_if_t<is_detected<mapped_type_t, ConstructibleObjectType>::value and
is_detected<key_type_t, ConstructibleObjectType>::value >> (line 633) | struct is_constructible_object_type_impl <
type is_constructible_object_type (line 648) | struct is_constructible_object_type
type is_compatible_string_type_impl (line 654) | struct is_compatible_string_type_impl : std::false_type {}
type is_compatible_string_type_impl <
BasicJsonType, CompatibleStringType,
enable_if_t<is_detected_exact<typename BasicJsonType::string_t::value_type,
value_type_t, CompatibleStringType>::value >> (line 657) | struct is_compatible_string_type_impl <
type is_compatible_string_type (line 667) | struct is_compatible_string_type
type is_constructible_string_type_impl (line 672) | struct is_constructible_string_type_impl : std::false_type {}
type is_constructible_string_type_impl <
BasicJsonType, ConstructibleStringType,
enable_if_t<is_detected_exact<typename BasicJsonType::string_t::value_type,
value_type_t, ConstructibleStringType>::value >> (line 675) | struct is_constructible_string_type_impl <
type is_constructible_string_type (line 686) | struct is_constructible_string_type
type is_compatible_array_type_impl (line 690) | struct is_compatible_array_type_impl : std::false_type {}
type is_compatible_array_type (line 709) | struct is_compatible_array_type
type is_constructible_array_type_impl (line 713) | struct is_constructible_array_type_impl : std::false_type {}
type is_constructible_array_type_impl <
BasicJsonType, ConstructibleArrayType,
enable_if_t<std::is_same<ConstructibleArrayType,
typename BasicJsonType::value_type>::value >> (line 716) | struct is_constructible_array_type_impl <
type is_constructible_array_type_impl <
BasicJsonType, ConstructibleArrayType,
enable_if_t<not std::is_same<ConstructibleArrayType,
typename BasicJsonType::value_type>::value and
is_detected<value_type_t, ConstructibleArrayType>::value and
is_detected<iterator_t, ConstructibleArrayType>::value and
is_complete_type<
detected_t<value_type_t, ConstructibleArrayType>>::value >> (line 723) | struct is_constructible_array_type_impl <
type is_constructible_array_type (line 748) | struct is_constructible_array_type
type is_compatible_integer_type_impl (line 753) | struct is_compatible_integer_type_impl : std::false_type {}
type is_compatible_integer_type_impl <
RealIntegerType, CompatibleNumberIntegerType,
enable_if_t<std::is_integral<RealIntegerType>::value and
std::is_integral<CompatibleNumberIntegerType>::value and
not std::is_same<bool, CompatibleNumberIntegerType>::value >> (line 756) | struct is_compatible_integer_type_impl <
type is_compatible_integer_type (line 774) | struct is_compatible_integer_type
type is_compatible_type_impl (line 779) | struct is_compatible_type_impl: std::false_type {}
type is_compatible_type_impl <
BasicJsonType, CompatibleType,
enable_if_t<is_complete_type<CompatibleType>::value >> (line 782) | struct is_compatible_type_impl <
type is_compatible_type (line 791) | struct is_compatible_type
type position_t (line 813) | struct position_t
class exception (line 869) | class exception : public std::exception
method exception (line 882) | exception(int id_, const char* what_arg) : id(id_), m(what_arg) {}
method name (line 884) | static std::string name(const std::string& ename, int id_)
class parse_error (line 938) | class parse_error : public exception
method parse_error (line 950) | static parse_error create(int id_, const position_t& pos, const st...
method parse_error (line 957) | static parse_error create(int id_, std::size_t byte_, const std::s...
method parse_error (line 977) | parse_error(int id_, std::size_t byte_, const char* what_arg)
method position_string (line 980) | static std::string position_string(const position_t& pos)
class invalid_iterator (line 1024) | class invalid_iterator : public exception
method invalid_iterator (line 1027) | static invalid_iterator create(int id_, const std::string& what_arg)
method invalid_iterator (line 1034) | invalid_iterator(int id_, const char* what_arg)
class type_error (line 1077) | class type_error : public exception
method type_error (line 1080) | static type_error create(int id_, const std::string& what_arg)
method type_error (line 1087) | type_error(int id_, const char* what_arg) : exception(id_, what_ar...
class out_of_range (line 1123) | class out_of_range : public exception
method out_of_range (line 1126) | static out_of_range create(int id_, const std::string& what_arg)
method out_of_range (line 1133) | out_of_range(int id_, const char* what_arg) : exception(id_, what_...
class other_error (line 1160) | class other_error : public exception
method other_error (line 1163) | static other_error create(int id_, const std::string& what_arg)
method other_error (line 1170) | other_error(int id_, const char* what_arg) : exception(id_, what_a...
type value_t (line 1215) | enum class value_t : std::uint8_t
function from_json (line 1285) | void from_json(const BasicJsonType& j, typename std::nullptr_t& n)
function get_arithmetic_value (line 1299) | void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val)
function from_json (line 1325) | void from_json(const BasicJsonType& j, typename BasicJsonType::boole...
function from_json (line 1335) | void from_json(const BasicJsonType& j, typename BasicJsonType::strin...
function from_json (line 1351) | void from_json(const BasicJsonType& j, ConstructibleStringType& s)
function from_json (line 1362) | void from_json(const BasicJsonType& j, typename BasicJsonType::numbe...
function from_json (line 1368) | void from_json(const BasicJsonType& j, typename BasicJsonType::numbe...
function from_json (line 1374) | void from_json(const BasicJsonType& j, typename BasicJsonType::numbe...
function from_json (line 1381) | void from_json(const BasicJsonType& j, EnumType& e)
function from_json (line 1391) | void from_json(const BasicJsonType& j, std::forward_list<T, Allocato...
function from_json (line 1407) | void from_json(const BasicJsonType& j, std::valarray<T>& l)
function from_json_array_impl (line 1418) | void from_json_array_impl(const BasicJsonType& j, typename BasicJson...
function from_json_array_impl (line 1424) | auto from_json_array_impl(const BasicJsonType& j, std::array<T, N>& ...
function from_json_array_impl (line 1435) | auto from_json_array_impl(const BasicJsonType& j, ConstructibleArray...
function from_json_array_impl (line 1454) | void from_json_array_impl(const BasicJsonType& j, ConstructibleArray...
function from_json (line 1477) | auto from_json(const BasicJsonType& j, ConstructibleArrayType& arr)
function from_json (line 1493) | void from_json(const BasicJsonType& j, ConstructibleObjectType& obj)
function from_json (line 1523) | void from_json(const BasicJsonType& j, ArithmeticType& val)
function from_json (line 1554) | void from_json(const BasicJsonType& j, std::pair<A1, A2>& p)
function from_json_tuple_impl (line 1560) | void from_json_tuple_impl(const BasicJsonType& j, Tuple& t, index_se...
function from_json (line 1566) | void from_json(const BasicJsonType& j, std::tuple<Args...>& t)
function from_json (line 1574) | void from_json(const BasicJsonType& j, std::map<Key, Value, Compare,...
function from_json (line 1593) | void from_json(const BasicJsonType& j, std::unordered_map<Key, Value...
type from_json_fn (line 1609) | struct from_json_fn
class iteration_proxy_value (line 1664) | class iteration_proxy_value
method iteration_proxy_value (line 1686) | explicit iteration_proxy_value(IteratorType it) noexcept : anchor(...
method iteration_proxy_value (line 1689) | iteration_proxy_value& operator*()
method iteration_proxy_value (line 1695) | iteration_proxy_value& operator++()
method value (line 1744) | typename IteratorType::reference value() const
class iteration_proxy (line 1751) | class iteration_proxy
method iteration_proxy (line 1759) | explicit iteration_proxy(typename IteratorType::reference cont) no...
method begin (line 1763) | iteration_proxy_value<IteratorType> begin() noexcept
method end (line 1769) | iteration_proxy_value<IteratorType> end() noexcept
function get (line 1778) | auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>...
function get (line 1786) | auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>...
type external_constructor (line 1821) | struct external_constructor
type external_constructor<value_t::boolean> (line 1824) | struct external_constructor<value_t::boolean>
method construct (line 1827) | static void construct(BasicJsonType& j, typename BasicJsonType::bo...
type external_constructor<value_t::string> (line 1836) | struct external_constructor<value_t::string>
method construct (line 1839) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
method construct (line 1847) | static void construct(BasicJsonType& j, typename BasicJsonType::st...
method construct (line 1857) | static void construct(BasicJsonType& j, const CompatibleStringType...
type external_constructor<value_t::number_float> (line 1866) | struct external_constructor<value_t::number_float>
method construct (line 1869) | static void construct(BasicJsonType& j, typename BasicJsonType::nu...
type external_constructor<value_t::number_unsigned> (line 1878) | struct external_constructor<value_t::number_unsigned>
method construct (line 1881) | static void construct(BasicJsonType& j, typename BasicJsonType::nu...
type external_constructor<value_t::number_integer> (line 1890) | struct external_constructor<value_t::number_integer>
method construct (line 1893) | static void construct(BasicJsonType& j, typename BasicJsonType::nu...
type external_constructor<value_t::array> (line 1902) | struct external_constructor<value_t::array>
method construct (line 1905) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
method construct (line 1913) | static void construct(BasicJsonType& j, typename BasicJsonType::ar...
method construct (line 1923) | static void construct(BasicJsonType& j, const CompatibleArrayType&...
method construct (line 1933) | static void construct(BasicJsonType& j, const std::vector<bool>& arr)
method construct (line 1947) | static void construct(BasicJsonType& j, const std::valarray<T>& arr)
type external_constructor<value_t::object> (line 1958) | struct external_constructor<value_t::object>
method construct (line 1961) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
method construct (line 1969) | static void construct(BasicJsonType& j, typename BasicJsonType::ob...
method construct (line 1978) | static void construct(BasicJsonType& j, const CompatibleObjectType...
function to_json (line 1995) | void to_json(BasicJsonType& j, T b) noexcept
function to_json (line 2002) | void to_json(BasicJsonType& j, const CompatibleString& s)
function to_json (line 2008) | void to_json(BasicJsonType& j, typename BasicJsonType::string_t&& s)
function to_json (line 2015) | void to_json(BasicJsonType& j, FloatType val) noexcept
function to_json (line 2022) | void to_json(BasicJsonType& j, CompatibleNumberUnsignedType val) noe...
function to_json (line 2029) | void to_json(BasicJsonType& j, CompatibleNumberIntegerType val) noex...
function to_json (line 2036) | void to_json(BasicJsonType& j, EnumType e) noexcept
function to_json (line 2043) | void to_json(BasicJsonType& j, const std::vector<bool>& e)
function to_json (line 2056) | void to_json(BasicJsonType& j, const CompatibleArrayType& arr)
function to_json (line 2063) | void to_json(BasicJsonType& j, const std::valarray<T>& arr)
function to_json (line 2069) | void to_json(BasicJsonType& j, typename BasicJsonType::array_t&& arr)
function to_json (line 2076) | void to_json(BasicJsonType& j, const CompatibleObjectType& obj)
function to_json (line 2082) | void to_json(BasicJsonType& j, typename BasicJsonType::object_t&& obj)
function to_json (line 2092) | void to_json(BasicJsonType& j, const T(&arr)[N])
function to_json (line 2098) | void to_json(BasicJsonType& j, const std::pair<Args...>& p)
function to_json (line 2106) | void to_json(BasicJsonType& j, const T& b)
function to_json_tuple_impl (line 2112) | void to_json_tuple_impl(BasicJsonType& j, const Tuple& t, index_sequ...
function to_json (line 2118) | void to_json(BasicJsonType& j, const std::tuple<Args...>& t)
type to_json_fn (line 2123) | struct to_json_fn
type input_format_t (line 2164) | enum class input_format_t { json, cbor, msgpack, ubjson, bson }
type input_adapter_protocol (line 2181) | struct input_adapter_protocol
class file_input_adapter (line 2195) | class file_input_adapter : public input_adapter_protocol
method file_input_adapter (line 2198) | explicit file_input_adapter(std::FILE* f) noexcept
method get_character (line 2202) | std::char_traits<char>::int_type get_character() noexcept override
class input_stream_adapter (line 2221) | class input_stream_adapter : public input_adapter_protocol
method input_stream_adapter (line 2231) | explicit input_stream_adapter(std::istream& i)
method input_stream_adapter (line 2236) | input_stream_adapter(const input_stream_adapter&) = delete;
method input_stream_adapter (line 2237) | input_stream_adapter& operator=(input_stream_adapter&) = delete;
method input_stream_adapter (line 2238) | input_stream_adapter(input_stream_adapter&&) = delete;
method input_stream_adapter (line 2239) | input_stream_adapter& operator=(input_stream_adapter&&) = delete;
method get_character (line 2244) | std::char_traits<char>::int_type get_character() override
class input_buffer_adapter (line 2262) | class input_buffer_adapter : public input_adapter_protocol
method input_buffer_adapter (line 2265) | input_buffer_adapter(const char* b, const std::size_t l) noexcept
method input_buffer_adapter (line 2270) | input_buffer_adapter(const input_buffer_adapter&) = delete;
method input_buffer_adapter (line 2271) | input_buffer_adapter& operator=(input_buffer_adapter&) = delete;
method input_buffer_adapter (line 2272) | input_buffer_adapter(input_buffer_adapter&&) = delete;
method input_buffer_adapter (line 2273) | input_buffer_adapter& operator=(input_buffer_adapter&&) = delete;
method get_character (line 2276) | std::char_traits<char>::int_type get_character() noexcept override
type wide_string_input_helper (line 2294) | struct wide_string_input_helper
method fill_buffer (line 2297) | static void fill_buffer(const WideStringType& str, size_t& current...
type wide_string_input_helper<WideStringType, 2> (line 2349) | struct wide_string_input_helper<WideStringType, 2>
method fill_buffer (line 2352) | static void fill_buffer(const WideStringType& str, size_t& current...
class wide_string_input_adapter (line 2410) | class wide_string_input_adapter : public input_adapter_protocol
method wide_string_input_adapter (line 2413) | explicit wide_string_input_adapter(const WideStringType& w) noexcept
method get_character (line 2417) | std::char_traits<char>::int_type get_character() noexcept override
method fill_buffer (line 2436) | void fill_buffer()
class input_adapter (line 2456) | class input_adapter
method input_adapter (line 2460) | input_adapter(std::FILE* file)
method input_adapter (line 2463) | input_adapter(std::istream& i)
method input_adapter (line 2467) | input_adapter(std::istream&& i)
method input_adapter (line 2470) | input_adapter(const std::wstring& ws)
method input_adapter (line 2473) | input_adapter(const std::u16string& ws)
method input_adapter (line 2476) | input_adapter(const std::u32string& ws)
method input_adapter (line 2486) | input_adapter(CharT b, std::size_t l)
method input_adapter (line 2498) | input_adapter(CharT b)
method input_adapter (line 2507) | input_adapter(IteratorType first, IteratorType last)
method input_adapter (line 2542) | input_adapter(T (&array)[N])
method input_adapter (line 2550) | input_adapter(const ContiguousContainer& c)
class lexer (line 2597) | class lexer
type token_type (line 2606) | enum class token_type
method lexer (line 2671) | explicit lexer(detail::input_adapter_t&& adapter)
method lexer (line 2675) | lexer(const lexer&) = delete;
method lexer (line 2676) | lexer(lexer&&) = delete;
method lexer (line 2677) | lexer& operator=(lexer&) = delete;
method lexer (line 2678) | lexer& operator=(lexer&&) = delete;
method get_decimal_point (line 2687) | static char get_decimal_point() noexcept
method get_codepoint (line 2713) | int get_codepoint()
method next_byte_in_range (line 2761) | bool next_byte_in_range(std::initializer_list<int> ranges)
method token_type (line 2798) | token_type scan_string()
method strtof (line 3384) | static void strtof(float& f, const char* str, char** endptr) noexcept
method strtof (line 3389) | static void strtof(double& f, const char* str, char** endptr) noex...
method strtof (line 3394) | static void strtof(long double& f, const char* str, char** endptr)...
method token_type (line 3439) | token_type scan_number() // lgtm [cpp/use-of-goto]
method token_type (line 3773) | token_type scan_literal(const char* literal_text, const std::size_...
method reset (line 3793) | void reset() noexcept
method get (line 3810) | std::char_traits<char>::int_type get()
method unget (line 3847) | void unget()
method add (line 3874) | void add(int c)
method number_integer_t (line 3885) | constexpr number_integer_t get_number_integer() const noexcept
method number_unsigned_t (line 3891) | constexpr number_unsigned_t get_number_unsigned() const noexcept
method number_float_t (line 3897) | constexpr number_float_t get_number_float() const noexcept
method string_t (line 3903) | string_t& get_string()
method position_t (line 3913) | constexpr position_t get_position() const noexcept
method get_token_string (line 3921) | std::string get_token_string() const
method skip_bom (line 3958) | bool skip_bom()
method token_type (line 3972) | token_type scan()
type is_sax (line 4152) | struct is_sax
type is_sax_static_asserts (line 4184) | struct is_sax_static_asserts
class json_sax_dom_parser (line 4382) | class json_sax_dom_parser
method json_sax_dom_parser (line 4395) | explicit json_sax_dom_parser(BasicJsonType& r, const bool allow_ex...
method null (line 4399) | bool null()
method boolean (line 4405) | bool boolean(bool val)
method number_integer (line 4411) | bool number_integer(number_integer_t val)
method number_unsigned (line 4417) | bool number_unsigned(number_unsigned_t val)
method number_float (line 4423) | bool number_float(number_float_t val, const string_t& /*unused*/)
method string (line 4429) | bool string(string_t& val)
method start_object (line 4435) | bool start_object(std::size_t len)
method key (line 4448) | bool key(string_t& val)
method end_object (line 4455) | bool end_object()
method start_array (line 4461) | bool start_array(std::size_t len)
method end_array (line 4474) | bool end_array()
method parse_error (line 4480) | bool parse_error(std::size_t /*unused*/, const std::string& /*unus...
method is_errored (line 4508) | constexpr bool is_errored() const
method BasicJsonType (line 4521) | BasicJsonType* handle_value(Value&& v)
class json_sax_dom_callback_parser (line 4557) | class json_sax_dom_callback_parser
method json_sax_dom_callback_parser (line 4567) | json_sax_dom_callback_parser(BasicJsonType& r,
method null (line 4575) | bool null()
method boolean (line 4581) | bool boolean(bool val)
method number_integer (line 4587) | bool number_integer(number_integer_t val)
method number_unsigned (line 4593) | bool number_unsigned(number_unsigned_t val)
method number_float (line 4599) | bool number_float(number_float_t val, const string_t& /*unused*/)
method string (line 4605) | bool string(string_t& val)
method start_object (line 4611) | bool start_object(std::size_t len)
method key (line 4633) | bool key(string_t& val)
method end_object (line 4650) | bool end_object()
method start_array (line 4685) | bool start_array(std::size_t len)
method end_array (line 4706) | bool end_array()
method parse_error (line 4737) | bool parse_error(std::size_t /*unused*/, const std::string& /*unus...
method is_errored (line 4765) | constexpr bool is_errored() const
method handle_value (line 4787) | std::pair<bool, BasicJsonType*> handle_value(Value&& v, const bool...
class json_sax_acceptor (line 4870) | class json_sax_acceptor
method null (line 4878) | bool null()
method boolean (line 4883) | bool boolean(bool /*unused*/)
method number_integer (line 4888) | bool number_integer(number_integer_t /*unused*/)
method number_unsigned (line 4893) | bool number_unsigned(number_unsigned_t /*unused*/)
method number_float (line 4898) | bool number_float(number_float_t /*unused*/, const string_t& /*unu...
method string (line 4903) | bool string(string_t& /*unused*/)
method start_object (line 4908) | bool start_object(std::size_t /*unused*/ = std::size_t(-1))
method key (line 4913) | bool key(string_t& /*unused*/)
method end_object (line 4918) | bool end_object()
method start_array (line 4923) | bool start_array(std::size_t /*unused*/ = std::size_t(-1))
method end_array (line 4928) | bool end_array()
method parse_error (line 4933) | bool parse_error(std::size_t /*unused*/, const std::string& /*unus...
class parser (line 4961) | class parser
type parse_event_t (line 4971) | enum class parse_event_t : uint8_t
method parser (line 4991) | explicit parser(detail::input_adapter_t&& adapter,
method parse (line 5010) | void parse(const bool strict, BasicJsonType& result)
method accept (line 5071) | bool accept(const bool strict = true)
method sax_parse (line 5078) | bool sax_parse(SAX* sax, const bool strict = true)
method sax_parse_internal (line 5097) | bool sax_parse_internal(SAX* sax)
method token_type (line 5388) | token_type get_token()
method exception_message (line 5393) | std::string exception_message(const token_type expected, const std...
class primitive_iterator_t (line 5454) | class primitive_iterator_t
method difference_type (line 5465) | constexpr difference_type get_value() const noexcept
method set_begin (line 5471) | void set_begin() noexcept
method set_end (line 5477) | void set_end() noexcept
method is_begin (line 5483) | constexpr bool is_begin() const noexcept
method is_end (line 5489) | constexpr bool is_end() const noexcept
method primitive_iterator_t (line 5504) | primitive_iterator_t operator+(difference_type n) noexcept
method difference_type (line 5511) | constexpr difference_type operator-(primitive_iterator_t lhs, prim...
method primitive_iterator_t (line 5516) | primitive_iterator_t& operator++() noexcept
method primitive_iterator_t (line 5522) | primitive_iterator_t const operator++(int) noexcept
method primitive_iterator_t (line 5529) | primitive_iterator_t& operator--() noexcept
method primitive_iterator_t (line 5535) | primitive_iterator_t const operator--(int) noexcept
method primitive_iterator_t (line 5542) | primitive_iterator_t& operator+=(difference_type n) noexcept
method primitive_iterator_t (line 5548) | primitive_iterator_t& operator-=(difference_type n) noexcept
type internal_iterator (line 5573) | struct internal_iterator
class iteration_proxy (line 5610) | class iteration_proxy
method iteration_proxy (line 1759) | explicit iteration_proxy(typename IteratorType::reference cont) no...
method begin (line 1763) | iteration_proxy_value<IteratorType> begin() noexcept
method end (line 1769) | iteration_proxy_value<IteratorType> end() noexcept
class iteration_proxy_value (line 5611) | class iteration_proxy_value
method iteration_proxy_value (line 1686) | explicit iteration_proxy_value(IteratorType it) noexcept : anchor(...
method iteration_proxy_value (line 1689) | iteration_proxy_value& operator*()
method iteration_proxy_value (line 1695) | iteration_proxy_value& operator++()
method value (line 1744) | typename IteratorType::reference value() const
class iter_impl (line 5630) | class iter_impl
method iter_impl (line 5668) | iter_impl() = default;
method iter_impl (line 5676) | explicit iter_impl(pointer object) noexcept : m_object(object)
method iter_impl (line 5716) | iter_impl(const iter_impl<typename std::remove_const<BasicJsonType...
method iter_impl (line 5725) | iter_impl& operator=(const iter_impl<typename std::remove_const<Ba...
method set_begin (line 5737) | void set_begin() noexcept
method set_end (line 5774) | void set_end() noexcept
method reference (line 5805) | reference operator*() const
method pointer (line 5842) | pointer operator->() const
method iter_impl (line 5876) | iter_impl const operator++(int)
method iter_impl (line 5887) | iter_impl& operator++()
method iter_impl (line 5919) | iter_impl const operator--(int)
method iter_impl (line 5930) | iter_impl& operator--()
method iter_impl (line 6052) | iter_impl& operator+=(difference_type i)
method iter_impl (line 6081) | iter_impl& operator-=(difference_type i)
method iter_impl (line 6090) | iter_impl operator+(difference_type i) const
method iter_impl (line 6101) | iter_impl operator+(difference_type i, const iter_impl& it)
method iter_impl (line 6112) | iter_impl operator-(difference_type i) const
method difference_type (line 6123) | difference_type operator-(const iter_impl& other) const
method reference (line 6144) | reference operator[](difference_type n) const
method reference (line 6191) | reference value() const
class json_reverse_iterator (line 6240) | class json_reverse_iterator : public std::reverse_iterator<Base>
method json_reverse_iterator (line 6250) | explicit json_reverse_iterator(const typename base_iterator::itera...
method json_reverse_iterator (line 6254) | explicit json_reverse_iterator(const base_iterator& it) noexcept :...
method json_reverse_iterator (line 6257) | json_reverse_iterator const operator++(int)
method json_reverse_iterator (line 6263) | json_reverse_iterator& operator++()
method json_reverse_iterator (line 6269) | json_reverse_iterator const operator--(int)
method json_reverse_iterator (line 6275) | json_reverse_iterator& operator--()
method json_reverse_iterator (line 6281) | json_reverse_iterator& operator+=(difference_type i)
method json_reverse_iterator (line 6287) | json_reverse_iterator operator+(difference_type i) const
method json_reverse_iterator (line 6293) | json_reverse_iterator operator-(difference_type i) const
method difference_type (line 6299) | difference_type operator-(const json_reverse_iterator& other) const
method reference (line 6305) | reference operator[](difference_type n) const
method key (line 6311) | auto key() const -> decltype(std::declval<Base>().key())
method reference (line 6318) | reference value() const
type output_adapter_protocol (line 6344) | struct output_adapter_protocol
class output_vector_adapter (line 6357) | class output_vector_adapter : public output_adapter_protocol<CharType>
method output_vector_adapter (line 6360) | explicit output_vector_adapter(std::vector<CharType>& vec) noexcept
method write_character (line 6364) | void write_character(CharType c) override
method write_characters (line 6369) | void write_characters(const CharType* s, std::size_t length) override
class output_stream_adapter (line 6380) | class output_stream_adapter : public output_adapter_protocol<CharType>
method output_stream_adapter (line 6383) | explicit output_stream_adapter(std::basic_ostream<CharType>& s) no...
method write_character (line 6387) | void write_character(CharType c) override
method write_characters (line 6392) | void write_characters(const CharType* s, std::size_t length) override
class output_string_adapter (line 6403) | class output_string_adapter : public output_adapter_protocol<CharType>
method output_string_adapter (line 6406) | explicit output_string_adapter(StringType& s) noexcept
method write_character (line 6410) | void write_character(CharType c) override
method write_characters (line 6415) | void write_characters(const CharType* s, std::size_t length) override
class output_adapter (line 6425) | class output_adapter
method output_adapter (line 6428) | output_adapter(std::vector<CharType>& vec)
method output_adapter (line 6431) | output_adapter(std::basic_ostream<CharType>& s)
method output_adapter (line 6434) | output_adapter(StringType& s)
class binary_reader (line 6489) | class binary_reader
method binary_reader (line 6503) | explicit binary_reader(input_adapter_t adapter) : ia(std::move(ada...
method sax_parse (line 6516) | bool sax_parse(const input_format_t format,
method little_endianess (line 6576) | static constexpr bool little_endianess(int num = 1) noexcept
method parse_bson_internal (line 6590) | bool parse_bson_internal()
method get_bson_cstr (line 6615) | bool get_bson_cstr(string_t& result)
method get_bson_string (line 6647) | bool get_bson_string(const NumberType len, string_t& result)
method parse_bson_element_internal (line 6668) | bool parse_bson_element_internal(const int element_type,
method parse_bson_element_list (line 6739) | bool parse_bson_element_list(const bool is_array)
method parse_bson_array (line 6779) | bool parse_bson_array()
method parse_cbor_internal (line 6808) | bool parse_cbor_internal(const bool get_char = true)
method get_cbor_string (line 7150) | bool get_cbor_string(string_t& result)
method get_cbor_array (line 7239) | bool get_cbor_array(const std::size_t len)
method get_cbor_object (line 7275) | bool get_cbor_object(const std::size_t len)
method parse_msgpack_internal (line 7327) | bool parse_msgpack_internal()
method get_msgpack_string (line 7696) | bool get_msgpack_string(string_t& result)
method get_msgpack_array (line 7772) | bool get_msgpack_array(const std::size_t len)
method get_msgpack_object (line 7794) | bool get_msgpack_object(const std::size_t len)
method parse_ubjson_internal (line 7831) | bool parse_ubjson_internal(const bool get_char = true)
method get_ubjson_string (line 7850) | bool get_ubjson_string(string_t& result, const bool get_char = true)
method get_ubjson_size_value (line 7904) | bool get_ubjson_size_value(std::size_t& result)
method get_ubjson_size_type (line 7981) | bool get_ubjson_size_type(std::pair<std::size_t, int>& result)
method get_ubjson_value (line 8020) | bool get_ubjson_value(const int prefix)
method get_ubjson_array (line 8116) | bool get_ubjson_array()
method get_ubjson_object (line 8178) | bool get_ubjson_object()
method get (line 8263) | int get()
method get_ignore_noop (line 8272) | int get_ignore_noop()
method get_number (line 8297) | bool get_number(const input_format_t format, NumberType& result)
method get_string (line 8340) | bool get_string(const input_format_t format,
method unexpect_eof (line 8362) | bool unexpect_eof(const input_format_t format, const char* context...
method get_token_string (line 8375) | std::string get_token_string() const
method exception_message (line 8388) | std::string exception_message(const input_format_t format,
class binary_writer (line 8466) | class binary_writer
method binary_writer (line 8476) | explicit binary_writer(output_adapter_t<CharType> adapter) : oa(ad...
method write_bson (line 8485) | void write_bson(const BasicJsonType& j)
method write_cbor (line 8505) | void write_cbor(const BasicJsonType& j)
method write_msgpack (line 8749) | void write_msgpack(const BasicJsonType& j)
method write_ubjson (line 8991) | void write_ubjson(const BasicJsonType& j, const bool use_count,
method calc_bson_entry_header_size (line 9155) | static std::size_t calc_bson_entry_header_size(const string_t& name)
method write_bson_entry_header (line 9170) | void write_bson_entry_header(const string_t& name,
method write_bson_boolean (line 9182) | void write_bson_boolean(const string_t& name,
method write_bson_double (line 9192) | void write_bson_double(const string_t& name,
method calc_bson_string_size (line 9202) | static std::size_t calc_bson_string_size(const string_t& value)
method write_bson_string (line 9210) | void write_bson_string(const string_t& name,
method write_bson_null (line 9224) | void write_bson_null(const string_t& name)
method calc_bson_integer_size (line 9232) | static std::size_t calc_bson_integer_size(const std::int64_t value)
method write_bson_integer (line 9247) | void write_bson_integer(const string_t& name,
method calc_bson_unsigned_size (line 9265) | static constexpr std::size_t calc_bson_unsigned_size(const std::ui...
method write_bson_unsigned (line 9275) | void write_bson_unsigned(const string_t& name,
method write_bson_object_entry (line 9297) | void write_bson_object_entry(const string_t& name,
method calc_bson_array_size (line 9307) | static std::size_t calc_bson_array_size(const typename BasicJsonTy...
method write_bson_array (line 9323) | void write_bson_array(const string_t& name,
method calc_bson_element_size (line 9343) | static std::size_t calc_bson_element_size(const string_t& name,
method write_bson_element (line 9388) | void write_bson_element(const string_t& name,
method calc_bson_object_size (line 9431) | static std::size_t calc_bson_object_size(const typename BasicJsonT...
method write_bson_object (line 9446) | void write_bson_object(const typename BasicJsonType::object_t& value)
method CharType (line 9462) | static constexpr CharType get_cbor_float_prefix(float /*unused*/)
method CharType (line 9467) | static constexpr CharType get_cbor_float_prefix(double /*unused*/)
method CharType (line 9476) | static constexpr CharType get_msgpack_float_prefix(float /*unused*/)
method CharType (line 9481) | static constexpr CharType get_msgpack_float_prefix(double /*unused*/)
method write_number_with_ubjson_prefix (line 9493) | void write_number_with_ubjson_prefix(const NumberType n,
method write_number_with_ubjson_prefix (line 9506) | void write_number_with_ubjson_prefix(const NumberType n,
method write_number_with_ubjson_prefix (line 9559) | void write_number_with_ubjson_prefix(const NumberType n,
method CharType (line 9619) | CharType ubjson_prefix(const BasicJsonType& j) const noexcept
method CharType (line 9690) | static constexpr CharType get_ubjson_float_prefix(float /*unused*/)
method CharType (line 9695) | static constexpr CharType get_ubjson_float_prefix(double /*unused*/)
method write_number (line 9716) | void write_number(const NumberType n)
method CharType (line 9739) | static constexpr CharType to_char_type(std::uint8_t x) noexcept
method CharType (line 9746) | static CharType to_char_type(std::uint8_t x) noexcept
method CharType (line 9757) | static constexpr CharType to_char_type(std::uint8_t x) noexcept
method CharType (line 9768) | static constexpr CharType to_char_type(InputCharType x) noexcept
type dtoa_impl (line 9834) | namespace dtoa_impl
function Target (line 9838) | Target reinterpret_bits(const Source source)
type diyfp (line 9847) | struct diyfp // f * 2^e
method diyfp (line 9854) | constexpr diyfp(uint64_t f_, int e_) noexcept : f(f_), e(e_) {}
method diyfp (line 9860) | static diyfp sub(const diyfp& x, const diyfp& y) noexcept
method diyfp (line 9872) | static diyfp mul(const diyfp& x, const diyfp& y) noexcept
method diyfp (line 9937) | static diyfp normalize(diyfp x) noexcept
method diyfp (line 9954) | static diyfp normalize_to(const diyfp& x, const int target_expon...
type boundaries (line 9965) | struct boundaries
function boundaries (line 9979) | boundaries compute_boundaries(FloatType value)
type cached_power (line 10104) | struct cached_power // c = f * 2^e ~= 10^k
function cached_power (line 10118) | inline cached_power get_cached_power_for_binary_exponent(int e)
function find_largest_pow10 (line 10282) | inline int find_largest_pow10(const uint32_t n, uint32_t& pow10)
function grisu2_round (line 10338) | inline void grisu2_round(char* buf, int len, uint64_t dist, uint64...
function grisu2_digit_gen (line 10379) | inline void grisu2_digit_gen(char* buffer, int& length, int& decim...
function grisu2 (line 10619) | inline void grisu2(char* buf, int& len, int& decimal_exponent,
function grisu2 (line 10678) | void grisu2(char* buf, int& len, int& decimal_exponent, FloatType ...
type error_handler_t (line 10917) | enum class error_handler_t
class serializer (line 10925) | class serializer
method serializer (line 10940) | serializer(output_adapter_t<char> s, const char ichar,
method serializer (line 10952) | serializer(const serializer&) = delete;
method serializer (line 10953) | serializer& operator=(const serializer&) = delete;
method serializer (line 10954) | serializer(serializer&&) = delete;
method serializer (line 10955) | serializer& operator=(serializer&&) = delete;
method dump (line 10975) | void dump(const BasicJsonType& val, const bool pretty_print,
method dump_escaped (line 11182) | void dump_escaped(const string_t& s, const bool ensure_ascii)
method dump_integer (line 11427) | void dump_integer(NumberType x)
method dump_float (line 11468) | void dump_float(number_float_t x)
method dump_float (line 11489) | void dump_float(number_float_t x, std::true_type /*is_ieee_single_...
method dump_float (line 11497) | void dump_float(number_float_t x, std::false_type /*is_ieee_single...
method decode (line 11567) | static uint8_t decode(uint8_t& state, uint32_t& codep, const uint8...
class json_ref (line 11641) | class json_ref
method json_ref (line 11646) | json_ref(value_type&& value)
method json_ref (line 11650) | json_ref(const value_type& value)
method json_ref (line 11654) | json_ref(std::initializer_list<json_ref> init)
method json_ref (line 11661) | json_ref(Args && ... args)
method json_ref (line 11666) | json_ref(json_ref&&) = default;
method json_ref (line 11667) | json_ref(const json_ref&) = delete;
method json_ref (line 11668) | json_ref& operator=(const json_ref&) = delete;
method json_ref (line 11669) | json_ref& operator=(json_ref&&) = delete;
method value_type (line 11672) | value_type moved_or_copied() const
method value_type (line 11681) | value_type const& operator*() const
method value_type (line 11686) | value_type const* operator->() const
type detail (line 353) | namespace detail
type index_sequence (line 274) | struct index_sequence
method size (line 278) | static constexpr std::size_t size() noexcept
type merge_and_renumber (line 285) | struct merge_and_renumber
type make_index_sequence (line 292) | struct make_index_sequence
type make_index_sequence<0> (line 296) | struct make_index_sequence<0> : index_sequence<> {}
type make_index_sequence<1> (line 297) | struct make_index_sequence<1> : index_sequence<0> {}
type priority_tag (line 303) | struct priority_tag : priority_tag < N - 1 > {}
type priority_tag<0> (line 304) | struct priority_tag<0> {}
type static_const (line 308) | struct static_const
type make_void (line 340) | struct make_void
type iterator_types (line 356) | struct iterator_types {}
type iterator_types <
It,
void_t<typename It::difference_type, typename It::value_type, typename It::pointer,
typename It::reference, typename It::iterator_category >> (line 359) | struct iterator_types <
type iterator_traits (line 374) | struct iterator_traits
type iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >> (line 379) | struct iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >>
type iterator_traits<T*, enable_if_t<std::is_object<T>::value>> (line 385) | struct iterator_traits<T*, enable_if_t<std::is_object<T>::value>>
type nonesuch (line 411) | struct nonesuch
method nonesuch (line 413) | nonesuch() = delete;
method nonesuch (line 415) | nonesuch(nonesuch const&) = delete;
type detector (line 423) | struct detector
type is_basic_json (line 485) | struct is_basic_json : std::false_type {}
type has_from_json (line 529) | struct has_from_json : std::false_type {}
type has_from_json<BasicJsonType, T,
enable_if_t<not is_basic_json<T>::value>> (line 532) | struct has_from_json<BasicJsonType, T,
type has_non_default_from_json (line 545) | struct has_non_default_from_json : std::false_type {}
type has_non_default_from_json<BasicJsonType, T, enable_if_t<not is_basic_json<T>::value>> (line 548) | struct has_non_default_from_json<BasicJsonType, T, enable_if_t<not i...
type has_to_json (line 560) | struct has_to_json : std::false_type {}
type has_to_json<BasicJsonType, T, enable_if_t<not is_basic_json<T>::value>> (line 563) | struct has_to_json<BasicJsonType, T, enable_if_t<not is_basic_json<T...
type is_iterator_traits (line 578) | struct is_iterator_traits : std::false_type {}
type is_iterator_traits<iterator_traits<T>> (line 581) | struct is_iterator_traits<iterator_traits<T>>
type is_complete_type (line 598) | struct is_complete_type : std::false_type {}
type is_complete_type<T, decltype(void(sizeof(T)))> (line 601) | struct is_complete_type<T, decltype(void(sizeof(T)))> : std::true_ty...
type is_compatible_object_type_impl (line 605) | struct is_compatible_object_type_impl : std::false_type {}
type is_compatible_object_type_impl <
BasicJsonType, CompatibleObjectType,
enable_if_t<is_detected<mapped_type_t, CompatibleObjectType>::value and
is_detected<key_type_t, CompatibleObjectType>::value >> (line 608) | struct is_compatible_object_type_impl <
type is_compatible_object_type (line 625) | struct is_compatible_object_type
type is_constructible_object_type_impl (line 630) | struct is_constructible_object_type_impl : std::false_type {}
type is_constructible_object_type_impl <
BasicJsonType, ConstructibleObjectType,
enable_if_t<is_detected<mapped_type_t, ConstructibleObjectType>::value and
is_detected<key_type_t, ConstructibleObjectType>::value >> (line 633) | struct is_constructible_object_type_impl <
type is_constructible_object_type (line 648) | struct is_constructible_object_type
type is_compatible_string_type_impl (line 654) | struct is_compatible_string_type_impl : std::false_type {}
type is_compatible_string_type_impl <
BasicJsonType, CompatibleStringType,
enable_if_t<is_detected_exact<typename BasicJsonType::string_t::value_type,
value_type_t, CompatibleStringType>::value >> (line 657) | struct is_compatible_string_type_impl <
type is_compatible_string_type (line 667) | struct is_compatible_string_type
type is_constructible_string_type_impl (line 672) | struct is_constructible_string_type_impl : std::false_type {}
type is_constructible_string_type_impl <
BasicJsonType, ConstructibleStringType,
enable_if_t<is_detected_exact<typename BasicJsonType::string_t::value_type,
value_type_t, ConstructibleStringType>::value >> (line 675) | struct is_constructible_string_type_impl <
type is_constructible_string_type (line 686) | struct is_constructible_string_type
type is_compatible_array_type_impl (line 690) | struct is_compatible_array_type_impl : std::false_type {}
type is_compatible_array_type (line 709) | struct is_compatible_array_type
type is_constructible_array_type_impl (line 713) | struct is_constructible_array_type_impl : std::false_type {}
type is_constructible_array_type_impl <
BasicJsonType, ConstructibleArrayType,
enable_if_t<std::is_same<ConstructibleArrayType,
typename BasicJsonType::value_type>::value >> (line 716) | struct is_constructible_array_type_impl <
type is_constructible_array_type_impl <
BasicJsonType, ConstructibleArrayType,
enable_if_t<not std::is_same<ConstructibleArrayType,
typename BasicJsonType::value_type>::value and
is_detected<value_type_t, ConstructibleArrayType>::value and
is_detected<iterator_t, ConstructibleArrayType>::value and
is_complete_type<
detected_t<value_type_t, ConstructibleArrayType>>::value >> (line 723) | struct is_constructible_array_type_impl <
type is_constructible_array_type (line 748) | struct is_constructible_array_type
type is_compatible_integer_type_impl (line 753) | struct is_compatible_integer_type_impl : std::false_type {}
type is_compatible_integer_type_impl <
RealIntegerType, CompatibleNumberIntegerType,
enable_if_t<std::is_integral<RealIntegerType>::value and
std::is_integral<CompatibleNumberIntegerType>::value and
not std::is_same<bool, CompatibleNumberIntegerType>::value >> (line 756) | struct is_compatible_integer_type_impl <
type is_compatible_integer_type (line 774) | struct is_compatible_integer_type
type is_compatible_type_impl (line 779) | struct is_compatible_type_impl: std::false_type {}
type is_compatible_type_impl <
BasicJsonType, CompatibleType,
enable_if_t<is_complete_type<CompatibleType>::value >> (line 782) | struct is_compatible_type_impl <
type is_compatible_type (line 791) | struct is_compatible_type
type position_t (line 813) | struct position_t
class exception (line 869) | class exception : public std::exception
method exception (line 882) | exception(int id_, const char* what_arg) : id(id_), m(what_arg) {}
method name (line 884) | static std::string name(const std::string& ename, int id_)
class parse_error (line 938) | class parse_error : public exception
method parse_error (line 950) | static parse_error create(int id_, const position_t& pos, const st...
method parse_error (line 957) | static parse_error create(int id_, std::size_t byte_, const std::s...
method parse_error (line 977) | parse_error(int id_, std::size_t byte_, const char* what_arg)
method position_string (line 980) | static std::string position_string(const position_t& pos)
class invalid_iterator (line 1024) | class invalid_iterator : public exception
method invalid_iterator (line 1027) | static invalid_iterator create(int id_, const std::string& what_arg)
method invalid_iterator (line 1034) | invalid_iterator(int id_, const char* what_arg)
class type_error (line 1077) | class type_error : public exception
method type_error (line 1080) | static type_error create(int id_, const std::string& what_arg)
method type_error (line 1087) | type_error(int id_, const char* what_arg) : exception(id_, what_ar...
class out_of_range (line 1123) | class out_of_range : public exception
method out_of_range (line 1126) | static out_of_range create(int id_, const std::string& what_arg)
method out_of_range (line 1133) | out_of_range(int id_, const char* what_arg) : exception(id_, what_...
class other_error (line 1160) | class other_error : public exception
method other_error (line 1163) | static other_error create(int id_, const std::string& what_arg)
method other_error (line 1170) | other_error(int id_, const char* what_arg) : exception(id_, what_a...
type value_t (line 1215) | enum class value_t : std::uint8_t
function from_json (line 1285) | void from_json(const BasicJsonType& j, typename std::nullptr_t& n)
function get_arithmetic_value (line 1299) | void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val)
function from_json (line 1325) | void from_json(const BasicJsonType& j, typename BasicJsonType::boole...
function from_json (line 1335) | void from_json(const BasicJsonType& j, typename BasicJsonType::strin...
function from_json (line 1351) | void from_json(const BasicJsonType& j, ConstructibleStringType& s)
function from_json (line 1362) | void from_json(const BasicJsonType& j, typename BasicJsonType::numbe...
function from_json (line 1368) | void from_json(const BasicJsonType& j, typename BasicJsonType::numbe...
function from_json (line 1374) | void from_json(const BasicJsonType& j, typename BasicJsonType::numbe...
function from_json (line 1381) | void from_json(const BasicJsonType& j, EnumType& e)
function from_json (line 1391) | void from_json(const BasicJsonType& j, std::forward_list<T, Allocato...
function from_json (line 1407) | void from_json(const BasicJsonType& j, std::valarray<T>& l)
function from_json_array_impl (line 1418) | void from_json_array_impl(const BasicJsonType& j, typename BasicJson...
function from_json_array_impl (line 1424) | auto from_json_array_impl(const BasicJsonType& j, std::array<T, N>& ...
function from_json_array_impl (line 1435) | auto from_json_array_impl(const BasicJsonType& j, ConstructibleArray...
function from_json_array_impl (line 1454) | void from_json_array_impl(const BasicJsonType& j, ConstructibleArray...
function from_json (line 1477) | auto from_json(const BasicJsonType& j, ConstructibleArrayType& arr)
function from_json (line 1493) | void from_json(const BasicJsonType& j, ConstructibleObjectType& obj)
function from_json (line 1523) | void from_json(const BasicJsonType& j, ArithmeticType& val)
function from_json (line 1554) | void from_json(const BasicJsonType& j, std::pair<A1, A2>& p)
function from_json_tuple_impl (line 1560) | void from_json_tuple_impl(const BasicJsonType& j, Tuple& t, index_se...
function from_json (line 1566) | void from_json(const BasicJsonType& j, std::tuple<Args...>& t)
function from_json (line 1574) | void from_json(const BasicJsonType& j, std::map<Key, Value, Compare,...
function from_json (line 1593) | void from_json(const BasicJsonType& j, std::unordered_map<Key, Value...
type from_json_fn (line 1609) | struct from_json_fn
class iteration_proxy_value (line 1664) | class iteration_proxy_value
method iteration_proxy_value (line 1686) | explicit iteration_proxy_value(IteratorType it) noexcept : anchor(...
method iteration_proxy_value (line 1689) | iteration_proxy_value& operator*()
method iteration_proxy_value (line 1695) | iteration_proxy_value& operator++()
method value (line 1744) | typename IteratorType::reference value() const
class iteration_proxy (line 1751) | class iteration_proxy
method iteration_proxy (line 1759) | explicit iteration_proxy(typename IteratorType::reference cont) no...
method begin (line 1763) | iteration_proxy_value<IteratorType> begin() noexcept
method end (line 1769) | iteration_proxy_value<IteratorType> end() noexcept
function get (line 1778) | auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>...
function get (line 1786) | auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>...
type external_constructor (line 1821) | struct external_constructor
type external_constructor<value_t::boolean> (line 1824) | struct external_constructor<value_t::boolean>
method construct (line 1827) | static void construct(BasicJsonType& j, typename BasicJsonType::bo...
type external_constructor<value_t::string> (line 1836) | struct external_constructor<value_t::string>
method construct (line 1839) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
method construct (line 1847) | static void construct(BasicJsonType& j, typename BasicJsonType::st...
method construct (line 1857) | static void construct(BasicJsonType& j, const CompatibleStringType...
type external_constructor<value_t::number_float> (line 1866) | struct external_constructor<value_t::number_float>
method construct (line 1869) | static void construct(BasicJsonType& j, typename BasicJsonType::nu...
type external_constructor<value_t::number_unsigned> (line 1878) | struct external_constructor<value_t::number_unsigned>
method construct (line 1881) | static void construct(BasicJsonType& j, typename BasicJsonType::nu...
type external_constructor<value_t::number_integer> (line 1890) | struct external_constructor<value_t::number_integer>
method construct (line 1893) | static void construct(BasicJsonType& j, typename BasicJsonType::nu...
type external_constructor<value_t::array> (line 1902) | struct external_constructor<value_t::array>
method construct (line 1905) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
method construct (line 1913) | static void construct(BasicJsonType& j, typename BasicJsonType::ar...
method construct (line 1923) | static void construct(BasicJsonType& j, const CompatibleArrayType&...
method construct (line 1933) | static void construct(BasicJsonType& j, const std::vector<bool>& arr)
method construct (line 1947) | static void construct(BasicJsonType& j, const std::valarray<T>& arr)
type external_constructor<value_t::object> (line 1958) | struct external_constructor<value_t::object>
method construct (line 1961) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
method construct (line 1969) | static void construct(BasicJsonType& j, typename BasicJsonType::ob...
method construct (line 1978) | static void construct(BasicJsonType& j, const CompatibleObjectType...
function to_json (line 1995) | void to_json(BasicJsonType& j, T b) noexcept
function to_json (line 2002) | void to_json(BasicJsonType& j, const CompatibleString& s)
function to_json (line 2008) | void to_json(BasicJsonType& j, typename BasicJsonType::string_t&& s)
function to_json (line 2015) | void to_json(BasicJsonType& j, FloatType val) noexcept
function to_json (line 2022) | void to_json(BasicJsonType& j, CompatibleNumberUnsignedType val) noe...
function to_json (line 2029) | void to_json(BasicJsonType& j, CompatibleNumberIntegerType val) noex...
function to_json (line 2036) | void to_json(BasicJsonType& j, EnumType e) noexcept
function to_json (line 2043) | void to_json(BasicJsonType& j, const std::vector<bool>& e)
function to_json (line 2056) | void to_json(BasicJsonType& j, const CompatibleArrayType& arr)
function to_json (line 2063) | void to_json(BasicJsonType& j, const std::valarray<T>& arr)
function to_json (line 2069) | void to_json(BasicJsonType& j, typename BasicJsonType::array_t&& arr)
function to_json (line 2076) | void to_json(BasicJsonType& j, const CompatibleObjectType& obj)
function to_json (line 2082) | void to_json(BasicJsonType& j, typename BasicJsonType::object_t&& obj)
function to_json (line 2092) | void to_json(BasicJsonType& j, const T(&arr)[N])
function to_json (line 2098) | void to_json(BasicJsonType& j, const std::pair<Args...>& p)
function to_json (line 2106) | void to_json(BasicJsonType& j, const T& b)
function to_json_tuple_impl (line 2112) | void to_json_tuple_impl(BasicJsonType& j, const Tuple& t, index_sequ...
function to_json (line 2118) | void to_json(BasicJsonType& j, const std::tuple<Args...>& t)
type to_json_fn (line 2123) | struct to_json_fn
type input_format_t (line 2164) | enum class input_format_t { json, cbor, msgpack, ubjson, bson }
type input_adapter_protocol (line 2181) | struct input_adapter_protocol
class file_input_adapter (line 2195) | class file_input_adapter : public input_adapter_protocol
method file_input_adapter (line 2198) | explicit file_input_adapter(std::FILE* f) noexcept
method get_character (line 2202) | std::char_traits<char>::int_type get_character() noexcept override
class input_stream_adapter (line 2221) | class input_stream_adapter : public input_adapter_protocol
method input_stream_adapter (line 2231) | explicit input_stream_adapter(std::istream& i)
method input_stream_adapter (line 2236) | input_stream_adapter(const input_stream_adapter&) = delete;
method input_stream_adapter (line 2237) | input_stream_adapter& operator=(input_stream_adapter&) = delete;
method input_stream_adapter (line 2238) | input_stream_adapter(input_stream_adapter&&) = delete;
method input_stream_adapter (line 2239) | input_stream_adapter& operator=(input_stream_adapter&&) = delete;
method get_character (line 2244) | std::char_traits<char>::int_type get_character() override
class input_buffer_adapter (line 2262) | class input_buffer_adapter : public input_adapter_protocol
method input_buffer_adapter (line 2265) | input_buffer_adapter(const char* b, const std::size_t l) noexcept
method input_buffer_adapter (line 2270) | input_buffer_adapter(const input_buffer_adapter&) = delete;
method input_buffer_adapter (line 2271) | input_buffer_adapter& operator=(input_buffer_adapter&) = delete;
method input_buffer_adapter (line 2272) | input_buffer_adapter(input_buffer_adapter&&) = delete;
method input_buffer_adapter (line 2273) | input_buffer_adapter& operator=(input_buffer_adapter&&) = delete;
method get_character (line 2276) | std::char_traits<char>::int_type get_character() noexcept override
type wide_string_input_helper (line 2294) | struct wide_string_input_helper
method fill_buffer (line 2297) | static void fill_buffer(const WideStringType& str, size_t& current...
type wide_string_input_helper<WideStringType, 2> (line 2349) | struct wide_string_input_helper<WideStringType, 2>
method fill_buffer (line 2352) | static void fill_buffer(const WideStringType& str, size_t& current...
class wide_string_input_adapter (line 2410) | class wide_string_input_adapter : public input_adapter_protocol
method wide_string_input_adapter (line 2413) | explicit wide_string_input_adapter(const WideStringType& w) noexcept
method get_character (line 2417) | std::char_traits<char>::int_type get_character() noexcept override
method fill_buffer (line 2436) | void fill_buffer()
class input_adapter (line 2456) | class input_adapter
method input_adapter (line 2460) | input_adapter(std::FILE* file)
method input_adapter (line 2463) | input_adapter(std::istream& i)
method input_adapter (line 2467) | input_adapter(std::istream&& i)
method input_adapter (line 2470) | input_adapter(const std::wstring& ws)
method input_adapter (line 2473) | input_adapter(const std::u16string& ws)
method input_adapter (line 2476) | input_adapter(const std::u32string& ws)
method input_adapter (line 2486) | input_adapter(CharT b, std::size_t l)
method input_adapter (line 2498) | input_adapter(CharT b)
method input_adapter (line 2507) | input_adapter(IteratorType first, IteratorType last)
method input_adapter (line 2542) | input_adapter(T (&array)[N])
method input_adapter (line 2550) | input_adapter(const ContiguousContainer& c)
class lexer (line 2597) | class lexer
type token_type (line 2606) | enum class token_type
method lexer (line 2671) | explicit lexer(detail::input_adapter_t&& adapter)
method lexer (line 2675) | lexer(const lexer&) = delete;
method lexer (line 2676) | lexer(lexer&&) = delete;
method lexer (line 2677) | lexer& operator=(lexer&) = delete;
method lexer (line 2678) | lexer& operator=(lexer&&) = delete;
method get_decimal_point (line 2687) | static char get_decimal_point() noexcept
method get_codepoint (line 2713) | int get_codepoint()
method next_byte_in_range (line 2761) | bool next_byte_in_range(std::initializer_list<int> ranges)
method token_type (line 2798) | token_type scan_string()
method strtof (line 3384) | static void strtof(float& f, const char* str, char** endptr) noexcept
method strtof (line 3389) | static void strtof(double& f, const char* str, char** endptr) noex...
method strtof (line 3394) | static void strtof(long double& f, const char* str, char** endptr)...
method token_type (line 3439) | token_type scan_number() // lgtm [cpp/use-of-goto]
method token_type (line 3773) | token_type scan_literal(const char* literal_text, const std::size_...
method reset (line 3793) | void reset() noexcept
method get (line 3810) | std::char_traits<char>::int_type get()
method unget (line 3847) | void unget()
method add (line 3874) | void add(int c)
method number_integer_t (line 3885) | constexpr number_integer_t get_number_integer() const noexcept
method number_unsigned_t (line 3891) | constexpr number_unsigned_t get_number_unsigned() const noexcept
method number_float_t (line 3897) | constexpr number_float_t get_number_float() const noexcept
method string_t (line 3903) | string_t& get_string()
method position_t (line 3913) | constexpr position_t get_position() const noexcept
method get_token_string (line 3921) | std::string get_token_string() const
method skip_bom (line 3958) | bool skip_bom()
method token_type (line 3972) | token_type scan()
type is_sax (line 4152) | struct is_sax
type is_sax_static_asserts (line 4184) | struct is_sax_static_asserts
class json_sax_dom_parser (line 4382) | class json_sax_dom_parser
method json_sax_dom_parser (line 4395) | explicit json_sax_dom_parser(BasicJsonType& r, const bool allow_ex...
method null (line 4399) | bool null()
method boolean (line 4405) | bool boolean(bool val)
method number_integer (line 4411) | bool number_integer(number_integer_t val)
method number_unsigned (line 4417) | bool number_unsigned(number_unsigned_t val)
method number_float (line 4423) | bool number_float(number_float_t val, const string_t& /*unused*/)
method string (line 4429) | bool string(string_t& val)
method start_object (line 4435) | bool start_object(std::size_t len)
method key (line 4448) | bool key(string_t& val)
method end_object (line 4455) | bool end_object()
method start_array (line 4461) | bool start_array(std::size_t len)
method end_array (line 4474) | bool end_array()
method parse_error (line 4480) | bool parse_error(std::size_t /*unused*/, const std::string& /*unus...
method is_errored (line 4508) | constexpr bool is_errored() const
method BasicJsonType (line 4521) | BasicJsonType* handle_value(Value&& v)
class json_sax_dom_callback_parser (line 4557) | class json_sax_dom_callback_parser
method json_sax_dom_callback_parser (line 4567) | json_sax_dom_callback_parser(BasicJsonType& r,
method null (line 4575) | bool null()
method boolean (line 4581) | bool boolean(bool val)
method number_integer (line 4587) | bool number_integer(number_integer_t val)
method number_unsigned (line 4593) | bool number_unsigned(number_unsigned_t val)
method number_float (line 4599) | bool number_float(number_float_t val, const string_t& /*unused*/)
method string (line 4605) | bool string(string_t& val)
method start_object (line 4611) | bool start_object(std::size_t len)
method key (line 4633) | bool key(string_t& val)
method end_object (line 4650) | bool end_object()
method start_array (line 4685) | bool start_array(std::size_t len)
method end_array (line 4706) | bool end_array()
method parse_error (line 4737) | bool parse_error(std::size_t /*unused*/, const std::string& /*unus...
method is_errored (line 4765) | constexpr bool is_errored() const
method handle_value (line 4787) | std::pair<bool, BasicJsonType*> handle_value(Value&& v, const bool...
class json_sax_acceptor (line 4870) | class json_sax_acceptor
method null (line 4878) | bool null()
method boolean (line 4883) | bool boolean(bool /*unused*/)
method number_integer (line 4888) | bool number_integer(number_integer_t /*unused*/)
method number_unsigned (line 4893) | bool number_unsigned(number_unsigned_t /*unused*/)
method number_float (line 4898) | bool number_float(number_float_t /*unused*/, const string_t& /*unu...
method string (line 4903) | bool string(string_t& /*unused*/)
method start_object (line 4908) | bool start_object(std::size_t /*unused*/ = std::size_t(-1))
method key (line 4913) | bool key(string_t& /*unused*/)
method end_object (line 4918) | bool end_object()
method start_array (line 4923) | bool start_array(std::size_t /*unused*/ = std::size_t(-1))
method end_array (line 4928) | bool end_array()
method parse_error (line 4933) | bool parse_error(std::size_t /*unused*/, const std::string& /*unus...
class parser (line 4961) | class parser
type parse_event_t (line 4971) | enum class parse_event_t : uint8_t
method parser (line 4991) | explicit parser(detail::input_adapter_t&& adapter,
method parse (line 5010) | void parse(const bool strict, BasicJsonType& result)
method accept (line 5071) | bool accept(const bool strict = true)
method sax_parse (line 5078) | bool sax_parse(SAX* sax, const bool strict = true)
method sax_parse_internal (line 5097) | bool sax_parse_internal(SAX* sax)
method token_type (line 5388) | token_type get_token()
method exception_message (line 5393) | std::string exception_message(const token_type expected, const std...
class primitive_iterator_t (line 5454) | class primitive_iterator_t
method difference_type (line 5465) | constexpr difference_type get_value() const noexcept
method set_begin (line 5471) | void set_begin() noexcept
method set_end (line 5477) | void set_end() noexcept
method is_begin (line 5483) | constexpr bool is_begin() const noexcept
method is_end (line 5489) | constexpr bool is_end() const noexcept
method primitive_iterator_t (line 5504) | primitive_iterator_t operator+(difference_type n) noexcept
method difference_type (line 5511) | constexpr difference_type operator-(primitive_iterator_t lhs, prim...
method primitive_iterator_t (line 5516) | primitive_iterator_t& operator++() noexcept
method primitive_iterator_t (line 5522) | primitive_iterator_t const operator++(int) noexcept
method primitive_iterator_t (line 5529) | primitive_iterator_t& operator--() noexcept
method primitive_iterator_t (line 5535) | primitive_iterator_t const operator--(int) noexcept
method primitive_iterator_t (line 5542) | primitive_iterator_t& operator+=(difference_type n) noexcept
method primitive_iterator_t (line 5548) | primitive_iterator_t& operator-=(difference_type n) noexcept
type internal_iterator (line 5573) | struct internal_iterator
class iteration_proxy (line 5610) | class iteration_proxy
method iteration_proxy (line 1759) | explicit iteration_proxy(typename IteratorType::reference cont) no...
method begin (line 1763) | iteration_proxy_value<IteratorType> begin() noexcept
method end (line 1769) | iteration_proxy_value<IteratorType> end() noexcept
class iteration_proxy_value (line 5611) | class iteration_proxy_value
method iteration_proxy_value (line 1686) | explicit iteration_proxy_value(IteratorType it) noexcept : anchor(...
method iteration_proxy_value (line 1689) | iteration_proxy_value& operator*()
method iteration_proxy_value (line 1695) | iteration_proxy_value& operator++()
method value (line 1744) | typename IteratorType::reference value() const
class iter_impl (line 5630) | class iter_impl
method iter_impl (line 5668) | iter_impl() = default;
method iter_impl (line 5676) | explicit iter_impl(pointer object) noexcept : m_object(object)
method iter_impl (line 5716) | iter_impl(const iter_impl<typename std::remove_const<BasicJsonType...
method iter_impl (line 5725) | iter_impl& operator=(const iter_impl<typename std::remove_const<Ba...
method set_begin (line 5737) | void set_begin() noexcept
method set_end (line 5774) | void set_end() noexcept
method reference (line 5805) | reference operator*() const
method pointer (line 5842) | pointer operator->() const
method iter_impl (line 5876) | iter_impl const operator++(int)
method iter_impl (line 5887) | iter_impl& operator++()
method iter_impl (line 5919) | iter_impl const operator--(int)
method iter_impl (line 5930) | iter_impl& operator--()
method iter_impl (line 6052) | iter_impl& operator+=(difference_type i)
method iter_impl (line 6081) | iter_impl& operator-=(difference_type i)
method iter_impl (line 6090) | iter_impl operator+(difference_type i) const
method iter_impl (line 6101) | iter_impl operator+(difference_type i, const iter_impl& it)
method iter_impl (line 6112) | iter_impl operator-(difference_type i) const
method difference_type (line 6123) | difference_type operator-(const iter_impl& other) const
method reference (line 6144) | reference operator[](difference_type n) const
method reference (line 6191) | reference value() const
class json_reverse_iterator (line 6240) | class json_reverse_iterator : public std::reverse_iterator<Base>
method json_reverse_iterator (line 6250) | explicit json_reverse_iterator(const typename base_iterator::itera...
method json_reverse_iterator (line 6254) | explicit json_reverse_iterator(const base_iterator& it) noexcept :...
method json_reverse_iterator (line 6257) | json_reverse_iterator const operator++(int)
method json_reverse_iterator (line 6263) | json_reverse_iterator& operator++()
method json_reverse_iterator (line 6269) | json_reverse_iterator const operator--(int)
method json_reverse_iterator (line 6275) | json_reverse_iterator& operator--()
method json_reverse_iterator (line 6281) | json_reverse_iterator& operator+=(difference_type i)
method json_reverse_iterator (line 6287) | json_reverse_iterator operator+(difference_type i) const
method json_reverse_iterator (line 6293) | json_reverse_iterator operator-(difference_type i) const
method difference_type (line 6299) | difference_type operator-(const json_reverse_iterator& other) const
method reference (line 6305) | reference operator[](difference_type n) const
method key (line 6311) | auto key() const -> decltype(std::declval<Base>().key())
method reference (line 6318) | reference value() const
type output_adapter_protocol (line 6344) | struct output_adapter_protocol
class output_vector_adapter (line 6357) | class output_vector_adapter : public output_adapter_protocol<CharType>
method output_vector_adapter (line 6360) | explicit output_vector_adapter(std::vector<CharType>& vec) noexcept
method write_character (line 6364) | void write_character(CharType c) override
method write_characters (line 6369) | void write_characters(const CharType* s, std::size_t length) override
class output_stream_adapter (line 6380) | class output_stream_adapter : public output_adapter_protocol<CharType>
method output_stream_adapter (line 6383) | explicit output_stream_adapter(std::basic_ostream<CharType>& s) no...
method write_character (line 6387) | void write_character(CharType c) override
method write_characters (line 6392) | void write_characters(const CharType* s, std::size_t length) override
class output_string_adapter (line 6403) | class output_string_adapter : public output_adapter_protocol<CharType>
method output_string_adapter (line 6406) | explicit output_string_adapter(StringType& s) noexcept
method write_character (line 6410) | void write_character(CharType c) override
method write_characters (line 6415) | void write_characters(const CharType* s, std::size_t length) override
class output_adapter (line 6425) | class output_adapter
method output_adapter (line 6428) | output_adapter(std::vector<CharType>& vec)
method output_adapter (line 6431) | output_adapter(std::basic_ostream<CharType>& s)
method output_adapter (line 6434) | output_adapter(StringType& s)
class binary_reader (line 6489) | class binary_reader
method binary_reader (line 6503) | explicit binary_reader(input_adapter_t adapter) : ia(std::move(ada...
method sax_parse (line 6516) | bool sax_parse(const input_format_t format,
method little_endianess (line 6576) | static constexpr bool little_endianess(int num = 1) noexcept
method parse_bson_internal (line 6590) | bool parse_bson_internal()
method get_bson_cstr (line 6615) | bool get_bson_cstr(string_t& result)
method get_bson_string (line 6647) | bool get_bson_string(const NumberType len, string_t& result)
method parse_bson_element_internal (line 6668) | bool parse_bson_element_internal(const int element_type,
method parse_bson_element_list (line 6739) | bool parse_bson_element_list(const bool is_array)
method parse_bson_array (line 6779) | bool parse_bson_array()
method parse_cbor_internal (line 6808) | bool parse_cbor_internal(const bool get_char = true)
method get_cbor_string (line 7150) | bool get_cbor_string(string_t& result)
method get_cbor_array (line 7239) | bool get_cbor_array(const std::size_t len)
method get_cbor_object (line 7275) | bool get_cbor_object(const std::size_t len)
method parse_msgpack_internal (line 7327) | bool parse_msgpack_internal()
method get_msgpack_string (line 7696) | bool get_msgpack_string(string_t& result)
method get_msgpack_array (line 7772) | bool get_msgpack_array(const std::size_t len)
method get_msgpack_object (line 7794) | bool get_msgpack_object(const std::size_t len)
method parse_ubjson_internal (line 7831) | bool parse_ubjson_internal(const bool get_char = true)
method get_ubjson_string (line 7850) | bool get_ubjson_string(string_t& result, const bool get_char = true)
method get_ubjson_size_value (line 7904) | bool get_ubjson_size_value(std::size_t& result)
method get_ubjson_size_type (line 7981) | bool get_ubjson_size_type(std::pair<std::size_t, int>& result)
method get_ubjson_value (line 8020) | bool get_ubjson_value(const int prefix)
method get_ubjson_array (line 8116) | bool get_ubjson_array()
method get_ubjson_object (line 8178) | bool get_ubjson_object()
method get (line 8263) | int get()
method get_ignore_noop (line 8272) | int get_ignore_noop()
method get_number (line 8297) | bool get_number(const input_format_t format, NumberType& result)
method get_string (line 8340) | bool get_string(const input_format_t format,
method unexpect_eof (line 8362) | bool unexpect_eof(const input_format_t format, const char* context...
method get_token_string (line 8375) | std::string get_token_string() const
method exception_message (line 8388) | std::string exception_message(const input_format_t format,
class binary_writer (line 8466) | class binary_writer
method binary_writer (line 8476) | explicit binary_writer(output_adapter_t<CharType> adapter) : oa(ad...
method write_bson (line 8485) | void write_bson(const BasicJsonType& j)
method write_cbor (line 8505) | void write_cbor(const BasicJsonType& j)
method write_msgpack (line 8749) | void write_msgpack(const BasicJsonType& j)
method write_ubjson (line 8991) | void write_ubjson(const BasicJsonType& j, const bool use_count,
method calc_bson_entry_header_size (line 9155) | static std::size_t calc_bson_entry_header_size(const string_t& name)
method write_bson_entry_header (line 9170) | void write_bson_entry_header(const string_t& name,
method write_bson_boolean (line 9182) | void write_bson_boolean(const string_t& name,
method write_bson_double (line 9192) | void write_bson_double(const string_t& name,
method calc_bson_string_size (line 9202) | static std::size_t calc_bson_string_size(const string_t& value)
method write_bson_string (line 9210) | void write_bson_string(const string_t& name,
method write_bson_null (line 9224) | void write_bson_null(const string_t& name)
method calc_bson_integer_size (line 9232) | static std::size_t calc_bson_integer_size(const std::int64_t value)
method write_bson_integer (line 9247) | void write_bson_integer(const string_t& name,
method calc_bson_unsigned_size (line 9265) | static constexpr std::size_t calc_bson_unsigned_size(const std::ui...
method write_bson_unsigned (line 9275) | void write_bson_unsigned(const string_t& name,
method write_bson_object_entry (line 9297) | void write_bson_object_entry(const string_t& name,
method calc_bson_array_size (line 9307) | static std::size_t calc_bson_array_size(const typename BasicJsonTy...
method write_bson_array (line 9323) | void write_bson_array(const string_t& name,
method calc_bson_element_size (line 9343) | static std::size_t calc_bson_element_size(const string_t& name,
method write_bson_element (line 9388) | void write_bson_element(const string_t& name,
method calc_bson_object_size (line 9431) | static std::size_t calc_bson_object_size(const typename BasicJsonT...
method write_bson_object (line 9446) | void write_bson_object(const typename BasicJsonType::object_t& value)
method CharType (line 9462) | static constexpr CharType get_cbor_float_prefix(float /*unused*/)
method CharType (line 9467) | static constexpr CharType get_cbor_float_prefix(double /*unused*/)
method CharType (line 9476) | static constexpr CharType get_msgpack_float_prefix(float /*unused*/)
method CharType (line 9481) | static constexpr CharType get_msgpack_float_prefix(double /*unused*/)
method write_number_with_ubjson_prefix (line 9493) | void write_number_with_ubjson_prefix(const NumberType n,
method write_number_with_ubjson_prefix (line 9506) | void write_number_with_ubjson_prefix(const NumberType n,
method write_number_with_ubjson_prefix (line 9559) | void write_number_with_ubjson_prefix(const NumberType n,
method CharType (line 9619) | CharType ubjson_prefix(const BasicJsonType& j) const noexcept
method CharType (line 9690) | static constexpr CharType get_ubjson_float_prefix(float /*unused*/)
method CharType (line 9695) | static constexpr CharType get_ubjson_float_prefix(double /*unused*/)
method write_number (line 9716) | void write_number(const NumberType n)
method CharType (line 9739) | static constexpr CharType to_char_type(std::uint8_t x) noexcept
method CharType (line 9746) | static CharType to_char_type(std::uint8_t x) noexcept
method CharType (line 9757) | static constexpr CharType to_char_type(std::uint8_t x) noexcept
method CharType (line 9768) | static constexpr CharType to_char_type(InputCharType x) noexcept
type dtoa_impl (line 9834) | namespace dtoa_impl
function Target (line 9838) | Target reinterpret_bits(const Source source)
type diyfp (line 9847) | struct diyfp // f * 2^e
method diyfp (line 9854) | constexpr diyfp(uint64_t f_, int e_) noexcept : f(f_), e(e_) {}
method diyfp (line 9860) | static diyfp sub(const diyfp& x, const diyfp& y) noexcept
method diyfp (line 9872) | static diyfp mul(const diyfp& x, const diyfp& y) noexcept
method diyfp (line 9937) | static diyfp normalize(diyfp x) noexcept
method diyfp (line 9954) | static diyfp normalize_to(const diyfp& x, const int target_expon...
type boundaries (line 9965) | struct boundaries
function boundaries (line 9979) | boundaries compute_boundaries(FloatType value)
type cached_power (line 10104) | struct cached_power // c = f * 2^e ~= 10^k
function cached_power (line 10118) | inline cached_power get_cached_power_for_binary_exponent(int e)
function find_largest_pow10 (line 10282) | inline int find_largest_pow10(const uint32_t n, uint32_t& pow10)
function grisu2_round (line 10338) | inline void grisu2_round(char* buf, int len, uint64_t dist, uint64...
function grisu2_digit_gen (line 10379) | inline void grisu2_digit_gen(char* buffer, int& length, int& decim...
function grisu2 (line 10619) | inline void grisu2(char* buf, int& len, int& decimal_exponent,
function grisu2 (line 10678) | void grisu2(char* buf, int& len, int& decimal_exponent, FloatType ...
type error_handler_t (line 10917) | enum class error_handler_t
class serializer (line 10925) | class serializer
method serializer (line 10940) | serializer(output_adapter_t<char> s, const char ichar,
method serializer (line 10952) | serializer(const serializer&) = delete;
method serializer (line 10953) | serializer& operator=(const serializer&) = delete;
method serializer (line 10954) | serializer(serializer&&) = delete;
method serializer (line 10955) | serializer& operator=(serializer&&) = delete;
method dump (line 10975) | void dump(const BasicJsonType& val, const bool pretty_print,
method dump_escaped (line 11182) | void dump_escaped(const string_t& s, const bool ensure_ascii)
method dump_integer (line 11427) | void dump_integer(NumberType x)
method dump_float (line 11468) | void dump_float(number_float_t x)
method dump_float (line 11489) | void dump_float(number_float_t x, std::true_type /*is_ieee_single_...
method dump_float (line 11497) | void dump_float(number_float_t x, std::false_type /*is_ieee_single...
method decode (line 11567) | static uint8_t decode(uint8_t& state, uint32_t& codep, const uint8...
class json_ref (line 11641) | class json_ref
method json_ref (line 11646) | json_ref(value_type&& value)
method json_ref (line 11650) | json_ref(const value_type& value)
method json_ref (line 11654) | json_ref(std::initializer_list<json_ref> init)
method json_ref (line 11661) | json_ref(Args && ... args)
method json_ref (line 11666) | json_ref(json_ref&&) = default;
method json_ref (line 11667) | json_ref(const json_ref&) = delete;
method json_ref (line 11668) | json_ref& operator=(const json_ref&) = delete;
method json_ref (line 11669) | json_ref& operator=(json_ref&&) = delete;
method value_type (line 11672) | value_type moved_or_copied() const
method value_type (line 11681) | value_type const& operator*() const
method value_type (line 11686) | value_type const* operator->() const
type detail (line 409) | namespace detail
type index_sequence (line 274) | struct index_sequence
method size (line 278) | static constexpr std::size_t size() noexcept
type merge_and_renumber (line 285) | struct merge_and_renumber
type make_index_sequence (line 292) | struct make_index_sequence
type make_index_sequence<0> (line 296) | struct make_index_sequence<0> : index_sequence<> {}
type make_index_sequence<1> (line 297) | struct make_index_sequence<1> : index_sequence<0> {}
type priority_tag (line 303) | struct priority_tag : priority_tag < N - 1 > {}
type priority_tag<0> (line 304) | struct priority_tag<0> {}
type static_const (line 308) | struct static_const
type make_void (line 340) | struct make_void
type iterator_types (line 356) | struct iterator_types {}
type iterator_types <
It,
void_t<typename It::difference_type, typename It::value_type, typename It::pointer,
typename It::reference, typename It::iterator_category >> (line 359) | struct iterator_types <
type iterator_traits (line 374) | struct iterator_traits
type iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >> (line 379) | struct iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >>
type iterator_traits<T*, enable_if_t<std::is_object<T>::value>> (line 385) | struct iterator_traits<T*, enable_if_t<std::is_object<T>::value>>
type nonesuch (line 411) | struct nonesuch
method nonesuch (line 413) | nonesuch() = delete;
method nonesuch (line 415) | nonesuch(nonesuch const&) = delete;
type detector (line 423) | struct detector
type is_basic_json (line 485) | struct is_basic_json : std::false_type {}
type has_from_json (line 529) | struct has_from_json : std::false_type {}
type has_from_json<BasicJsonType, T,
enable_if_t<not is_basic_json<T>::value>> (line 532) | struct has_from_json<BasicJsonType, T,
type has_non_default_from_json (line 545) | struct has_non_default_from_json : std::false_type {}
type has_non_default_from_json<BasicJsonType, T, enable_if_t<not is_basic_json<T>::value>> (line 548) | struct has_non_default_from_json<BasicJsonType, T, enable_if_t<not i...
type has_to_json (line 560) | struct has_to_json : std::false_type {}
type has_to_json<BasicJsonType, T, enable_if_t<not is_basic_json<T>::value>> (line 563) | struct has_to_json<BasicJsonType, T, enable_if_t<not is_basic_json<T...
type is_iterator_traits (line 578) | struct is_iterator_traits : std::false_type {}
type is_iterator_traits<iterator_traits<T>> (line 581) | struct is_iterator_traits<iterator_traits<T>>
type is_complete_type (line 598) | struct is_complete_type : std::false_type {}
type is_complete_type<T, decltype(void(sizeof(T)))> (line 601) | struct is_complete_type<T, decltype(void(sizeof(T)))> : std::true_ty...
type is_compatible_object_type_impl (line 605) | struct is_compatible_object_type_impl : std::false_type {}
type is_compatible_object_type_impl <
BasicJsonType, CompatibleObjectType,
enable_if_t<is_detected<mapped_type_t, CompatibleObjectType>::value and
is_detected<key_type_t, CompatibleObjectType>::value >> (line 608) | struct is_compatible_object_type_impl <
type is_compatible_object_type (line 625) | struct is_compatible_object_type
type is_constructible_object_type_impl (line 630) | struct is_constructible_object_type_impl : std::false_type {}
type is_constructible_object_type_impl <
BasicJsonType, ConstructibleObjectType,
enable_if_t<is_detected<mapped_type_t, ConstructibleObjectType>::value and
is_detected<key_type_t, ConstructibleObjectType>::value >> (line 633) | struct is_constructible_object_type_impl <
type is_constructible_object_type (line 648) | struct is_constructible_object_type
type is_compatible_string_type_impl (line 654) | struct is_compatible_string_type_impl : std::false_type {}
type is_compatible_string_type_impl <
BasicJsonType, CompatibleStringType,
enable_if_t<is_detected_exact<typename BasicJsonType::string_t::value_type,
value_type_t, CompatibleStringType>::value >> (line 657) | struct is_compatible_string_type_impl <
type is_compatible_string_type (line 667) | struct is_compatible_string_type
type is_constructible_string_type_impl (line 672) | struct is_constructible_string_type_impl : std::false_type {}
type is_constructible_string_type_impl <
BasicJsonType, ConstructibleStringType,
enable_if_t<is_detected_exact<typename BasicJsonType::string_t::value_type,
value_type_t, ConstructibleStringType>::value >> (line 675) | struct is_constructible_string_type_impl <
type is_constructible_string_type (line 686) | struct is_constructible_string_type
type is_compatible_array_type_impl (line 690) | struct is_compatible_array_type_impl : std::false_type {}
type is_compatible_array_type (line 709) | struct is_compatible_array_type
type is_constructible_array_type_impl (line 713) | struct is_constructible_array_type_impl : std::false_type {}
type is_constructible_array_type_impl <
BasicJsonType, ConstructibleArrayType,
enable_if_t<std::is_same<ConstructibleArrayType,
typename BasicJsonType::value_type>::value >> (line 716) | struct is_constructible_array_type_impl <
type is_constructible_array_type_impl <
BasicJsonType, ConstructibleArrayType,
enable_if_t<not std::is_same<ConstructibleArrayType,
typename BasicJsonType::value_type>::value and
is_detected<value_type_t, ConstructibleArrayType>::value and
is_detected<iterator_t, ConstructibleArrayType>::value and
is_complete_type<
detected_t<value_type_t, ConstructibleArrayType>>::value >> (line 723) | struct is_constructible_array_type_impl <
type is_constructible_array_type (line 748) | struct is_constructible_array_type
type is_compatible_integer_type_impl (line 753) | struct is_compatible_integer_type_impl : std::false_type {}
type is_compatible_integer_type_impl <
RealIntegerType, CompatibleNumberIntegerType,
enable_if_t<std::is_integral<RealIntegerType>::value and
std::is_integral<CompatibleNumberIntegerType>::value and
not std::is_same<bool, CompatibleNumberIntegerType>::value >> (line 756) | struct is_compatible_integer_type_impl <
type is_compatible_integer_type (line 774) | struct is_compatible_integer_type
type is_compatible_type_impl (line 779) | struct is_compatible_type_impl: std::false_type {}
type is_compatible_type_impl <
BasicJsonType, CompatibleType,
enable_if_t<is_complete_type<CompatibleType>::value >> (line 782) | struct is_compatible_type_impl <
type is_compatible_type (line 791) | struct is_compatible_type
type position_t (line 813) | struct position_t
class exception (line 869) | class exception : public std::exception
method exception (line 882) | exception(int id_, const char* what_arg) : id(id_), m(what_arg) {}
method name (line 884) | static std::string name(const std::string& ename, int id_)
class parse_error (line 938) | class parse_error : public exception
method parse_error (line 950) | static parse_error create(int id_, const position_t& pos, const st...
method parse_error (line 957) | static parse_error create(int id_, std::size_t byte_, const std::s...
method parse_error (line 977) | parse_error(int id_, std::size_t byte_, const char* what_arg)
method position_string (line 980) | static std::string position_string(const position_t& pos)
class invalid_iterator (line 1024) | class invalid_iterator : public exception
method invalid_iterator (line 1027) | static invalid_iterator create(int id_, const std::string& what_arg)
method invalid_iterator (line 1034) | invalid_iterator(int id_, const char* what_arg)
class type_error (line 1077) | class type_error : public exception
method type_error (line 1080) | static type_error create(int id_, const std::string& what_arg)
method type_error (line 1087) | type_error(int id_, const char* what_arg) : exception(id_, what_ar...
class out_of_range (line 1123) | class out_of_range : public exception
method out_of_range (line 1126) | static out_of_range create(int id_, const std::string& what_arg)
method out_of_range (line 1133) | out_of_range(int id_, const char* what_arg) : exception(id_, what_...
class other_error (line 1160) | class other_error : public exception
method other_error (line 1163) | static other_error create(int id_, const std::string& what_arg)
method other_error (line 1170) | other_error(int id_, const char* what_arg) : exception(id_, what_a...
type value_t (line 1215) | enum class value_t : std::uint8_t
function from_json (line 1285) | void from_json(const BasicJsonType& j, typename std::nullptr_t& n)
function get_arithmetic_value (line 1299) | void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val)
function from_json (line 1325) | void from_json(const BasicJsonType& j, typename BasicJsonType::boole...
function from_json (line 1335) | void from_json(const BasicJsonType& j, typename BasicJsonType::strin...
function from_json (line 1351) | void from_json(const BasicJsonType& j, ConstructibleStringType& s)
function from_json (line 1362) | void from_json(const BasicJsonType& j, typename BasicJsonType::numbe...
function from_json (line 1368) | void from_json(const BasicJsonType& j, typename BasicJsonType::numbe...
function from_json (line 1374) | void from_json(const BasicJsonType& j, typename BasicJsonType::numbe...
function from_json (line 1381) | void from_json(const BasicJsonType& j, EnumType& e)
function from_json (line 1391) | void from_json(const BasicJsonType& j, std::forward_list<T, Allocato...
function from_json (line 1407) | void from_json(const BasicJsonType& j, std::valarray<T>& l)
function from_json_array_impl (line 1418) | void from_json_array_impl(const BasicJsonType& j, typename BasicJson...
function from_json_array_impl (line 1424) | auto from_json_array_impl(const BasicJsonType& j, std::array<T, N>& ...
function from_json_array_impl (line 1435) | auto from_json_array_impl(const BasicJsonType& j, ConstructibleArray...
function from_json_array_impl (line 1454) | void from_json_array_impl(const BasicJsonType& j, ConstructibleArray...
function from_json (line 1477) | auto from_json(const BasicJsonType& j, ConstructibleArrayType& arr)
function from_json (line 1493) | void from_json(const BasicJsonType& j, ConstructibleObjectType& obj)
function from_json (line 1523) | void from_json(const BasicJsonType& j, ArithmeticType& val)
function from_json (line 1554) | void from_json(const BasicJsonType& j, std::pair<A1, A2>& p)
function from_json_tuple_impl (line 1560) | void from_json_tuple_impl(const BasicJsonType& j, Tuple& t, index_se...
function from_json (line 1566) | void from_json(const BasicJsonType& j, std::tuple<Args...>& t)
function from_json (line 1574) | void from_json(const BasicJsonType& j, std::map<Key, Value, Compare,...
function from_json (line 1593) | void from_json(const BasicJsonType& j, std::unordered_map<Key, Value...
type from_json_fn (line 1609) | struct from_json_fn
class iteration_proxy_value (line 1664) | class iteration_proxy_value
method iteration_proxy_value (line 1686) | explicit iteration_proxy_value(IteratorType it) noexcept : anchor(...
method iteration_proxy_value (line 1689) | iteration_proxy_value& operator*()
method iteration_proxy_value (line 1695) | iteration_proxy_value& operator++()
method value (line 1744) | typename IteratorType::reference value() const
class iteration_proxy (line 1751) | class iteration_proxy
method iteration_proxy (line 1759) | explicit iteration_proxy(typename IteratorType::reference cont) no...
method begin (line 1763) | iteration_proxy_value<IteratorType> begin() noexcept
method end (line 1769) | iteration_proxy_value<IteratorType> end() noexcept
function get (line 1778) | auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>...
function get (line 1786) | auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>...
type external_constructor (line 1821) | struct external_constructor
type external_constructor<value_t::boolean> (line 1824) | struct external_constructor<value_t::boolean>
method construct (line 1827) | static void construct(BasicJsonType& j, typename BasicJsonType::bo...
type external_constructor<value_t::string> (line 1836) | struct external_constructor<value_t::string>
method construct (line 1839) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
method construct (line 1847) | static void construct(BasicJsonType& j, typename BasicJsonType::st...
method construct (line 1857) | static void construct(BasicJsonType& j, const CompatibleStringType...
type external_constructor<value_t::number_float> (line 1866) | struct external_constructor<value_t::number_float>
method construct (line 1869) | static void construct(BasicJsonType& j, typename BasicJsonType::nu...
type external_constructor<value_t::number_unsigned> (line 1878) | struct external_constructor<value_t::number_unsigned>
method construct (line 1881) | static void construct(BasicJsonType& j, typename BasicJsonType::nu...
type external_constructor<value_t::number_integer> (line 1890) | struct external_constructor<value_t::number_integer>
method construct (line 1893) | static void construct(BasicJsonType& j, typename BasicJsonType::nu...
type external_constructor<value_t::array> (line 1902) | struct external_constructor<value_t::array>
method construct (line 1905) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
method construct (line 1913) | static void construct(BasicJsonType& j, typename BasicJsonType::ar...
method construct (line 1923) | static void construct(BasicJsonType& j, const CompatibleArrayType&...
method construct (line 1933) | static void construct(BasicJsonType& j, const std::vector<bool>& arr)
method construct (line 1947) | static void construct(BasicJsonType& j, const std::valarray<T>& arr)
type external_constructor<value_t::object> (line 1958) | struct external_constructor<value_t::object>
method construct (line 1961) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
method construct (line 1969) | static void construct(BasicJsonType& j, typename BasicJsonType::ob...
method construct (line 1978) | static void construct(BasicJsonType& j, const CompatibleObjectType...
function to_json (line 1995) | void to_json(BasicJsonType& j, T b) noexcept
function to_json (line 2002) | void to_json(BasicJsonType& j, const CompatibleString& s)
function to_json (line 2008) | void to_json(BasicJsonType& j, typename BasicJsonType::string_t&& s)
function to_json (line 2015) | void to_json(BasicJsonType& j, FloatType val) noexcept
function to_json (line 2022) | void to_json(BasicJsonType& j, CompatibleNumberUnsignedType val) noe...
function to_json (line 2029) | void to_json(BasicJsonType& j, CompatibleNumberIntegerType val) noex...
function to_json (line 2036) | void to_json(BasicJsonType& j, EnumType e) noexcept
function to_json (line 2043) | void to_json(BasicJsonType& j, const std::vector<bool>& e)
function to_json (line 2056) | void to_json(BasicJsonType& j, const CompatibleArrayType& arr)
function to_json (line 2063) | void to_json(BasicJsonType& j, const std::valarray<T>& arr)
function to_json (line 2069) | void to_json(BasicJsonType& j, typename BasicJsonType::array_t&& arr)
function to_json (line 2076) | void to_json(BasicJsonType& j, const CompatibleObjectType& obj)
function to_json (line 2082) | void to_json(BasicJsonType& j, typename BasicJsonType::object_t&& obj)
function to_json (line 2092) | void to_json(BasicJsonType& j, const T(&arr)[N])
function to_json (line 2098) | void to_json(BasicJsonType& j, const std::pair<Args...>& p)
function to_json (line 2106) | void to_json(BasicJsonType& j, const T& b)
function to_json_tuple_impl (line 2112) | void to_json_tuple_impl(BasicJsonType& j, const Tuple& t, index_sequ...
function to_json (line 2118) | void to_json(BasicJsonType& j, const std::tuple<Args...>& t)
type to_json_fn (line 2123) | struct to_json_fn
type input_format_t (line 2164) | enum class input_format_t { json, cbor, msgpack, ubjson, bson }
type input_adapter_protocol (line 2181) | struct input_adapter_protocol
class file_input_adapter (line 2195) | class file_input_adapter : public input_adapter_protocol
method file_input_adapter (line 2198) | explicit file_input_adapter(std::FILE* f) noexcept
method get_character (line 2202) | std::char_traits<char>::int_type get_character() noexcept override
class input_stream_adapter (line 2221) | class input_stream_adapter : public input_adapter_protocol
method input_stream_adapter (line 2231) | explicit input_stream_adapter(std::istream& i)
method input_stream_adapter (line 2236) | input_stream_adapter(const input_stream_adapter&) = delete;
method input_stream_adapter (line 2237) | input_stream_adapter& operator=(input_stream_adapter&) = delete;
method input_stream_adapter (line 2238) | input_stream_adapter(input_stream_adapter&&) = delete;
method input_stream_adapter (line 2239) | input_stream_adapter& operator=(input_stream_adapter&&) = delete;
method get_character (line 2244) | std::char_traits<char>::int_type get_character() override
class input_buffer_adapter (line 2262) | class input_buffer_adapter : public input_adapter_protocol
method input_buffer_adapter (line 2265) | input_buffer_adapter(const char* b, const std::size_t l) noexcept
method input_buffer_adapter (line 2270) | input_buffer_adapter(const input_buffer_adapter&) = delete;
method input_buffer_adapter (line 2271) | input_buffer_adapter& operator=(input_buffer_adapter&) = delete;
method input_buffer_adapter (line 2272) | input_buffer_adapter(input_buffer_adapter&&) = delete;
method input_buffer_adapter (line 2273) | input_buffer_adapter& operator=(input_buffer_adapter&&) = delete;
method get_character (line 2276) | std::char_traits<char>::int_type get_character() noexcept override
type wide_string_input_helper (line 2294) | struct wide_string_input_helper
method fill_buffer (line 2297) | static void fill_buffer(const WideStringType& str, size_t& current...
type wide_string_input_helper<WideStringType, 2> (line 2349) | struct wide_string_input_helper<WideStringType, 2>
method fill_buffer (line 2352) | static void fill_buffer(const WideStringType& str, size_t& current...
class wide_string_input_adapter (line 2410) | class wide_string_input_adapter : public input_adapter_protocol
method wide_string_input_adapter (line 2413) | explicit wide_string_input_adapter(const WideStringType& w) noexcept
method get_character (line 2417) | std::char_traits<char>::int_type get_character() noexcept override
method fill_buffer (line 2436) | void fill_buffer()
class input_adapter (line 2456) | class input_adapter
method input_adapter (line 2460) | input_adapter(std::FILE* file)
method input_adapter (line 2463) | input_adapter(std::istream& i)
method input_adapter (line 2467) | input_adapter(std::istream&& i)
method input_adapter (line 2470) | input_adapter(const std::wstring& ws)
method input_adapter (line 2473) | input_adapter(const std::u16string& ws)
method input_adapter (line 2476) | input_adapter(const std::u32string& ws)
method input_adapter (line 2486) | input_adapter(CharT b, std::size_t l)
method input_adapter (line 2498) | input_adapter(CharT b)
method input_adapter (line 2507) | input_adapter(IteratorType first, IteratorType last)
method input_adapter (line 2542) | input_adapter(T (&array)[N])
method input_adapter (line 2550) | input_adapter(const ContiguousContainer& c)
class lexer (line 2597) | class lexer
type token_type (line 2606) | enum class token_type
method lexer (line 2671) | explicit lexer(detail::input_adapter_t&& adapter)
method lexer (line 2675) | lexer(const lexer&) = delete;
method lexer (line 2676) | lexer(lexer&&) = delete;
method lexer (line 2677) | lexer& operator=(lexer&) = delete;
method lexer (line 2678) | lexer& operator=(lexer&&) = delete;
method get_decimal_point (line 2687) | static char get_decimal_point() noexcept
method get_codepoint (line 2713) | int get_codepoint()
method next_byte_in_range (line 2761) | bool next_byte_in_range(std::initializer_list<int> ranges)
method token_type (line 2798) | token_type scan_string()
method strtof (line 3384) | static void strtof(float& f, const char* str, char** endptr) noexcept
method strtof (line 3389) | static void strtof(double& f, const char* str, char** endptr) noex...
method strtof (line 3394) | static void strtof(long double& f, const char* str, char** endptr)...
method token_type (line 3439) | token_type scan_number() // lgtm [cpp/use-of-goto]
method token_type (line 3773) | token_type scan_literal(const char* literal_text, const std::size_...
method reset (line 3793) | void reset() noexcept
method get (line 3810) | std::char_traits<char>::int_type get()
method unget (line 3847) | void unget()
method add (line 3874) | void add(int c)
method number_integer_t (line 3885) | constexpr number_integer_t get_number_integer() const noexcept
method number_unsigned_t (line 3891) | constexpr number_unsigned_t get_number_unsigned() const noexcept
method number_float_t (line 3897) | constexpr number_float_t get_number_float() const noexcept
method string_t (line 3903) | string_t& get_string()
method position_t (line 3913) | constexpr position_t get_position() const noexcept
method get_token_string (line 3921) | std::string get_token_string() const
method skip_bom (line 3958) | bool skip_bom()
method token_type (line 3972) | token_type scan()
type is_sax (line 4152) | struct is_sax
type is_sax_static_asserts (line 4184) | struct is_sax_static_asserts
class json_sax_dom_parser (line 4382) | class json_sax_dom_parser
method json_sax_dom_parser (line 4395) | explicit json_sax_dom_parser(BasicJsonType& r, const bool allow_ex...
method null (line 4399) | bool null()
method boolean (line 4405) | bool boolean(bool val)
method number_integer (line 4411) | bool number_integer(number_integer_t val)
method number_unsigned (line 4417) | bool number_unsigned(number_unsigned_t val)
method number_float (line 4423) | bool number_float(number_float_t val, const string_t& /*unused*/)
method string (line 4429) | bool string(string_t& val)
method start_object (line 4435) | bool start_object(std::size_t len)
method key (line 4448) | bool key(string_t& val)
method end_object (line 4455) | bool end_object()
method start_array (line 4461) | bool start_array(std::size_t len)
method end_array (line 4474) | bool end_array()
method parse_error (line 4480) | bool parse_error(std::size_t /*unused*/, const std::string& /*unus...
method is_errored (line 4508) | constexpr bool is_errored() const
method BasicJsonType (line 4521) | BasicJsonType* handle_value(Value&& v)
class json_sax_dom_callback_parser (line 4557) | class json_sax_dom_callback_parser
method json_sax_dom_callback_parser (line 4567) | json_sax_dom_callback_parser(BasicJsonType& r,
method null (line 4575) | bool null()
method boolean (line 4581) | bool boolean(bool val)
method number_integer (line 4587) | bool number_integer(number_integer_t val)
method number_unsigned (line 4593) | bool number_unsigned(number_unsigned_t val)
method number_float (line 4599) | bool number_float(number_float_t val, const string_t& /*unused*/)
method string (line 4605) | bool string(string_t& val)
method start_object (line 4611) | bool start_object(std::size_t len)
method key (line 4633) | bool key(string_t& val)
method end_object (line 4650) | bool end_object()
method start_array (line 4685) | bool start_array(std::size_t len)
method end_array (line 4706) | bool end_array()
method parse_error (line 4737) | bool parse_error(std::size_t /*unused*/, const std::string& /*unus...
method is_errored (line 4765) | constexpr bool is_errored() const
method handle_value (line 4787) | std::pair<bool, BasicJsonType*> handle_value(Value&& v, const bool...
class json_sax_acceptor (line 4870) | class json_sax_acceptor
method null (line 4878) | bool null()
method boolean (line 4883) | bool boolean(bool /*unused*/)
method number_integer (line 4888) | bool number_integer(number_integer_t /*unused*/)
method number_unsigned (line 4893) | bool number_unsigned(number_unsigned_t /*unused*/)
method number_float (line 4898) | bool number_float(number_float_t /*unused*/, const string_t& /*unu...
method string (line 4903) | bool string(string_t& /*unused*/)
method start_object (line 4908) | bool start_object(std::size_t /*unused*/ = std::size_t(-1))
method key (line 4913) | bool key(string_t& /*unused*/)
method end_object (line 4918) | bool end_object()
method start_array (line 4923) | bool start_array(std::size_t /*unused*/ = std::size_t(-1))
method end_array (line 4928) | bool end_array()
method parse_error (line 4933) | bool parse_error(std::size_t /*unused*/, const std::string& /*unus...
class parser (line 4961) | class parser
type parse_event_t (line 4971) | enum class parse_event_t : uint8_t
method parser (line 4991) | explicit parser(detail::input_adapter_t&& adapter,
method parse (line 5010) | void parse(const bool strict, BasicJsonType& result)
method accept (line 5071) | bool accept(const bool strict = true)
method sax_parse (line 5078) | bool sax_parse(SAX* sax, const bool strict = true)
method sax_parse_internal (line 5097) | bool sax_parse_internal(SAX* sax)
method token_type (line 5388) | token_type get_token()
method exception_message (line 5393) | std::string exception_message(const token_type expected, const std...
class primitive_iterator_t (line 5454) | class primitive_iterator_t
method difference_type (line 5465) | constexpr difference_type get_value() const noexcept
method set_begin (line 5471) | void set_begin() noexcept
method set_end (line 5477) | void set_end() noexcept
method is_begin (line 5483) | constexpr bool is_begin() const noexcept
method is_end (line 5489) | constexpr bool is_end() const noexcept
method primitive_iterator_t (line 5504) | primitive_iterator_t operator+(difference_type n) noexcept
method difference_type (line 5511) | constexpr difference_type operator-(primitive_iterator_t lhs, prim...
method primitive_iterator_t (line 5516) | primitive_iterator_t& operator++() noexcept
method primitive_iterator_t (line 5522) | primitive_iterator_t const operator++(int) noexcept
method primitive_iterator_t (line 5529) | primitive_iterator_t& operator--() noexcept
method primitive_iterator_t (line 5535) | primitive_iterator_t const operator--(int) noexcept
method primitive_iterator_t (line 5542) | primitive_iterator_t& operator+=(difference_type n) noexcept
method primitive_iterator_t (line 5548) | primitive_iterator_t& operator-=(difference_type n) noexcept
type internal_iterator (line 5573) | struct internal_iterator
class iteration_proxy (line 5610) | class iteration_proxy
method iteration_proxy (line 1759) | explicit iteration_proxy(typename IteratorType::reference cont) no...
method begin (line 1763) | iteration_proxy_value<IteratorType> begin() noexcept
method end (line 1769) | iteration_proxy_value<IteratorType> end() noexcept
class iteration_proxy_value (line 5611) | class iteration_proxy_value
method iteration_proxy_value (line 1686) | explicit iteration_proxy_value(IteratorType it) noexcept : anchor(...
method iteration_proxy_value (line 1689) | iteration_proxy_value& operator*()
method iteration_proxy_value (line 1695) | iteration_proxy_value& operator++()
method value (line 1744) | typename IteratorType::reference value() const
class iter_impl (line 5630) | class iter_impl
method iter_impl (line 5668) | iter_impl() = default;
method iter_impl (line 5676) | explicit iter_impl(pointer object) noexcept : m_object(object)
method iter_impl (line 5716) | iter_impl(const iter_impl<typename std::remove_const<BasicJsonType...
method iter_impl (line 5725) | iter_impl& operator=(const iter_impl<typename std::remove_const<Ba...
method set_begin (line 5737) | void set_begin() noexcept
method set_end (line 5774) | void set_end() noexcept
method reference (line 5805) | reference operator*() const
method pointer (line 5842) | pointer operator->() const
method iter_impl (line 5876) | iter_impl const operator++(int)
method iter_impl (line 5887) | iter_impl& operator++()
method iter_impl (line 5919) | iter_impl const operator--(int)
method iter_impl (line 5930) | iter_impl& operator--()
method iter_impl (line 6052) | iter_impl& operator+=(difference_type i)
method iter_impl (line 6081) | iter_impl& operator-=(difference_type i)
method iter_impl (line 6090) | iter_impl operator+(difference_type i) const
method iter_impl (line 6101) | iter_impl operator+(difference_type i, const iter_impl& it)
method iter_impl (line 6112) | iter_impl operator-(difference_type i) const
method difference_type (line 6123) | difference_type operator-(const iter_impl& other) const
method reference (line 6144) | reference operator[](difference_type n) const
method reference (line 6191) | reference value() const
class json_reverse_iterator (line 6240) | class json_reverse_iterator : public std::reverse_iterator<Base>
method json_reverse_iterator (line 6250) | explicit json_reverse_iterator(const typename base_iterator::itera...
method json_reverse_iterator (line 6254) | explicit json_reverse_iterator(const base_iterator& it) noexcept :...
method json_reverse_iterator (line 6257) | json_reverse_iterator const operator++(int)
method json_reverse_iterator (line 6263) | json_reverse_iterator& operator++()
method json_reverse_iterator (line 6269) | json_reverse_iterator const operator--(int)
method json_reverse_iterator (line 6275) | json_reverse_iterator& operator--()
method json_reverse_iterator (line 6281) | json_reverse_iterator& operator+=(difference_type i)
method json_reverse_iterator (line 6287) | json_reverse_iterator operator+(difference_type i) const
method json_reverse_iterator (line 6293) | json_reverse_iterator operator-(difference_type i) const
method difference_type (line 6299) | difference_type operator-(const json_reverse_iterator& other) const
method reference (line 6305) | reference operator[](difference_type n) const
method key (line 6311) | auto key() const -> decltype(std::declval<Base>().key())
method reference (line 6318) | reference value() const
type output_adapter_protocol (line 6344) | struct output_adapter_protocol
class output_vector_adapter (line 6357) | class output_vector_adapter : public output_adapter_protocol<CharType>
method output_vector_adapter (line 6360) | explicit output_vector_adapter(std::vector<CharType>& vec) noexcept
method write_character (line 6364) | void write_character(CharType c) override
method write_characters (line 6369) | void write_characters(const CharType* s, std::size_t length) override
class output_stream_adapter (line 6380) | class output_stream_adapter : public output_adapter_protocol<CharType>
method output_stream_adapter (line 6383) | explicit output_stream_adapter(std::basic_ostream<CharType>& s) no...
method write_character (line 6387) | void write_character(CharType c) override
method write_characters (line 6392) | void write_characters(const CharType* s, std::size_t length) override
class output_string_adapter (line 6403) | class output_string_adapter : public output_adapter_protocol<CharType>
method output_string_adapter (line 6406) | explicit output_string_adapter(StringType& s) noexcept
method write_character (line 6410) | void write_character(CharType c) override
method write_characters (line 6415) | void write_characters(const CharType* s, std::size_t length) override
class output_adapter (line 6425) | class output_adapter
method output_adapter (line 6428) | output_adapter(std::vector<CharType>& vec)
method output_adapter (line 6431) | output_adapter(std::basic_ostream<CharType>& s)
method output_adapter (line 6434) | output_adapter(StringType& s)
class binary_reader (line 6489) | class binary_reader
method binary_reader (line 6503) | explicit binary_reader(input_adapter_t adapter) : ia(std::move(ada...
method sax_parse (line 6516) | bool sax_parse(const input_format_t format,
method little_endianess (line 6576) | static constexpr bool little_endianess(int num = 1) noexcept
method parse_bson_internal (line 6590) | bool parse_bson_internal()
method get_bson_cstr (line 6615) | bool get_bson_cstr(string_t& result)
method get_bson_string (line 6647) | bool get_bson_string(const NumberType len, string_t& result)
method parse_bson_element_internal (line 6668) | bool parse_bson_element_internal(const int element_type,
method parse_bson_element_list (line 6739) | bool parse_bson_element_list(const bool is_array)
method parse_bson_array (line 6779) | bool parse_bson_array()
method parse_cbor_internal (line 6808) | bool parse_cbor_internal(const bool get_char = true)
method get_cbor_string (line 7150) | bool get_cbor_string(string_t& result)
method get_cbor_array (line 7239) | bool get_cbor_array(const std::size_t len)
method get_cbor_object (line 7275) | bool get_cbor_object(const std::size_t len)
method parse_msgpack_internal (line 7327) | bool parse_msgpack_internal()
method get_msgpack_string (line 7696) | bool get_msgpack_string(string_t& result)
method get_msgpack_array (line 7772) | bool get_msgpack_array(const std::size_t len)
method get_msgpack_object (line 7794) | bool get_msgpack_object(const std::size_t len)
method parse_ubjson_internal (line 7831) | bool parse_ubjson_internal(const bool get_char = true)
method get_ubjson_string (line 7850) | bool get_ubjson_string(string_t& result, const bool get_char = true)
method get_ubjson_size_value (line 7904) | bool get_ubjson_size_value(std::size_t& result)
method get_ubjson_size_type (line 7981) | bool get_ubjson_size_type(std::pair<std::size_t, int>& result)
method get_ubjson_value (line 8020) | bool get_ubjson_value(const int prefix)
method get_ubjson_array (line 8116) | bool get_ubjson_array()
method get_ubjson_object (line 8178) | bool get_ubjson_object()
method get (line 8263) | int get()
method get_ignore_noop (line 8272) | int get_ignore_noop()
method get_number (line 8297) | bool get_number(const input_format_t format, NumberType& result)
method get_string (line 8340) | bool get_string(const input_format_t format,
method unexpect_eof (line 8362) | bool unexpect_eof(const input_format_t format, const char* context...
method get_token_string (line 8375) | std::string get_token_string() const
method exception_message (line 8388) | std::string exception_message(const input_format_t format,
class binary_writer (line 8466) | class binary_writer
method binary_writer (line 8476) | explicit binary_writer(output_adapter_t<CharType> adapter) : oa(ad...
method write_bson (line 8485) | void write_bson(const BasicJsonType& j)
method write_cbor (line 8505) | void write_cbor(const BasicJsonType& j)
method write_msgpack (line 8749) | void write_msgpack(const BasicJsonType& j)
method write_ubjson (line 8991) | void write_ubjson(const BasicJsonType& j, const bool use_count,
method calc_bson_entry_header_size (line 9155) | static std::size_t calc_bson_entry_header_size(const string_t& name)
method write_bson_entry_header (line 9170) | void write_bson_entry_header(const string_t& name,
method write_bson_boolean (line 9182) | void write_bson_boolean(const string_t& name,
method write_bson_double (line 9192) | void write_bson_double(const string_t& name,
method calc_bson_string_size (line 9202) | static std::size_t calc_bson_string_size(const string_t& value)
method write_bson_string (line 9210) | void write_bson_string(const string_t& name,
method write_bson_null (line 9224) | void write_bson_null(const string_t& name)
method calc_bson_integer_size (line 9232) | static std::size_t calc_bson_integer_size(const std::int64_t value)
method write_bson_integer (line 9247) | void write_bson_integer(const string_t& name,
method calc_bson_unsigned_size (line 9265) | static constexpr std::size_t calc_bson_unsigned_size(const std::ui...
method write_bson_unsigned (line 9275) | void write_bson_unsigned(const string_t& name,
method write_bson_object_entry (line 9297) | void write_bson_object_entry(const string_t& name,
method calc_bson_array_size (line 9307) | static std::size_t calc_bson_array_size(const typename BasicJsonTy...
method write_bson_array (line 9323) | void write_bson_array(const string_t& name,
method calc_bson_element_size (line 9343) | static std::size_t calc_bson_element_size(const string_t& name,
method write_bson_element (line 9388) | void write_bson_element(const string_t& name,
method calc_bson_object_size (line 9431) | static std::size_t calc_bson_object_size(const typename BasicJsonT...
method write_bson_object (line 9446) | void write_bson_object(const typename BasicJsonType::object_t& value)
method CharType (line 9462) | static constexpr CharType get_cbor_float_prefix(float /*unused*/)
method CharType (line 9467) | static constexpr CharType get_cbor_float_prefix(double /*unused*/)
method CharType (line 9476) | static constexpr CharType get_msgpack_float_prefix(float /*unused*/)
method CharType (line 9481) | static constexpr CharType get_msgpack_float_prefix(double /*unused*/)
method write_number_with_ubjson_prefix (line 9493) | void write_number_with_ubjson_prefix(const NumberType n,
method write_number_with_ubjson_prefix (line 9506) | void write_number_with_ubjson_prefix(const NumberType n,
method write_number_with_ubjson_prefix (line 9559) | void write_number_with_ubjson_prefix(const NumberType n,
method CharType (line 9619) | CharType ubjson_prefix(const BasicJsonType& j) const noexcept
method CharType (line 9690) | static constexpr CharType get_ubjson_float_prefix(float /*unused*/)
method CharType (line 9695) | static constexpr CharType get_ubjson_float_prefix(double /*unused*/)
method write_number (line 9716) | void write_number(const NumberType n)
method CharType (line 9739) | static constexpr CharType to_char_type(std::uint8_t x) noexcept
method CharType (line 9746) | static CharType to_char_type(std::uint8_t x) noexcept
method CharType (line 9757) | static constexpr CharType to_char_type(std::uint8_t x) noexcept
method CharType (line 9768) | static constexpr CharType to_char_type(InputCharType x) noexcept
type dtoa_impl (line 9834) | namespace dtoa_impl
function Target (line 9838) | Target reinterpret_bits(const Source source)
type diyfp (line 9847) | struct diyfp // f * 2^e
method diyfp (line 9854) | constexpr diyfp(uint64_t f_, int e_) noexcept : f(f_), e(e_) {}
method diyfp (line 9860) | static diyfp sub(const diyfp& x, const diyfp& y) noexcept
method diyfp (line 9872) | static diyfp mul(const diyfp& x, const diyfp& y) noexcept
method diyfp (line 9937) | static diyfp normalize(diyfp x) noexcept
method diyfp (line 9954) | static diyfp normalize_to(const diyfp& x, const int target_expon...
type boundaries (line 9965) | struct boundaries
function boundaries (line 9979) | boundaries compute_boundaries(FloatType value)
type cached_power (line 10104) | struct cached_power // c = f * 2^e ~= 10^k
function cached_power (line 10118) | inline cached_power get_cached_power_for_binary_exponent(int e)
function find_largest_pow10 (line 10282) | inline int find_largest_pow10(const uint32_t n, uint32_t& pow10)
function grisu2_round (line 10338) | inline void grisu2_round(char* buf, int len, uint64_t dist, uint64...
function grisu2_digit_gen (line 10379) | inline void grisu2_digit_gen(char* buffer, int& length, int& decim...
function grisu2 (line 10619) | inline void grisu2(char* buf, int& len, int& decimal_exponent,
function grisu2 (line 10678) | void grisu2(char* buf, int& len, int& decimal_exponent, FloatType ...
type error_handler_t (line 10917) | enum class error_handler_t
class serializer (line 10925) | class serializer
method serializer (line 10940) | serializer(output_adapter_t<char> s, const char ichar,
method serializer (line 10952) | serializer(const serializer&) = delete;
method serializer (line 10953) | serializer& operator=(const serializer&) = delete;
method serializer (line 10954) | serializer(serializer&&) = delete;
method serializer (line 10955) | serializer& operator=(serializer&&) = delete;
method dump (line 10975) | void dump(const BasicJsonType& val, const bool pretty_print,
method dump_escaped (line 11182) | void dump_escaped(const string_t& s, const bool ensure_ascii)
method dump_integer (line 11427) | void dump_integer(NumberType x)
method dump_float (line 11468) | void dump_float(number_float_t x)
method dump_float (line 11489) | void dump_float(number_float_t x, std::true_type /*is_ieee_single_...
method dump_float (line 11497) | void dump_float(number_float_t x, std::false_type /*is_ieee_single...
method decode (line 11567) | static uint8_t decode(uint8_t& state, uint32_t& codep, const uint8...
class json_ref (line 11641) | class json_ref
method json_ref (line 11646) | json_ref(value_type&& value)
method json_ref (line 11650) | json_ref(const value_type& value)
method json_ref (line 11654) | json_ref(std::initializer_list<json_ref> init)
method json_ref (line 11661) | json_ref(Args && ... args)
method json_ref (line 11666) | json_ref(json_ref&&) = default;
method json_ref (line 11667) | json_ref(const json_ref&) = delete;
method json_ref (line 11668) | json_ref& operator=(const json_ref&) = delete;
method json_ref (line 11669) | json_ref& operator=(json_ref&&) = delete;
method value_type (line 11672) | value_type moved_or_copied() const
method value_type (line 11681) | value_type const& operator*() const
method value_type (line 11686) | value_type const* operator->() const
type detail (line 470) | namespace detail
type index_sequence (line 274) | struct index_sequence
method size (line 278) | static constexpr std::size_t size() noexcept
type merge_and_renumber (line 285) | struct merge_and_renumber
type make_index_sequence (line 292) | struct make_index_sequence
type make_index_sequence<0> (line 296) | struct make_index_sequence<0> : index_sequence<> {}
type make_index_sequence<1> (line 297) | struct make_index_sequence<1> : index_sequence<0> {}
type priority_tag (line 303) | struct priority_tag : priority_tag < N - 1 > {}
type priority_tag<0> (line 304) | struct priority_tag<0> {}
type static_const (line 308) | struct static_const
type make_void (line 340) | struct make_void
type iterator_types (line 356) | struct iterator_types {}
type iterator_types <
It,
void_t<typename It::difference_type, typename It::value_type, typename It::pointer,
typename It::reference, typename It::iterator_category >> (line 359) | struct iterator_types <
type iterator_traits (line 374) | struct iterator_traits
type iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >> (line 379) | struct iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >>
type iterator_traits<T*, enable_if_t<std::is_object<T>::value>> (line 385) | struct iterator_traits<T*, enable_if_t<std::is_object<T>::value>>
type nonesuch (line 411) | struct nonesuch
method nonesuch (line 413) | nonesuch() = delete;
method nonesuch (line 415) | nonesuch(nonesuch const&) = delete;
type detector (line 423) | struct detector
type is_basic_json (line 485) | struct is_basic_json : std::false_type {}
type has_from_json (line 529) | struct has_from_json : std::false_type {}
type has_from_json<BasicJsonType, T,
enable_if_t<not is_basic_json<T>::value>> (line 532) | struct has_from_json<BasicJsonType, T,
type has_non_default_from_json (line 545) | struct has_non_default_from_json : std::false_type {}
type has_non_default_from_json<BasicJsonType, T, enable_if_t<not is_basic_json<T>::value>> (line 548) | struct has_non_default_from_json<BasicJsonType, T, enable_if_t<not i...
type has_to_json (line 560) | struct has_to_json : std::false_type {}
type has_to_json<BasicJsonType, T, enable_if_t<not is_basic_json<T>::value>> (line 563) | struct has_to_json<BasicJsonType, T, enable_if_t<not is_basic_json<T...
type is_iterator_traits (line 578) | struct is_iterator_traits : std::false_type {}
type is_iterator_traits<iterator_traits<T>> (line 581) | struct is_iterator_traits<iterator_traits<T>>
type is_complete_type (line 598) | struct is_complete_type : std::false_type {}
type is_complete_type<T, decltype(void(sizeof(T)))> (line 601) | struct is_complete_type<T, decltype(void(sizeof(T)))> : std::true_ty...
type is_compatible_object_type_impl (line 605) | struct is_compatible_object_type_impl : std::false_type {}
type is_compatible_object_type_impl <
BasicJsonType, CompatibleObjectType,
enable_if_t<is_detected<mapped_type_t, CompatibleObjectType>::value and
is_detected<key_type_t, CompatibleObjectType>::value >> (line 608) | struct is_compatible_object_type_impl <
type is_compatible_object_type (line 625) | struct is_compatible_object_type
type is_constructible_object_type_impl (line 630) | struct is_constructible_object_type_impl : std::false_type {}
type is_constructible_object_type_impl <
BasicJsonType, ConstructibleObjectType,
enable_if_t<is_detected<mapped_type_t, ConstructibleObjectType>::value and
is_detected<key_type_t, ConstructibleObjectType>::value >> (line 633) | struct is_constructible_object_type_impl <
type is_constructible_object_type (line 648) | struct is_constructible_object_type
type is_compatible_string_type_impl (line 654) | struct is_compatible_string_type_impl : std::false_type {}
type is_compatible_string_type_impl <
BasicJsonType, CompatibleStringType,
enable_if_t<is_detected_exact<typename BasicJsonType::string_t::value_type,
value_type_t, CompatibleStringType>::value >> (line 657) | struct is_compatible_string_type_impl <
type is_compatible_string_type (line 667) | struct is_compatible_string_type
type is_constructible_string_type_impl (line 672) | struct is_constructible_string_type_impl : std::false_type {}
type is_constructible_string_type_impl <
BasicJsonType, ConstructibleStringType,
enable_if_t<is_detected_exact<typename BasicJsonType::string_t::value_type,
value_type_t, ConstructibleStringType>::value >> (line 675) | struct is_constructible_string_type_impl <
type is_constructible_string_type (line 686) | struct is_constructible_string_type
type is_compatible_array_type_impl (line 690) | struct is_compatible_array_type_impl : std::false_type {}
type is_compatible_array_type (line 709) | struct is_compatible_array_type
type is_constructible_array_type_impl (line 713) | struct is_constructible_array_type_impl : std::false_type {}
type is_constructible_array_type_impl <
BasicJsonType, ConstructibleArrayType,
enable_if_t<std::is_same<ConstructibleArrayType,
typename BasicJsonType::value_type>::value >> (line 716) | struct is_constructible_array_type_impl <
type is_constructible_array_type_impl <
BasicJsonType, ConstructibleArrayType,
enable_if_t<not std::is_same<ConstructibleArrayType,
typename BasicJsonType::value_type>::value and
is_detected<value_type_t, ConstructibleArrayType>::value and
is_detected<iterator_t, ConstructibleArrayType>::value and
is_complete_type<
detected_t<value_type_t, ConstructibleArrayType>>::value >> (line 723) | struct is_constructible_array_type_impl <
type is_constructible_array_type (line 748) | struct is_constructible_array_type
type is_compatible_integer_type_impl (line 753) | struct is_compatible_integer_type_impl : std::false_type {}
type is_compatible_integer_type_impl <
RealIntegerType, CompatibleNumberIntegerType,
enable_if_t<std::is_integral<RealIntegerType>::value and
std::is_integral<CompatibleNumberIntegerType>::value and
not std::is_same<bool, CompatibleNumberIntegerType>::value >> (line 756) | struct is_compatible_integer_type_impl <
type is_compatible_integer_type (line 774) | struct is_compatible_integer_type
type is_compatible_type_impl (line 779) | struct is_compatible_type_impl: std::false_type {}
type is_compatible_type_impl <
BasicJsonType, CompatibleType,
enable_if_t<is_complete_type<CompatibleType>::value >> (line 782) | struct is_compatible_type_impl <
type is_compatible_type (line 791) | struct is_compatible_type
type position_t (line 813) | struct position_t
class exception (line 869) | class exception : public std::exception
method exception (line 882) | exception(int id_, const char* what_arg) : id(id_), m(what_arg) {}
method name (line 884) | static std::string name(const std::string& ename, int id_)
class parse_error (line 938) | class parse_error : public exception
method parse_error (line 950) | static parse_error create(int id_, const position_t& pos, const st...
method parse_error (line 957) | static parse_error create(int id_, std::size_t byte_, const std::s...
method parse_error (line 977) | parse_error(int id_, std::size_t byte_, const char* what_arg)
method position_string (line 980) | static std::string position_string(const position_t& pos)
class invalid_iterator (line 1024) | class invalid_iterator : public exception
method invalid_iterator (line 1027) | static invalid_iterator create(int id_, const std::string& what_arg)
method invalid_iterator (line 1034) | invalid_iterator(int id_, const char* what_arg)
class type_error (line 1077) | class type_error : public exception
method type_error (line 1080) | static type_error create(int id_, const std::string& what_arg)
method type_error (line 1087) | type_error(int id_, const char* what_arg) : exception(id_, what_ar...
class out_of_range (line 1123) | class out_of_range : public exception
method out_of_range (line 1126) | static out_of_range create(int id_, const std::string& what_arg)
method out_of_range (line 1133) | out_of_range(int id_, const char* what_arg) : exception(id_, what_...
class other_error (line 1160) | class other_error : public exception
method other_error (line 1163) | static other_error create(int id_, const std::string& what_arg)
method other_error (line 1170) | other_error(int id_, const char* what_arg) : exception(id_, what_a...
type value_t (line 1215) | enum class value_t : std::uint8_t
function from_json (line 1285) | void from_json(const BasicJsonType& j, typename std::nullptr_t& n)
function get_arithmetic_value (line 1299) | void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val)
function from_json (line 1325) | void from_json(const BasicJsonType& j, typename BasicJsonType::boole...
function from_json (line 1335) | void from_json(const BasicJsonType& j, typename BasicJsonType::strin...
function from_json (line 1351) | void from_json(const BasicJsonType& j, ConstructibleStringType& s)
function from_json (line 1362) | void from_json(const BasicJsonType& j, typename BasicJsonType::numbe...
function from_json (line 1368) | void from_json(const BasicJsonType& j, typename BasicJsonType::numbe...
function from_json (line 1374) | void from_json(const BasicJsonType& j, typename BasicJsonType::numbe...
function from_json (line 1381) | void from_json(const BasicJsonType& j, EnumType& e)
function from_json (line 1391) | void from_json(const BasicJsonType& j, std::forward_list<T, Allocato...
function from_json (line 1407) | void from_json(const BasicJsonType& j, std::valarray<T>& l)
function from_json_array_impl (line 1418) | void from_json_array_impl(const BasicJsonType& j, typename BasicJson...
function from_json_array_impl (line 1424) | auto from_json_array_impl(const BasicJsonType& j, std::array<T, N>& ...
function from_json_array_impl (line 1435) | auto from_json_array_impl(const BasicJsonType& j, ConstructibleArray...
function from_json_array_impl (line 1454) | void from_json_array_impl(const BasicJsonType& j, ConstructibleArray...
function from_json (line 1477) | auto from_json(const BasicJsonType& j, ConstructibleArrayType& arr)
function from_json (line 1493) | void from_json(const BasicJsonType& j, ConstructibleObjectType& obj)
function from_json (line 1523) | void from_json(const BasicJsonType& j, ArithmeticType& val)
function from_json (line 1554) | void from_json(const BasicJsonType& j, std::pair<A1, A2>& p)
function from_json_tuple_impl (line 1560) | void from_json_tuple_impl(const BasicJsonType& j, Tuple& t, index_se...
function from_json (line 1566) | void from_json(const BasicJsonType& j, std::tuple<Args...>& t)
function from_json (line 1574) | void from_json(const BasicJsonType& j, std::map<Key, Value, Compare,...
function from_json (line 1593) | void from_json(const BasicJsonType& j, std::unordered_map<Key, Value...
type from_json_fn (line 1609) | struct from_json_fn
class iteration_proxy_value (line 1664) | class iteration_proxy_value
method iteration_proxy_value (line 1686) | explicit iteration_proxy_value(IteratorType it) noexcept : anchor(...
method iteration_proxy_value (line 1689) | iteration_proxy_value& operator*()
method iteration_proxy_value (line 1695) | iteration_proxy_value& operator++()
method value (line 1744) | typename IteratorType::reference value() const
class iteration_proxy (line 1751) | class iteration_proxy
method iteration_proxy (line 1759) | explicit iteration_proxy(typename IteratorType::reference cont) no...
method begin (line 1763) | iteration_proxy_value<IteratorType> begin() noexcept
method end (line 1769) | iteration_proxy_value<IteratorType> end() noexcept
function get (line 1778) | auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>...
function get (line 1786) | auto get(const nlohmann::detail::iteration_proxy_value<IteratorType>...
type external_constructor (line 1821) | struct external_constructor
type external_constructor<value_t::boolean> (line 1824) | struct external_constructor<value_t::boolean>
method construct (line 1827) | static void construct(BasicJsonType& j, typename BasicJsonType::bo...
type external_constructor<value_t::string> (line 1836) | struct external_constructor<value_t::string>
method construct (line 1839) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
method construct (line 1847) | static void construct(BasicJsonType& j, typename BasicJsonType::st...
method construct (line 1857) | static void construct(BasicJsonType& j, const CompatibleStringType...
type external_constructor<value_t::number_float> (line 1866) | struct external_constructor<value_t::number_float>
method construct (line 1869) | static void construct(BasicJsonType& j, typename BasicJsonType::nu...
type external_constructor<value_t::number_unsigned> (line 1878) | struct external_constructor<value_t::number_unsigned>
method construct (line 1881) | static void construct(BasicJsonType& j, typename BasicJsonType::nu...
type external_constructor<value_t::number_integer> (line 1890) | struct external_constructor<value_t::number_integer>
method construct (line 1893) | static void construct(BasicJsonType& j, typename BasicJsonType::nu...
type external_constructor<value_t::array> (line 1902) | struct external_constructor<value_t::array>
method construct (line 1905) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
method construct (line 1913) | static void construct(BasicJsonType& j, typename BasicJsonType::ar...
method construct (line 1923) | static void construct(BasicJsonType& j, const CompatibleArrayType&...
method construct (line 1933) | static void construct(BasicJsonType& j, const std::vector<bool>& arr)
method construct (line 1947) | static void construct(BasicJsonType& j, const std::valarray<T>& arr)
type external_constructor<value_t::object> (line 1958) | struct external_constructor<value_t::object>
method construct (line 1961) | static void construct(BasicJsonType& j, const typename BasicJsonTy...
method construct (line 1969) | static void construct(BasicJsonType& j, typename BasicJsonType::ob...
method construct (line 1978) | static void construct(BasicJsonType& j, const CompatibleObjectType...
function to_json (line 1995) | void to_json(BasicJsonType& j, T b) noexcept
function to_json (line 2002) | void to_json(BasicJsonType& j, const CompatibleString& s)
function to_json (line 2008) | void to_json(BasicJsonType& j, typename BasicJsonType::string_t&& s)
function to_json (line 2015) | void to_json(BasicJsonType& j, FloatType val) noexcept
function to_json (line 2022) | void to_json(BasicJsonType& j, CompatibleNumberUnsignedType val) noe...
function to_json (line 2029) | void to_json(BasicJsonType& j, CompatibleNumberIntegerType val) noex...
function to_json (line 2036) | void to_json(BasicJsonType& j, EnumType e) noexcept
function to_json (line 2043) | void to_json(BasicJsonType& j, const std::vector<bool>& e)
function to_json (line 2056) | void to_json(BasicJsonType& j, const CompatibleArrayType& arr)
function to_json (line 2063) | void to_json(BasicJsonType& j, const std::valarray<T>& arr)
function to_json (line 2069) | void to_json(BasicJsonType& j, typename BasicJsonType::array_t&& arr)
function to_json (line 2076) | void to_json(BasicJsonType& j, const CompatibleObjectType& obj)
function to_json (line 2082) | void to_json(BasicJsonType& j, typename BasicJsonType::object_t&& obj)
function to_json (line 2092) | void to_json(BasicJsonType& j, const T(&arr)[N])
function to_json (line 2098) | void to_json(BasicJsonType& j, const std::pair<Args...>& p)
function to_json (line 2106) | void to_json(BasicJsonType& j, const T& b)
function to_json_tuple_impl (line 2112) | void to_json_tuple_impl(BasicJsonType& j, const Tuple& t, index_sequ...
function to_json (line 2118) | void to_json(BasicJsonType& j, const std::tuple<Args...>& t)
type to_json_fn (line 2123) | struct to_json_fn
type input_format_t (line 2164) | enum class input_format_t { json, cbor, msgpack, ubjson, bson }
type input_adapter_protocol (line 2181) | struct input_adapter_protocol
class file_input_adapter (line 2195) | class file_input_adapter : public input_adapter_protocol
method file_input_adapter (line 2198) | explicit file_input_adapter(std::FILE* f) noexcept
method get_character (line 2202) | std::char_traits<char>::int_type get_character() noexcept override
Condensed preview — 43 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (913K chars).
[
{
"path": ".gitignore",
"chars": 112,
"preview": "###################\n#.gitignore #\n###################\n\nbuild/\nout/\n.vscode/\n.build-tools.cson\n\n*.kip\n*.elf"
},
{
"path": ".gitmodules",
"chars": 117,
"preview": "[submodule \"SimpleIniParser\"]\n\tpath = SimpleIniParser\n\turl = https://github.com/NicholeMattera/Simple-INI-Parser.git\n"
},
{
"path": "LICENSE",
"chars": 35147,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
},
{
"path": "Makefile",
"chars": 7607,
"preview": "#---------------------------------------------------------------------------------\n.SUFFIXES:\n#-------------------------"
},
{
"path": "README.md",
"chars": 689,
"preview": "# Hekate Toolbox\n\nA Swiss Army Knife for Hekate. It was originally developed for the use with AnnsAnn's SDFiles (Later A"
},
{
"path": "include/ams_bpc.h",
"chars": 900,
"preview": "/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify i"
},
{
"path": "include/gui/button.hpp",
"chars": 1113,
"preview": "#pragma once\n\n#include <switch.h>\n\n#include <functional>\n#include <vector>\n\nclass Gui;\n\nenum AdjacentButtonDirection {\n "
},
{
"path": "include/gui/gui.hpp",
"chars": 4668,
"preview": "#pragma once\n\n#include <switch.h>\n#include <cstring>\n#include <unordered_map>\n#include <memory>\n\n#include \"list_selector"
},
{
"path": "include/gui/gui_hekate.hpp",
"chars": 544,
"preview": "#pragma once\n\n#include \"gui.hpp\"\n\n#include <vector>\n#include <string>\n#include <unordered_map>\n#include <set>\n#include \""
},
{
"path": "include/gui/gui_main.hpp",
"chars": 532,
"preview": "#pragma once\n\n#include \"gui.hpp\"\n\n#include <vector>\n#include <string>\n#include <unordered_map>\n#include \"utils.hpp\"\n#inc"
},
{
"path": "include/gui/gui_override_key.hpp",
"chars": 517,
"preview": "#pragma once\n\n#include \"gui.hpp\"\n#include \"override_key.hpp\"\n\nclass GuiOverrideKey : public Gui {\npublic:\n GuiOverrid"
},
{
"path": "include/gui/gui_overrides_menu.hpp",
"chars": 992,
"preview": "#pragma once\n\n#include \"gui.hpp\"\n#include \"override_key.hpp\"\n\nenum class OverrideButtonType {\n Any_Title,\n Custom_"
},
{
"path": "include/gui/gui_sysmodule.hpp",
"chars": 580,
"preview": "#pragma once\n\n#include \"gui.hpp\"\n\n#include <vector>\n#include <string>\n#include <unordered_map>\n#include <set>\n\ntypedef s"
},
{
"path": "include/gui/gui_title_list.hpp",
"chars": 263,
"preview": "#pragma once\n\n#include \"gui.hpp\"\n\nclass GuiTitleList : public Gui {\npublic:\n GuiTitleList();\n ~GuiTitleList() over"
},
{
"path": "include/gui/list_selector.hpp",
"chars": 795,
"preview": "#pragma once\n\n#include <string>\n#include <functional>\n#include <vector>\n\n#include <switch.h>\n\nclass Gui;\n\nclass ListSele"
},
{
"path": "include/gui/message_box.hpp",
"chars": 1066,
"preview": "#pragma once\n\n#include <switch.h>\n#include <string>\n#include <functional>\n\nclass Gui;\n\nclass MessageBox {\npublic:\n ty"
},
{
"path": "include/gui/theme.h",
"chars": 463,
"preview": "#pragma once\n\n#include <switch.h>\n#include \"types.h\"\n\ntypedef struct {\n color_t textColor;\n color_t unselectedColo"
},
{
"path": "include/service_guard.h",
"chars": 1408,
"preview": "#pragma once\n#include <switch/types.h>\n#include <switch/result.h>\n#include <switch/kernel/mutex.h>\n#include <switch/sf/s"
},
{
"path": "include/utils/jpeg.hpp",
"chars": 404,
"preview": "#pragma once\n#include \"switch.h\"\n\nstruct WidthHeight {\n int width;\n int height;\n};\n\n//Takes a pointer to a jpeg da"
},
{
"path": "include/utils/json.hpp",
"chars": 710017,
"preview": "// clang-format off\n/*\n __ _____ _____ _____\n __| | __| | | | JSON for Modern C++\n| | |__ | | | | | |"
},
{
"path": "include/utils/override_key.hpp",
"chars": 1177,
"preview": "#pragma once\n#include <string>\n#include <switch.h>\n\n#define OVERRIDE_KEY \"override_key_0\"\n#define PROGRAM_ID \"program_"
},
{
"path": "include/utils/threads.hpp",
"chars": 115,
"preview": "#pragma once\n\n#include <switch.h>\n\nnamespace Threads {\n\n Result create(ThreadFunc func);\n void joinAll();\n\n}\n"
},
{
"path": "include/utils/titleinfo.hpp",
"chars": 678,
"preview": "#pragma once\n#include \"switch.h\"\n#include <memory>\n#include <vector>\n#include \"jpeg.hpp\"\n\nstruct TitleIcon {\n u64 app"
},
{
"path": "include/utils/types.h",
"chars": 869,
"preview": "#pragma once\n\n#include <switch.h>\n\ntypedef union {\n u32 color_abgr;\n\n struct {\n u8 r, g, b, a;\n };\n\n} co"
},
{
"path": "include/utils/utils.hpp",
"chars": 2867,
"preview": "#pragma once\n\n#include <switch.h>\n#include <string>\n#include <vector>\n#include \"types.h\"\n#include \"SimpleIniParser.hpp\"\n"
},
{
"path": "source/ams_bpc.c",
"chars": 1364,
"preview": "/*\n * Copyright (c) 2018-2020 Atmosphère-NX\n *\n * This program is free software; you can redistribute it and/or modify i"
},
{
"path": "source/gui/button.cpp",
"chars": 2700,
"preview": "#include \"button.hpp\"\n#include \"gui.hpp\"\n\nextern \"C\" {\n#include \"theme.h\"\n}\n\nButton::Button() {\n m_isActivated = fals"
},
{
"path": "source/gui/gui.cpp",
"chars": 17881,
"preview": "#include \"gui.hpp\"\n\n#include <math.h>\n#include <functional>\n#include \"utils.hpp\"\n\nstatic float menuTimer = 0.0F;\nstatic "
},
{
"path": "source/gui/gui_hekate.cpp",
"chars": 10409,
"preview": "#include \"gui_hekate.hpp\"\n#include \"button.hpp\"\n\n#include <stdio.h>\n#include <dirent.h>\n#include <sstream>\n#include <fst"
},
{
"path": "source/gui/gui_main.cpp",
"chars": 6789,
"preview": "#include \"gui_main.hpp\"\n#include \"button.hpp\"\n\n#include <sstream>\n\n#include \"utils.hpp\"\n#include \"SimpleIniParser.hpp\"\n\n"
},
{
"path": "source/gui/gui_override_key.cpp",
"chars": 11810,
"preview": "#include \"gui_override_key.hpp\"\n#include \"button.hpp\"\n#include \"utils.hpp\"\n#include \"SimpleIniParser.hpp\"\n\n#include \"lis"
},
{
"path": "source/gui/gui_overrides_menu.cpp",
"chars": 12931,
"preview": "#include \"gui_overrides_menu.hpp\"\n#include \"gui_override_key.hpp\"\n#include \"button.hpp\"\n#include \"utils.hpp\"\n#include \"S"
},
{
"path": "source/gui/gui_sysmodule.cpp",
"chars": 7769,
"preview": "#include \"gui_sysmodule.hpp\"\n#include \"button.hpp\"\n\n#include <stdio.h>\n#include <dirent.h>\n#include <sstream>\n#include <"
},
{
"path": "source/gui/gui_title_list.cpp",
"chars": 5519,
"preview": "#include \"gui_title_list.hpp\"\n#include \"button.hpp\"\n#include \"utils.hpp\"\n#include <memory>\n#include <string>\n#include <c"
},
{
"path": "source/gui/list_selector.cpp",
"chars": 5297,
"preview": "#include \"list_selector.hpp\"\n\n#include <cmath>\n\n#include \"gui.hpp\"\n\nfloat deltaOffset = 0;\n\nListSelector::ListSelector(s"
},
{
"path": "source/gui/message_box.cpp",
"chars": 5132,
"preview": "#include \"message_box.hpp\"\n\n#include <math.h>\n\n#include \"gui.hpp\"\n\nMessageBox::MessageBox(std::string message, MessageBo"
},
{
"path": "source/gui/theme.c",
"chars": 2126,
"preview": "#include \"theme.h\"\n\ntheme_t currTheme;\n\nvoid setTheme(ColorSetId colorSetId) {\n switch (colorSetId) {\n case Co"
},
{
"path": "source/main.cpp",
"chars": 4643,
"preview": "#include <string.h>\n#include <stdio.h>\n#include <chrono>\n\n#include <switch.h>\n#include <thread>\n\n#include \"gui.hpp\"\n#inc"
},
{
"path": "source/utils/jpeg.cpp",
"chars": 756,
"preview": "#include \"jpeg.hpp\"\n#include \"turbojpeg.h\"\n#include \"types.h\"\n\nconst u8 *jpegdec(const u8 *buffer, size_t size, WidthHei"
},
{
"path": "source/utils/override_key.cpp",
"chars": 6327,
"preview": "#include \"override_key.hpp\"\n#include <strings.h>\n\nOverrideKey OverrideKey::StringToKeyCombo(const std::string &keyString"
},
{
"path": "source/utils/threads.cpp",
"chars": 545,
"preview": "#include \"threads.hpp\"\n\n#include <vector>\n\nstatic std::vector<Thread> threads;\n\nResult Threads::create(ThreadFunc func) "
},
{
"path": "source/utils/titleinfo.cpp",
"chars": 3199,
"preview": "#include \"titleinfo.hpp\"\n#include \"jpeg.hpp\"\n#include <cstring>\n#include <thread>\n#include <condition_variable>\n#include"
},
{
"path": "source/utils/utils.cpp",
"chars": 4052,
"preview": "#include \"utils.hpp\"\n#include \"SimpleIniParser.hpp\"\n#include <stdio.h>\n#include <dirent.h>\n#include <algorithm>\n#include"
}
]
About this extraction
This page contains the full source code of the WerWolv/Hekate-Toolbox GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 43 files (862.2 KB), approximately 208.3k tokens, and a symbol index with 785 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.