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

Classes

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

Enumerations

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

Functions

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

Enumeration Type Documentation

◆ delimiter

enum class ctoon::delimiter : uint32_t
strong
Enumerator
COMMA 
TAB 
PIPE 

Definition at line 163 of file ctoon.hpp.

◆ read_flag

enum class ctoon::read_flag : uint32_t
strong
Enumerator
NOFLAG 
INSITU 
STOP_WHEN_DONE 
ALLOW_TRAILING_COMMAS 
ALLOW_COMMENTS 
ALLOW_INF_AND_NAN 
NUMBER_AS_RAW 
ALLOW_INVALID_UNICODE 
BIGNUM_AS_RAW 
ALLOW_BOM 
ALLOW_EXT_NUMBER 
ALLOW_EXT_ESCAPE 
ALLOW_EXT_WHITESPACE 
ALLOW_SINGLE_QUOTED_STR 
ALLOW_UNQUOTED_KEY 

Definition at line 202 of file ctoon.hpp.

◆ write_flag

enum class ctoon::write_flag : uint32_t
strong
Enumerator
NOFLAG 
ESCAPE_UNICODE 
ESCAPE_SLASHES 
ALLOW_INF_AND_NAN 
INF_AND_NAN_AS_NULL 
ALLOW_INVALID_UNICODE 
LENGTH_MARKER 
NEWLINE_AT_END 

Definition at line 176 of file ctoon.hpp.

Function Documentation

◆ make_document()

mut_document ctoon::make_document ( )
inline

Definition at line 805 of file ctoon.hpp.

References ctoon::mut_document::create().

◆ operator|() [1/2]

read_flag ctoon::operator| ( read_flag  l,
read_flag  r 
)
inline

Definition at line 220 of file ctoon.hpp.

◆ operator|() [2/2]

write_flag ctoon::operator| ( write_flag  l,
write_flag  r 
)
inline

Definition at line 187 of file ctoon.hpp.

◆ operator|=() [1/2]

read_flag & ctoon::operator|= ( read_flag l,
read_flag  r 
)
inline

Definition at line 223 of file ctoon.hpp.

◆ operator|=() [2/2]

write_flag & ctoon::operator|= ( write_flag l,
write_flag  r 
)
inline

Definition at line 190 of file ctoon.hpp.

◆ parse() [1/2]

document ctoon::parse ( const char *  toon,
read_flag  flags = read_flag::NOFLAG 
)
inline

Definition at line 796 of file ctoon.hpp.

References ctoon::document::parse().

◆ parse() [2/2]

document ctoon::parse ( const std::string &  toon,
read_flag  flags = read_flag::NOFLAG 
)
inline

Definition at line 799 of file ctoon.hpp.

References ctoon::document::parse().

◆ parse_file()

document ctoon::parse_file ( const char *  path,
read_flag  flags = read_flag::NOFLAG 
)
inline

Definition at line 802 of file ctoon.hpp.

References ctoon::document::parse_file().

◆ to_c() [1/2]

ctoon_read_flag ctoon::to_c ( read_flag  f)
inline

Convert to the C type for passing to C API.

Definition at line 227 of file ctoon.hpp.

◆ to_c() [2/2]

ctoon_write_flag ctoon::to_c ( write_flag  f)
inline

Convert to the C type for passing to C API.

Definition at line 194 of file ctoon.hpp.

Referenced by ctoon::document::parse(), ctoon::document::parse_file(), ctoon::document::parse_indent(), and ctoon::write_options::to_c().

◆ to_string() [1/2]

write_result ctoon::to_string ( const document d,
const write_options o = write_options() 
)
inline

Definition at line 806 of file ctoon.hpp.

References ctoon::document::to_string().

◆ to_string() [2/2]

write_result ctoon::to_string ( const mut_document d,
const write_options o = write_options() 
)
inline

Definition at line 807 of file ctoon.hpp.

References ctoon::mut_document::to_string().