Main Page   Class Hierarchy   Alphabetical List   Compound List   Examples  
Public Types | Public Member Functions | Public Attributes | List of all members
codec_chain< C, N > Struct Template Reference

Defines a chain of codecs. More...

#include <codec_chain.h>

Public Types

enum  { count = 1 + next_node_type::count }
 
typedef codec_chain< C, N > self_type
 
typedef C content_type
 
typedef N next_node_type
 

Public Member Functions

 codec_chain (const content_type &c)
 
 codec_chain (const content_type &c, const next_node_type &node)
 
 codec_chain (const codec_chain &node)
 
 codec_chain (const null_node &)
 
const char * name () const
 
void process (char c)
 
void flush ()
 
template<typename Cn >
const Cn & get_c (int idx) const
 
const content_type & get_c (int idx) const
 
template<typename C1 >
const C1 & operator[] (int idx) const
 
self_typeoperator* ()
 
self_typeoperator= (char c)
 
self_typeoperator++ ()
 
self_typeoperator++ (int)
 
template<typename TailC >
push_back_node< self_type,
codec_chain< TailC >
>::node_type 
operator| (const TailC &l)
 

Public Attributes

content_type m_c
 
next_node_type m_next
 
std::string m_name
 

Detailed Description

template<typename C, typename N = null_node>
struct mimetic::codec_chain< C, N >

Defines a chain of codecs.

Chain of codecs. Don't use it directly use | operator instead.

// converts test string to upper case, replaces LF chars with
// CRLF and encodes it using quoted-printable codec
ToUpperCase tuc;
Lf2CrLf l2c;
QP::Encoder qp;
char buf[MAXLEN];
string test("....some text here....");
code(test.begin(), test.end(), tuc | l2c | qp, buf);
Warning
Chainable codecs must derive from chainable_codec<>
See Also
encode decode

The documentation for this struct was generated from the following file: