pupene
0.2.0
|
Namespaces | |
detect | |
fns | |
Classes | |
struct | binary_reader_pup |
struct | binary_writer_pup |
class | BinaryPupper |
class | DebugPupper |
This pupper wraps another pupper, logging each call to Wrapped::begin(), Wrapped::pup() and wrapped::end(). More... | |
struct | is_detected |
struct | is_detected< Trait, std::void_t< Trait< Args... > >, Args... > |
class | JsonReader |
class | JsonWriter |
struct | Meta |
Holds name and type of objects. More... | |
class | NullPupper |
Does nothing by itself. More... | |
class | Pupper |
Base class for working with puppable types. More... | |
Typedefs | |
using | BinaryReader = BinaryPupper< std::istream, binary_reader_pup > |
using | BinaryWriter = BinaryPupper< std::ostream, binary_writer_pup > |
template<typename T > | |
using | enable_if_not_puppable = typename std::enable_if_t<!is_puppable< T >()> |
template<typename T > | |
using | enable_if_pup_iterable = typename std::enable_if_t< is_pup_iterable< T >()> |
template<typename T > | |
using | enable_if_puppable = typename std::enable_if_t< is_puppable< T >()> |
template<typename T > | |
using | enable_if_puppable_container = typename std::enable_if_t< is_pup_container< T >()> |
template<typename T > | |
using | enable_if_puppable_map = typename std::enable_if_t< is_map< T >()> |
using | Type = Meta::Type |
Enumerations | |
enum | PupPolicy { PupPolicy::pup_object, PupPolicy::consume_object } |
Controls an object's pup() behavior. More... | |
Functions | |
DebugPupper< NullPupper > | debug_pupper (std::ostream &out=std::cout) |
DebugPupper wrapping a NullPupper. More... | |
template<typename Pupper > | |
DebugPupper< Pupper > | debug_pupper (Pupper &pupper, std::ostream &out) |
Wraps existing pupper in a DebugPupper. More... | |
template<typename P , typename T > | |
void | do_pup (P &&pupper, T &obj, bool debug) |
template<typename T > | |
T | from_binary (std::istream &in, bool debug=false) |
template<typename T > | |
T | from_json (std::istream &in, bool debug=false) |
template<typename T > | |
T | from_json (const std::string &s, bool debug=false) |
template<typename T > | |
constexpr bool | is_map () |
template<typename T > | |
constexpr bool | is_pup_container () |
template<typename P , typename T > | |
constexpr bool | is_pup_impl () |
template<typename T > | |
constexpr bool | is_pup_iterable () |
template<typename T > | |
constexpr bool | is_puppable () |
std::ostream & | operator<< (std::ostream &out, const JsonReader &reader) |
std::ostream & | operator<< (std::ostream &out, const Meta &meta) |
template<typename T > | |
void | to_binary (T &obj, std::ostream &out, bool debug=false) |
template<typename T > | |
std::string | to_debug (T &object) |
Returns a string representation of object . More... | |
template<typename T > | |
std::string | to_debug (const T &object) |
Returns a string representation of object . More... | |
template<typename T > | |
void | to_json (T &obj, std::ostream &out, bool debug=false) |
template<typename T > | |
std::string | to_json (T &obj, bool debug=false) |
using pupene::BinaryReader = typedef BinaryPupper<std::istream, binary_reader_pup> |
Definition at line 61 of file binary-puppers.h.
using pupene::BinaryWriter = typedef BinaryPupper<std::ostream, binary_writer_pup> |
Definition at line 60 of file binary-puppers.h.
using pupene::enable_if_not_puppable = typedef typename std::enable_if_t<!is_puppable<T>()> |
using pupene::enable_if_pup_iterable = typedef typename std::enable_if_t<is_pup_iterable<T>()> |
using pupene::enable_if_puppable = typedef typename std::enable_if_t<is_puppable<T>()> |
using pupene::enable_if_puppable_container = typedef typename std::enable_if_t<is_pup_container<T>()> |
using pupene::enable_if_puppable_map = typedef typename std::enable_if_t<is_map<T>()> |
using pupene::Type = typedef Meta::Type |
|
strong |
DebugPupper< NullPupper > pupene::debug_pupper | ( | std::ostream & | out | ) |
DebugPupper wrapping a NullPupper.
Definition at line 5 of file debug.cpp.
Referenced by to_debug().
DebugPupper<Pupper> pupene::debug_pupper | ( | Pupper & | pupper, |
std::ostream & | out | ||
) |
Wraps existing pupper
in a DebugPupper.
Adheres to the [PupPolicy] of wrapped pupper.
void pupene::do_pup | ( | P && | pupper, |
T & | obj, | ||
bool | debug | ||
) |
Definition at line 11 of file util.h.
References pupene::Meta::Object.
T pupene::from_binary | ( | std::istream & | in, |
bool | debug = false |
||
) |
Definition at line 11 of file binary.h.
References pupene::BinaryPupper< Stream, PupStream >::BinaryPupper().
T pupene::from_json | ( | std::istream & | in, |
bool | debug = false |
||
) |
Definition at line 12 of file json.h.
References pupene::JsonReader::JsonReader().
T pupene::from_json | ( | const std::string & | s, |
bool | debug = false |
||
) |
constexpr bool pupene::is_pup_container | ( | ) |
constexpr bool pupene::is_pup_impl | ( | ) |
constexpr bool pupene::is_pup_iterable | ( | ) |
constexpr bool pupene::is_puppable | ( | ) |
std::ostream& pupene::operator<< | ( | std::ostream & | out, |
const JsonReader & | reader | ||
) |
Definition at line 47 of file json-puppers.cpp.
std::ostream & pupene::operator<< | ( | std::ostream & | out, |
const Meta & | meta | ||
) |
Definition at line 60 of file json-puppers.cpp.
void pupene::to_binary | ( | T & | obj, |
std::ostream & | out, | ||
bool | debug = false |
||
) |
Definition at line 18 of file binary.h.
References pupene::BinaryPupper< Stream, PupStream >::BinaryPupper().
std::string pupene::to_debug | ( | T & | object | ) |
Returns a string representation of object
.
Definition at line 32 of file debug.h.
References debug_pupper().
std::string pupene::to_debug | ( | const T & | object | ) |
void pupene::to_json | ( | T & | obj, |
std::ostream & | out, | ||
bool | debug = false |
||
) |
Definition at line 25 of file json.h.
References pupene::JsonWriter::JsonWriter().