Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

Struct template cnvbase

boost::cnv::cnvbase

Synopsis

// In header: <boost/convert/base.hpp>

template<typename derived_type> 
struct cnvbase {
  // types
  typedef cnvbase                this_type;  
  typedef int                    int_type;   
  typedef unsigned int           uint_type;  
  typedef long int               lint_type;  
  typedef unsigned long int      ulint_type; 
  typedef short int              sint_type;  
  typedef unsigned short int     usint_type; 
  typedef long long int          llint_type; 
  typedef unsigned long long int ullint_type;
  typedef float                  flt_type;   
  typedef double                 dbl_type;   
  typedef long double            ldbl_type;  

  // construct/copy/destruct
  cnvbase() = default;

  // public member functions
  template<typename type_in, typename type_out> 
    void operator()(type_in const &, boost::optional< type_out > &) const;
   BOOST_CNV_TO_STRING(int_type, optional< string_type > &) const;
   BOOST_CNV_TO_STRING(uint_type, optional< string_type > &) const;
   BOOST_CNV_TO_STRING(lint_type, optional< string_type > &) const;
   BOOST_CNV_TO_STRING(llint_type, optional< string_type > &) const;
   BOOST_CNV_TO_STRING(ulint_type, optional< string_type > &) const;
   BOOST_CNV_TO_STRING(ullint_type, optional< string_type > &) const;
   BOOST_CNV_TO_STRING(sint_type, optional< string_type > &) const;
   BOOST_CNV_TO_STRING(usint_type, optional< string_type > &) const;
   BOOST_CNV_TO_STRING(flt_type, optional< string_type > &) const;
   BOOST_CNV_TO_STRING(dbl_type, optional< string_type > &) const;
   BOOST_CNV_TO_STRING(ldbl_type, optional< string_type > &) const;
   BOOST_CNV_STRING_TO(string_type const &, optional< int_type > &) const;
   BOOST_CNV_STRING_TO(string_type const &, optional< uint_type > &) const;
   BOOST_CNV_STRING_TO(string_type const &, optional< lint_type > &) const;
   BOOST_CNV_STRING_TO(string_type const &, optional< llint_type > &) const;
   BOOST_CNV_STRING_TO(string_type const &, optional< ulint_type > &) const;
   BOOST_CNV_STRING_TO(string_type const &, optional< ullint_type > &) const;
   BOOST_CNV_STRING_TO(string_type const &, optional< sint_type > &) const;
   BOOST_CNV_STRING_TO(string_type const &, optional< usint_type > &) const;
   BOOST_CNV_STRING_TO(string_type const &, optional< flt_type > &) const;
   BOOST_CNV_STRING_TO(string_type const &, optional< dbl_type > &) const;
   BOOST_CNV_STRING_TO(string_type const &, optional< ldbl_type > &) const;
  template<typename argument_pack> 
    std::enable_if< boost::parameter::is_argument_pack< argument_pack >::value, derived_type & >::type 
    operator()(argument_pack const &);

  // protected member functions
  template<typename string_type, typename out_type> 
    void str_to_(string_type const &, optional< out_type > &) const;
  template<typename in_type, typename string_type> 
    void to_str_(in_type, optional< string_type > &) const;
  derived_type const  & dncast() const;
  derived_type & dncast();
  template<typename argument_pack, typename keyword_tag> 
    void set_(argument_pack const &, keyword_tag, mpl::false_);
   BOOST_CNV_PARAM_SET(base);
   BOOST_CNV_PARAM_SET(adjust);
   BOOST_CNV_PARAM_SET(precision);
   BOOST_CNV_PARAM_SET(uppercase);
   BOOST_CNV_PARAM_SET(skipws);
   BOOST_CNV_PARAM_SET(width);
   BOOST_CNV_PARAM_SET(fill);
   BOOST_CNV_PARAM_SET(notation);
};

Description

cnvbase public construct/copy/destruct

  1. cnvbase() = default;

cnvbase public member functions

  1. template<typename type_in, typename type_out> 
      void operator()(type_in const & in, boost::optional< type_out > & out) const;
  2.  BOOST_CNV_TO_STRING(int_type v, optional< string_type > & r) const;
  3.  BOOST_CNV_TO_STRING(uint_type v, optional< string_type > & r) const;
  4.  BOOST_CNV_TO_STRING(lint_type v, optional< string_type > & r) const;
  5.  BOOST_CNV_TO_STRING(llint_type v, optional< string_type > & r) const;
  6.  BOOST_CNV_TO_STRING(ulint_type v, optional< string_type > & r) const;
  7.  BOOST_CNV_TO_STRING(ullint_type v, optional< string_type > & r) const;
  8.  BOOST_CNV_TO_STRING(sint_type v, optional< string_type > & r) const;
  9.  BOOST_CNV_TO_STRING(usint_type v, optional< string_type > & r) const;
  10.  BOOST_CNV_TO_STRING(flt_type v, optional< string_type > & r) const;
  11.  BOOST_CNV_TO_STRING(dbl_type v, optional< string_type > & r) const;
  12.  BOOST_CNV_TO_STRING(ldbl_type v, optional< string_type > & r) const;
  13.  BOOST_CNV_STRING_TO(string_type const & s, optional< int_type > & r) const;
  14.  BOOST_CNV_STRING_TO(string_type const & s, optional< uint_type > & r) const;
  15.  BOOST_CNV_STRING_TO(string_type const & s, optional< lint_type > & r) const;
  16.  BOOST_CNV_STRING_TO(string_type const & s, optional< llint_type > & r) const;
  17.  BOOST_CNV_STRING_TO(string_type const & s, optional< ulint_type > & r) const;
  18.  BOOST_CNV_STRING_TO(string_type const & s, optional< ullint_type > & r) const;
  19.  BOOST_CNV_STRING_TO(string_type const & s, optional< sint_type > & r) const;
  20.  BOOST_CNV_STRING_TO(string_type const & s, optional< usint_type > & r) const;
  21.  BOOST_CNV_STRING_TO(string_type const & s, optional< flt_type > & r) const;
  22.  BOOST_CNV_STRING_TO(string_type const & s, optional< dbl_type > & r) const;
  23.  BOOST_CNV_STRING_TO(string_type const & s, optional< ldbl_type > & r) const;
  24. template<typename argument_pack> 
      std::enable_if< boost::parameter::is_argument_pack< argument_pack >::value, derived_type & >::type 
      operator()(argument_pack const & arg);

cnvbase protected member functions

  1. template<typename string_type, typename out_type> 
      void str_to_(string_type const & str, optional< out_type > & result_out) const;
  2. template<typename in_type, typename string_type> 
      void to_str_(in_type value_in, optional< string_type > & result_out) const;
  3. derived_type const  & dncast() const;
  4. derived_type & dncast();
  5. template<typename argument_pack, typename keyword_tag> 
      void set_(argument_pack const &, keyword_tag, mpl::false_);
  6.  BOOST_CNV_PARAM_SET(base);
  7.  BOOST_CNV_PARAM_SET(adjust);
  8.  BOOST_CNV_PARAM_SET(precision);
  9.  BOOST_CNV_PARAM_SET(uppercase);
  10.  BOOST_CNV_PARAM_SET(skipws);
  11.  BOOST_CNV_PARAM_SET(width);
  12.  BOOST_CNV_PARAM_SET(fill);
  13.  BOOST_CNV_PARAM_SET(notation);

PrevUpHomeNext