CToon C++ 0.6.1
A C++ TOON/JSON serialization library
Loading...
Searching...
No Matches
ctoon.hpp File Reference

C++11 binding for the CToon library. More...

#include "ctoon.h"
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <cstdio>
#include <exception>
#include <stdexcept>
#include <string>
Include dependency graph for ctoon.hpp:

Go to the source code of this file.

Classes

class  ctoon::version
 
class  ctoon::error
 
class  ctoon::parse_error
 
class  ctoon::write_error
 
class  ctoon::write_result
 
class  ctoon::write_options
 
class  ctoon::value
 
class  ctoon::mut_value
 
class  ctoon::document
 
class  ctoon::mut_document
 

Namespaces

namespace  ctoon
 

Enumerations

enum class  ctoon::delimiter : uint32_t { ctoon::COMMA = CTOON_DELIMITER_COMMA , ctoon::TAB = CTOON_DELIMITER_TAB , ctoon::PIPE = CTOON_DELIMITER_PIPE }
 
enum class  ctoon::write_flag : uint32_t {
  ctoon::NOFLAG = static_cast<uint32_t>(CTOON_WRITE_NOFLAG) , ctoon::ESCAPE_UNICODE = static_cast<uint32_t>(CTOON_WRITE_ESCAPE_UNICODE) , ctoon::ESCAPE_SLASHES = static_cast<uint32_t>(CTOON_WRITE_ESCAPE_SLASHES) , ctoon::ALLOW_INF_AND_NAN = static_cast<uint32_t>(CTOON_WRITE_ALLOW_INF_AND_NAN) ,
  ctoon::INF_AND_NAN_AS_NULL = static_cast<uint32_t>(CTOON_WRITE_INF_AND_NAN_AS_NULL) , ctoon::ALLOW_INVALID_UNICODE = static_cast<uint32_t>(CTOON_WRITE_ALLOW_INVALID_UNICODE) , ctoon::LENGTH_MARKER = static_cast<uint32_t>(CTOON_WRITE_LENGTH_MARKER) , ctoon::NEWLINE_AT_END = static_cast<uint32_t>(CTOON_WRITE_NEWLINE_AT_END)
}
 
enum class  ctoon::read_flag : uint32_t {
  ctoon::NOFLAG = static_cast<uint32_t>(CTOON_READ_NOFLAG) , ctoon::INSITU = static_cast<uint32_t>(CTOON_READ_INSITU) , ctoon::STOP_WHEN_DONE = static_cast<uint32_t>(CTOON_READ_STOP_WHEN_DONE) , ctoon::ALLOW_TRAILING_COMMAS = static_cast<uint32_t>(CTOON_READ_ALLOW_TRAILING_COMMAS) ,
  ctoon::ALLOW_COMMENTS = static_cast<uint32_t>(CTOON_READ_ALLOW_COMMENTS) , ctoon::ALLOW_INF_AND_NAN = static_cast<uint32_t>(CTOON_READ_ALLOW_INF_AND_NAN) , ctoon::NUMBER_AS_RAW = static_cast<uint32_t>(CTOON_READ_NUMBER_AS_RAW) , ctoon::ALLOW_INVALID_UNICODE = static_cast<uint32_t>(CTOON_READ_ALLOW_INVALID_UNICODE) ,
  ctoon::BIGNUM_AS_RAW = static_cast<uint32_t>(CTOON_READ_BIGNUM_AS_RAW) , ctoon::ALLOW_BOM = static_cast<uint32_t>(CTOON_READ_ALLOW_BOM) , ctoon::ALLOW_EXT_NUMBER = static_cast<uint32_t>(CTOON_READ_ALLOW_EXT_NUMBER) , ctoon::ALLOW_EXT_ESCAPE = static_cast<uint32_t>(CTOON_READ_ALLOW_EXT_ESCAPE) ,
  ctoon::ALLOW_EXT_WHITESPACE = static_cast<uint32_t>(CTOON_READ_ALLOW_EXT_WHITESPACE) , ctoon::ALLOW_SINGLE_QUOTED_STR = static_cast<uint32_t>(CTOON_READ_ALLOW_SINGLE_QUOTED_STR) , ctoon::ALLOW_UNQUOTED_KEY = static_cast<uint32_t>(CTOON_READ_ALLOW_UNQUOTED_KEY)
}
 

Functions

write_flag ctoon::operator| (write_flag l, write_flag r) CTOON_NOEXCEPT
 
write_flagctoon::operator|= (write_flag &l, write_flag r) CTOON_NOEXCEPT
 
ctoon_write_flag ctoon::to_c (write_flag f) CTOON_NOEXCEPT
 Convert to the C type for passing to C API.
 
read_flag ctoon::operator| (read_flag l, read_flag r) CTOON_NOEXCEPT
 
read_flagctoon::operator|= (read_flag &l, read_flag r) CTOON_NOEXCEPT
 
ctoon_read_flag ctoon::to_c (read_flag f) CTOON_NOEXCEPT
 Convert to the C type for passing to C API.
 
document ctoon::parse (const char *toon, read_flag flags=read_flag::NOFLAG)
 
document ctoon::parse (const std::string &toon, read_flag flags=read_flag::NOFLAG)
 
document ctoon::parse_file (const char *path, read_flag flags=read_flag::NOFLAG)
 
mut_document ctoon::make_document ()
 
write_result ctoon::to_string (const document &d, const write_options &o=write_options())
 
write_result ctoon::to_string (const mut_document &d, const write_options &o=write_options())
 

Detailed Description

C++11 binding for the CToon library.

Include-only wrapper around ctoon.h. Everything lives in namespace ctoon. Naming follows the STL snake_case convention.

Class hierarchy
Class Owns memory Underlying type
ctoon::value no ctoon_val*
ctoon::mut_value no ctoon_mut_val*
ctoon::document yes ctoon_doc*
ctoon::mut_document yes ctoon_mut_doc*
Exception hierarchy
std::exception
└── ctoon::error (base)
├── ctoon::parse_error (TOON parse failures)
└── ctoon::write_error (serialisation failures)
Author
Mohammad Raziei

Definition in file ctoon.hpp.