7 #ifndef _MIMETIC_CODEC_OTHER_CODECS_H_
8 #define _MIMETIC_CODEC_OTHER_CODECS_H_
9 #include <mimetic/codec/codec_base.h>
21 template<
typename OutIt>
22 void process(
char c, OutIt& out)
26 const char* name()
const
39 template<
typename OutIt>
40 void process(
char c, OutIt& out)
42 enum { offset =
'A' -
'a' };
43 if(c >=
'a' && c <=
'z')
48 const char* name()
const
61 template<
typename OutIt>
62 void process(
char c, OutIt& out)
64 enum { offset =
'a' -
'A' };
65 if(c >=
'A' && c <=
'Z')
70 const char* name()
const
84 template<
typename OutIt>
85 void process(
char c, OutIt& out)
87 enum { LF = 0xA, CR = 0xD };
95 const char* name()
const
109 : m_max(0), m_written(0)
113 : m_max(m), m_written(0)
116 template<
typename OutIt>
117 void process(
char c, OutIt& out)
119 enum { cr = 0xD, lf = 0xA };
120 if(m_max && m_written++ == m_max)
129 const char* name()
const
134 unsigned int m_max, m_written;
138 template<
typename OutIt>
139 struct oiterator_wrapper:
141 public chainable_codec<oiterator_wrapper<OutIt> >
143 oiterator_wrapper(): m_pOut(0)
146 oiterator_wrapper(OutIt& out): m_pOut(&out)
149 template<
typename OutIt2>
150 void process(
char c, OutIt2& out)
152 **m_pOut = c; ++(*m_pOut);
155 const char* name()
const
157 return "oiterator_wrapper";
Converts any LF (\n) to CRLF (\r\n)
Definition: other_codecs.h:82
Inserts a new line if the input line is too long.
Definition: other_codecs.h:106
Base class for unbuffered codecs.
Definition: codec_base.h:37
Pass through codec. Copies input to output.
Definition: other_codecs.h:19
Converts input chars to lower case.
Definition: other_codecs.h:59
Converts input chars to upper case.
Definition: other_codecs.h:37