boost::converter_codecvt
// In header: <boost/iterator/converter_codecvt.hpp> template<typename InternT, typename B1, typename P1, typename B2, typename P2> struct converter_codecvt { // types typedef InternT intern_type; typedef P1::output_type extern_type; typedef std::mbstate_t state_type; // member classes/structs/unions struct state_t { intern_type pending_data; size_t pending_size; }; // construct/copy/destruct converter_codecvt(const B1 & = B1(), const P1 & = P1(), const B2 & = B2(), const P2 & = P2(), std::size_t = 0); // public member functions BOOST_CONCEPT_ASSERT((BoundaryCheckerConcept< B1 >)); BOOST_CONCEPT_ASSERT((ConverterConcept< P1 >)); BOOST_CONCEPT_ASSERT((BoundaryCheckerConcept< B2 >)); BOOST_CONCEPT_ASSERT((ConverterConcept< P2 >)); BOOST_CONCEPT_ASSERT((Convertible< InternT, typename P1::input_type >)); BOOST_CONCEPT_ASSERT((Convertible< typename P2::output_type, InternT >)); // protected member functions std::codecvt_base::result do_in(state_type &, const extern_type *, const extern_type *, const extern_type *&, intern_type *, intern_type *, intern_type *&) const; std::codecvt_base::result do_out(state_type &, const intern_type *, const intern_type *, const intern_type *&, extern_type *, extern_type *, extern_type *&) const; bool do_always_noconv() const; std::codecvt_base::result do_unshift(state_type &, extern_type *, extern_type *, extern_type *&) const; int do_encoding() const; int do_length(state_type &, const extern_type *, const extern_type *, std::size_t) const; int do_max_length() const; };
Builds a codecvt facet from two Converters
and two BoundaryCheckers
. When writing to a file, P1
is applied for segments of data on which B1
is true at the beginning and at the end. When reading a file, P2
is applied for segments of data on which B2
is true at the beginning and at the end.
converter_codecvt
public member functionsBOOST_CONCEPT_ASSERT((BoundaryCheckerConcept< B1 >));
BOOST_CONCEPT_ASSERT((ConverterConcept< P1 >));
BOOST_CONCEPT_ASSERT((BoundaryCheckerConcept< B2 >));
BOOST_CONCEPT_ASSERT((ConverterConcept< P2 >));
BOOST_CONCEPT_ASSERT((Convertible< InternT, typename P1::input_type >));
BOOST_CONCEPT_ASSERT((Convertible< typename P2::output_type, InternT >));
converter_codecvt
protected member functionsstd::codecvt_base::result do_in(state_type & state, const extern_type * from, const extern_type * from_end, const extern_type *& from_next, intern_type * to, intern_type * to_end, intern_type *& to_next) const;
std::codecvt_base::result do_out(state_type & state, const intern_type * from, const intern_type * from_end, const intern_type *& from_next, extern_type * to, extern_type * to_end, extern_type *& to_next) const;
bool do_always_noconv() const;
std::codecvt_base::result do_unshift(state_type & state, extern_type * to, extern_type * to_end, extern_type *& to_next) const;
int do_encoding() const;
int do_length(state_type &, const extern_type * from, const extern_type * from_end, std::size_t max_limit) const;
int do_max_length() const;