\section{cppcms\+:\+:json Namespace Reference}
\label{namespacecppcms_1_1json}\index{cppcms\+::json@{cppcms\+::json}}


This namespace includes all J\+S\+ON parsing and formatting related classes and functions.  


\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class {\bf bad\+\_\+value\+\_\+cast}
\begin{DoxyCompactList}\small\item\em The error that is thrown in case of bad conversion of \doxyref{json\+::value}{p.}{classcppcms_1_1json_1_1value} to ordinary value. \end{DoxyCompactList}\item 
struct {\bf null}
\begin{DoxyCompactList}\small\item\em Special object that is convertible to null json value. \end{DoxyCompactList}\item 
struct {\bf traits}
\begin{DoxyCompactList}\small\item\em The type traits schema for converting json values to/from orinary objects i.\+e. serialization from J\+S\+ON to C++ object. \end{DoxyCompactList}\item 
struct {\bf undefined}
\begin{DoxyCompactList}\small\item\em Special object that is convertible to undefined json value. \end{DoxyCompactList}\item 
class {\bf value}
\begin{DoxyCompactList}\small\item\em This class is central representation of json objects. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef std\+::vector$<$ {\bf value} $>$ {\bf array}\label{namespacecppcms_1_1json_aefdab4e43ce88b19e1a73eecfe02d799}

\begin{DoxyCompactList}\small\item\em The \doxyref{json\+::array}{p.}{namespacecppcms_1_1json_aefdab4e43ce88b19e1a73eecfe02d799} -\/ std\+::vector of \doxyref{json\+::value}{p.}{classcppcms_1_1json_1_1value}\textquotesingle{}s. \end{DoxyCompactList}\item 
typedef std\+::map$<$ {\bf string\+\_\+key}, {\bf value} $>$ {\bf object}\label{namespacecppcms_1_1json_a4849268540ccdea30cfa408d6706d0c9}

\begin{DoxyCompactList}\small\item\em The \doxyref{json\+::object}{p.}{namespacecppcms_1_1json_a4849268540ccdea30cfa408d6706d0c9} -\/ std\+::map of \doxyref{json\+::value}{p.}{classcppcms_1_1json_1_1value}\textquotesingle{}s. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum {\bf json\+\_\+type} \{ \\*
{\bf is\+\_\+undefined}, 
{\bf is\+\_\+null}, 
{\bf is\+\_\+boolean}, 
{\bf is\+\_\+number}, 
\\*
{\bf is\+\_\+string}, 
{\bf is\+\_\+object}, 
{\bf is\+\_\+array}
 \}
\item 
enum \{ {\bf compact} = 0, 
{\bf readable} = 1
 \}
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
bool {\bfseries operator==} ({\bf undefined} const \&, {\bf undefined} const \&)\label{namespacecppcms_1_1json_a2069011c390fc360bcf6bc7eb58d1cf1}

\item 
bool {\bfseries operator!=} ({\bf undefined} const \&, {\bf undefined} const \&)\label{namespacecppcms_1_1json_a3be55642db51461e8eb131fadce85195}

\item 
bool {\bfseries operator==} ({\bf null} const \&, {\bf null} const \&)\label{namespacecppcms_1_1json_a8225cbee2971b89fc1ce435c0b146b01}

\item 
bool {\bfseries operator!=} ({\bf null} const \&, {\bf null} const \&)\label{namespacecppcms_1_1json_ac36b1a30bb433743061fdfeca3f9a7e7}

\item 
std\+::istream C\+P\+P\+C\+M\+S\+\_\+\+A\+PI \& {\bf operator$>$$>$} (std\+::istream \&in, {\bf value} \&v)
\item 
std\+::ostream C\+P\+P\+C\+M\+S\+\_\+\+A\+PI \& {\bf operator$<$$<$} (std\+::ostream \&out, {\bf value} const \&v)
\item 
std\+::ostream C\+P\+P\+C\+M\+S\+\_\+\+A\+PI \& {\bf operator$<$$<$} (std\+::ostream \&out, {\bf json\+\_\+type})
\item 
std\+::string C\+P\+P\+C\+M\+S\+\_\+\+A\+PI {\bf to\+\_\+json} (std\+::string const \&utf)
\item 
std\+::string C\+P\+P\+C\+M\+S\+\_\+\+A\+PI {\bf to\+\_\+json} (char const $\ast$begin, char const $\ast$end)
\item 
void C\+P\+P\+C\+M\+S\+\_\+\+A\+PI {\bf to\+\_\+json} (char const $\ast$begin, char const $\ast$end, std\+::ostream \&out)
\item 
void C\+P\+P\+C\+M\+S\+\_\+\+A\+PI {\bf to\+\_\+json} (std\+::string const \&str, std\+::ostream \&out)
\end{DoxyCompactItemize}


\subsection{Detailed Description}
This namespace includes all J\+S\+ON parsing and formatting related classes and functions. 

\subsection{Enumeration Type Documentation}
\subsubsection[{anonymous enum}]{\setlength{\rightskip}{0pt plus 5cm}anonymous enum}\label{namespacecppcms_1_1json_a797153fcb28b504b4b00310f0ac30393}
\begin{Desc}
\item[Enumerator]\par
\begin{description}
\index{compact@{compact}!cppcms\+::json@{cppcms\+::json}}\index{cppcms\+::json@{cppcms\+::json}!compact@{compact}}\item[{\em 
compact\label{namespacecppcms_1_1json_a797153fcb28b504b4b00310f0ac30393aa0172afab64ae681c98bad599d7ae1af}
}]Print J\+S\+ON values in most compact format. \index{readable@{readable}!cppcms\+::json@{cppcms\+::json}}\index{cppcms\+::json@{cppcms\+::json}!readable@{readable}}\item[{\em 
readable\label{namespacecppcms_1_1json_a797153fcb28b504b4b00310f0ac30393a80a22af81fee7e185cbbffb9ee165645}
}]Print J\+S\+ON values in human readable format (with identention) \end{description}
\end{Desc}
\index{cppcms\+::json@{cppcms\+::json}!json\+\_\+type@{json\+\_\+type}}
\index{json\+\_\+type@{json\+\_\+type}!cppcms\+::json@{cppcms\+::json}}
\subsubsection[{json\+\_\+type}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf cppcms\+::json\+::json\+\_\+type}}\label{namespacecppcms_1_1json_abb91466c5b2824abd3c0c4c6f77bfd2f}
The type of json value \begin{Desc}
\item[Enumerator]\par
\begin{description}
\index{is\+\_\+undefined@{is\+\_\+undefined}!cppcms\+::json@{cppcms\+::json}}\index{cppcms\+::json@{cppcms\+::json}!is\+\_\+undefined@{is\+\_\+undefined}}\item[{\em 
is\+\_\+undefined\label{namespacecppcms_1_1json_abb91466c5b2824abd3c0c4c6f77bfd2fa81b825f1da773b3b5366d1d4a50d62ee}
}]Undefined value. \index{is\+\_\+null@{is\+\_\+null}!cppcms\+::json@{cppcms\+::json}}\index{cppcms\+::json@{cppcms\+::json}!is\+\_\+null@{is\+\_\+null}}\item[{\em 
is\+\_\+null\label{namespacecppcms_1_1json_abb91466c5b2824abd3c0c4c6f77bfd2fa22c479e93d944ace38a553dc49826d89}
}]null value \index{is\+\_\+boolean@{is\+\_\+boolean}!cppcms\+::json@{cppcms\+::json}}\index{cppcms\+::json@{cppcms\+::json}!is\+\_\+boolean@{is\+\_\+boolean}}\item[{\em 
is\+\_\+boolean\label{namespacecppcms_1_1json_abb91466c5b2824abd3c0c4c6f77bfd2fa396df1c896fa7acd285a83aaa3bf8d30}
}]boolean value \index{is\+\_\+number@{is\+\_\+number}!cppcms\+::json@{cppcms\+::json}}\index{cppcms\+::json@{cppcms\+::json}!is\+\_\+number@{is\+\_\+number}}\item[{\em 
is\+\_\+number\label{namespacecppcms_1_1json_abb91466c5b2824abd3c0c4c6f77bfd2faca27ab2ba1425dbb5c177ea0ff379ebd}
}]numeric value \index{is\+\_\+string@{is\+\_\+string}!cppcms\+::json@{cppcms\+::json}}\index{cppcms\+::json@{cppcms\+::json}!is\+\_\+string@{is\+\_\+string}}\item[{\em 
is\+\_\+string\label{namespacecppcms_1_1json_abb91466c5b2824abd3c0c4c6f77bfd2fa050cdf883f72c2ccacd4e40775875bdc}
}]string value \index{is\+\_\+object@{is\+\_\+object}!cppcms\+::json@{cppcms\+::json}}\index{cppcms\+::json@{cppcms\+::json}!is\+\_\+object@{is\+\_\+object}}\item[{\em 
is\+\_\+object\label{namespacecppcms_1_1json_abb91466c5b2824abd3c0c4c6f77bfd2fa5c5521179c08fcac7cf56ce66c96baed}
}]object value \index{is\+\_\+array@{is\+\_\+array}!cppcms\+::json@{cppcms\+::json}}\index{cppcms\+::json@{cppcms\+::json}!is\+\_\+array@{is\+\_\+array}}\item[{\em 
is\+\_\+array\label{namespacecppcms_1_1json_abb91466c5b2824abd3c0c4c6f77bfd2fa2fe35365aa83ab4c94ed05f036acb7ee}
}]array value \end{description}
\end{Desc}


\subsection{Function Documentation}
\index{cppcms\+::json@{cppcms\+::json}!operator$<$$<$@{operator$<$$<$}}
\index{operator$<$$<$@{operator$<$$<$}!cppcms\+::json@{cppcms\+::json}}
\subsubsection[{operator$<$$<$(std\+::ostream \&out, value const \&v)}]{\setlength{\rightskip}{0pt plus 5cm}std\+::ostream C\+P\+P\+C\+M\+S\+\_\+\+A\+PI\& cppcms\+::json\+::operator$<$$<$ (
\begin{DoxyParamCaption}
\item[{std\+::ostream \&}]{out, }
\item[{{\bf value} const \&}]{v}
\end{DoxyParamCaption}
)}\label{namespacecppcms_1_1json_aec1a6f4336dbca5132f83d72688b85fd}
Write json object to output stream \index{cppcms\+::json@{cppcms\+::json}!operator$<$$<$@{operator$<$$<$}}
\index{operator$<$$<$@{operator$<$$<$}!cppcms\+::json@{cppcms\+::json}}
\subsubsection[{operator$<$$<$(std\+::ostream \&out, json\+\_\+type)}]{\setlength{\rightskip}{0pt plus 5cm}std\+::ostream C\+P\+P\+C\+M\+S\+\_\+\+A\+PI\& cppcms\+::json\+::operator$<$$<$ (
\begin{DoxyParamCaption}
\item[{std\+::ostream \&}]{out, }
\item[{{\bf json\+\_\+type}}]{}
\end{DoxyParamCaption}
)}\label{namespacecppcms_1_1json_abe67ac8e29f11a1c9feccf9eb2d4cfdf}
Write human readable representation of json\+\_\+type \index{cppcms\+::json@{cppcms\+::json}!operator$>$$>$@{operator$>$$>$}}
\index{operator$>$$>$@{operator$>$$>$}!cppcms\+::json@{cppcms\+::json}}
\subsubsection[{operator$>$$>$(std\+::istream \&in, value \&v)}]{\setlength{\rightskip}{0pt plus 5cm}std\+::istream C\+P\+P\+C\+M\+S\+\_\+\+A\+PI\& cppcms\+::json\+::operator$>$$>$ (
\begin{DoxyParamCaption}
\item[{std\+::istream \&}]{in, }
\item[{{\bf value} \&}]{v}
\end{DoxyParamCaption}
)}\label{namespacecppcms_1_1json_ac3d2d9c2a6b8534037b891a569b7021d}
Read json object from input stream \index{cppcms\+::json@{cppcms\+::json}!to\+\_\+json@{to\+\_\+json}}
\index{to\+\_\+json@{to\+\_\+json}!cppcms\+::json@{cppcms\+::json}}
\subsubsection[{to\+\_\+json(std\+::string const \&utf)}]{\setlength{\rightskip}{0pt plus 5cm}std\+::string C\+P\+P\+C\+M\+S\+\_\+\+A\+PI cppcms\+::json\+::to\+\_\+json (
\begin{DoxyParamCaption}
\item[{std\+::string const \&}]{utf}
\end{DoxyParamCaption}
)}\label{namespacecppcms_1_1json_a56fa20431f6804056561d1e906bf4de9}
Convert U\+T\+F-\/8 string to J\+S\+ON string, i.\+e. a sring foo is converted to \char`\"{}foo\char`\"{}, a string bar\char`\"{}baz is converted to \char`\"{}bar"baz"

\doxyref{New in Cpp\+C\+MS 1.\+2}{p.}{v1_2} 

Referenced by cppcms\+::json\+::value\+::swap().

\index{cppcms\+::json@{cppcms\+::json}!to\+\_\+json@{to\+\_\+json}}
\index{to\+\_\+json@{to\+\_\+json}!cppcms\+::json@{cppcms\+::json}}
\subsubsection[{to\+\_\+json(char const $\ast$begin, char const $\ast$end)}]{\setlength{\rightskip}{0pt plus 5cm}std\+::string C\+P\+P\+C\+M\+S\+\_\+\+A\+PI cppcms\+::json\+::to\+\_\+json (
\begin{DoxyParamCaption}
\item[{char const $\ast$}]{begin, }
\item[{char const $\ast$}]{end}
\end{DoxyParamCaption}
)}\label{namespacecppcms_1_1json_af21b7b03bc51dbd17905b92da365b67b}
Convert U\+T\+F-\/8 string to J\+S\+ON string, i.\+e. a sring foo is converted to \char`\"{}foo\char`\"{}, a string bar\char`\"{}baz is converted to \char`\"{}bar"baz"

\doxyref{New in Cpp\+C\+MS 1.\+2}{p.}{v1_2} \index{cppcms\+::json@{cppcms\+::json}!to\+\_\+json@{to\+\_\+json}}
\index{to\+\_\+json@{to\+\_\+json}!cppcms\+::json@{cppcms\+::json}}
\subsubsection[{to\+\_\+json(char const $\ast$begin, char const $\ast$end, std\+::ostream \&out)}]{\setlength{\rightskip}{0pt plus 5cm}void C\+P\+P\+C\+M\+S\+\_\+\+A\+PI cppcms\+::json\+::to\+\_\+json (
\begin{DoxyParamCaption}
\item[{char const $\ast$}]{begin, }
\item[{char const $\ast$}]{end, }
\item[{std\+::ostream \&}]{out}
\end{DoxyParamCaption}
)}\label{namespacecppcms_1_1json_a54c857355ac3757a35ce75c24e339bdb}
Convert U\+T\+F-\/8 string to J\+S\+ON string, i.\+e. a sring foo is converted to \char`\"{}foo\char`\"{}, a string bar\char`\"{}baz is converted to \char`\"{}bar"baz"

\doxyref{New in Cpp\+C\+MS 1.\+2}{p.}{v1_2} \index{cppcms\+::json@{cppcms\+::json}!to\+\_\+json@{to\+\_\+json}}
\index{to\+\_\+json@{to\+\_\+json}!cppcms\+::json@{cppcms\+::json}}
\subsubsection[{to\+\_\+json(std\+::string const \&str, std\+::ostream \&out)}]{\setlength{\rightskip}{0pt plus 5cm}void C\+P\+P\+C\+M\+S\+\_\+\+A\+PI cppcms\+::json\+::to\+\_\+json (
\begin{DoxyParamCaption}
\item[{std\+::string const \&}]{str, }
\item[{std\+::ostream \&}]{out}
\end{DoxyParamCaption}
)}\label{namespacecppcms_1_1json_a5477ecd2d93e59d1be1770c5bc9ddaf7}
Convert U\+T\+F-\/8 string to J\+S\+ON string, i.\+e. a sring foo is converted to \char`\"{}foo\char`\"{}, a string bar\char`\"{}baz is converted to \char`\"{}bar"baz"

\doxyref{New in Cpp\+C\+MS 1.\+2}{p.}{v1_2} 