luco namespace

the namespace for luco

Classes

class array
the class that holds a luco array
class error
a class type inspired by std::error_code to handle errors
template <class T = monostate, class E = monostate>
class expected
an implementation of std::expected to allow using luco with C++20. check the cppreference
class monostate
an implementation of std::monostate to allow using luco with C++20. check the cppreference
class node
the class that holds a luco node which is either luco::object, luco::array or luco::value
class null_type
an empty class to represent a luco null value
class object
the class that holds a luco object
class value
holds a luco value such as <std::string, double, int64_t, bool, null_type, monostate>

Concepts

template <typename container_type>
concept is_value_container
concept for enabling luco::node to accept std array-like containers
template <typename container_type>
concept container_type_concept
puts a constraint on the allowed std container types to be inserted into luco::node
template <typename allowed_node_types>
concept is_allowed_node_type
allowed types in luco::node
template <typename value_type>
concept container_or_node_type
puts a constraint on the allowed types to be inserted into luco::node which is container_type_concept or is_allowed_node_type
template <typename container_type>
concept is_key_value_container
concept for enabling luco::node to accept std key/value containers
template <typename allowed_value_types>
concept is_allowed_value_type
puts a constraint on the allowed luco types for luco::value

Enums

enum class error_type { none, key_not_found, filesystem_error, parsing_error, parsing_error_wrong_type, wrong_type, wronge_index }
error values used in luco::error
enum class node_type { object, array, value }
this enum can be used to explicitly make a node that's either an object, array or value

Functions

template <class E>
auto unexpected(const E& e) →  expected<monostate, E> constexpr
a helper function to construct an unexpected type
auto unexpected(const char* e) →  expected<monostate, std::string> constexpr
a helper function to construct an unexpected type

Enum documentation

enum class luco::node_type

this enum can be used to explicitly make a node that's either an object, array or value

luco::node node(luco::node_type::array);
luco::node node; // default is luco::node_type::object

Function documentation

expected<monostate, std::string> luco::unexpected(const char* e) constexpr

a helper function to construct an unexpected type

luco::expected<luco::node, std::string> node = luco::unexpected("error");