Traits.hh File Reference

Traits public header. More...

#include <ostream>
#include <boost/type_traits/is_same.hpp>
#include <boost/typeof/typeof.hpp>
#include "Parse.hh"
#include "Traits.ih"
#include "Traits.cci"
#include "Traits.ct"
#include "Traits.cti"
Include dependency graph for Traits.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  senf::console::ArgumentTraits< Type >
 Customize argument parsing. More...
 
struct  senf::console::ReturnValueTraits< Type >
 Customize return value formating. More...
 

Namespaces

 senf
 
 senf::console
 

Macros

#define SENF_CONSOLE_REGISTER_ENUM(Type, Values)   SENF_CONSOLE_REGISTER_ENUM_(BOOST_PP_EMPTY(), BOOST_PP_EMPTY(), Type, Values)
 Register enum type for argument parsing. More...
 
#define SENF_CONSOLE_REGISTER_STRONG_ENUM(Type, Values)   SENF_CONSOLE_REGISTER_ENUM_(BOOST_PP_EMPTY(), Type::, Type, Values)
 
#define SENF_CONSOLE_REGISTER_ENUM_MEMBER(Class, Type, Values)   SENF_CONSOLE_REGISTER_ENUM_(Class::, BOOST_PP_EMPTY(), Type, Values)
 Register enum type for argument parsing. More...
 
#define SENF_CONSOLE_REGISTER_STRONG_ENUM_MEMBER(Class, Type, Values)   SENF_CONSOLE_REGISTER_ENUM_(Class::, Type::, Type, Values)
 
#define SENF_CONSOLE_PARSE_AS_TUPLE(Type, Members)   SENF_CONSOLE_PARSE_AS_TUPLE_(Type, Members)
 
#define SENF_CONSOLE_FORMAT_AS_TUPLE(Type, Members)   SENF_CONSOLE_FORMAT_AS_TUPLE_(Type, Members)
 
#define SENF_CONSOLE_PARSE_AND_FORMAT_AS_TUPLE(Type, Members)
 
#define SENF_CONSOLE_PARSE_AS_MAP(Type, KeyMemberTuples)   SENF_CONSOLE_PARSE_AS_MAP_(Type, KeyMemberTuples)
 
#define SENF_CONSOLE_FORMAT_AS_MAP(Type, KeyMemberTuples)   SENF_CONSOLE_FORMAT_AS_MAP_(Type, KeyMemberTuples)
 
#define SENF_CONSOLE_PARSE_AND_FORMAT_AS_MAP(Type, KeyMemberTuples)
 

Functions

template<class Type >
void senf::console::parse (ParseCommandInfo::TokensRange const &tokens, Type &out)
 Parse token range. More...
 
template<class Type >
std::string senf::console::str (Type const &value)
 Format value. More...
 
template<class Type >
void senf::console::format (Type const &value, std::ostream &os)
 Format return value. More...
 
void senf::console::formatTrueFalse (bool value, std::ostream &os)
 Format boolean value as true / false. More...
 
void senf::console::formatYesNo (bool value, std::ostream &os)
 Format boolean value as yes / no. More...
 
void senf::console::formatEnabledDisabled (bool value, std::ostream &os)
 Format boolean value as enabled / disabled. More...
 
void senf::console::formatOnOff (bool value, std::ostream &os)
 Format boolean value as on / off. More...
 
void senf::console::formatOneZero (bool value, std::ostream &os)
 Format boolean value as 1 / 0. More...
 

Detailed Description

Traits public header.

Definition in file Traits.hh.

Macro Definition Documentation

◆ SENF_CONSOLE_FORMAT_AS_MAP

#define SENF_CONSOLE_FORMAT_AS_MAP (   Type,
  KeyMemberTuples 
)    SENF_CONSOLE_FORMAT_AS_MAP_(Type, KeyMemberTuples)

Definition at line 236 of file Traits.hh.

◆ SENF_CONSOLE_FORMAT_AS_TUPLE

#define SENF_CONSOLE_FORMAT_AS_TUPLE (   Type,
  Members 
)    SENF_CONSOLE_FORMAT_AS_TUPLE_(Type, Members)

Definition at line 226 of file Traits.hh.

◆ SENF_CONSOLE_PARSE_AND_FORMAT_AS_MAP

#define SENF_CONSOLE_PARSE_AND_FORMAT_AS_MAP (   Type,
  KeyMemberTuples 
)
Value:
SENF_CONSOLE_PARSE_AS_MAP_(Type, KeyMemberTuples); \
SENF_CONSOLE_FORMAT_AS_MAP_(Type, KeyMemberTuples);

Definition at line 239 of file Traits.hh.

◆ SENF_CONSOLE_PARSE_AND_FORMAT_AS_TUPLE

#define SENF_CONSOLE_PARSE_AND_FORMAT_AS_TUPLE (   Type,
  Members 
)
Value:
SENF_CONSOLE_PARSE_AS_TUPLE_(Type, Members); \
SENF_CONSOLE_FORMAT_AS_TUPLE_(Type, Members);

Definition at line 229 of file Traits.hh.

◆ SENF_CONSOLE_PARSE_AS_MAP

#define SENF_CONSOLE_PARSE_AS_MAP (   Type,
  KeyMemberTuples 
)    SENF_CONSOLE_PARSE_AS_MAP_(Type, KeyMemberTuples)

Definition at line 233 of file Traits.hh.

◆ SENF_CONSOLE_PARSE_AS_TUPLE

#define SENF_CONSOLE_PARSE_AS_TUPLE (   Type,
  Members 
)    SENF_CONSOLE_PARSE_AS_TUPLE_(Type, Members)

Definition at line 223 of file Traits.hh.

◆ SENF_CONSOLE_REGISTER_STRONG_ENUM

#define SENF_CONSOLE_REGISTER_STRONG_ENUM (   Type,
  Values 
)    SENF_CONSOLE_REGISTER_ENUM_(BOOST_PP_EMPTY(), Type::, Type, Values)

Definition at line 182 of file Traits.hh.

◆ SENF_CONSOLE_REGISTER_STRONG_ENUM_MEMBER

#define SENF_CONSOLE_REGISTER_STRONG_ENUM_MEMBER (   Class,
  Type,
  Values 
)    SENF_CONSOLE_REGISTER_ENUM_(Class::, Type::, Type, Values)

Definition at line 203 of file Traits.hh.