JSON Voorhees
Killer JSON for C++
Loading...
Searching...
No Matches
kind.hpp
Go to the documentation of this file.
1/** \file jsonv/kind.hpp
2 *
3 * Copyright (c) 2019-2020 by Travis Gockel. All rights reserved.
4 *
5 * This program is free software: you can redistribute it and/or modify it under the terms of the Apache License
6 * as published by the Apache Software Foundation, either version 2 of the License, or (at your option) any later
7 * version.
8 *
9 * \author Travis Gockel (travis@gockelhut.com)
10**/
11#pragma once
12
13#include <jsonv/config.hpp>
14
15#include <iosfwd>
16#include <string>
17
18namespace jsonv
19{
20
21/** \ingroup Value
22 * \{
23**/
24
25/** Describes the \e kind of data a \c value holds. See \c value for more information.
26 *
27 * \see http://json.org/
28**/
29enum class kind : unsigned char
30{
31 null,
32 object,
33 array,
34 string,
35 integer,
36 decimal,
37 boolean,
38};
39
40/** Print out the name of the \c kind. **/
41JSONV_PUBLIC std::ostream& operator<<(std::ostream&, const kind&);
42
43/** Get the name of the \c kind. **/
44JSONV_NODISCARD JSONV_PUBLIC std::string to_string(const kind&);
45
46/** \} **/
47
48}
An adapter for enumeration types.
Copyright (c) 2014-2020 by Travis Gockel.
#define JSONV_NODISCARD
Warn if the caller discards the result of this function.
Definition config.hpp:121
#define JSONV_PUBLIC
This function or class is part of the public API for JSON Voorhees.
Definition config.hpp:102
kind
Describes the kind of data a value holds.
Definition kind.hpp:30
JSONV_PUBLIC value object()
Create an empty object.
JSONV_PUBLIC const value null
An instance with kind::null.
JSONV_PUBLIC value array()
Create an empty array value.