32 #ifndef __KMIME_HEADER_PARSING_H__
33 #define __KMIME_HEADER_PARSING_H__
37 #include <tqvaluelist.h>
41 #include <tdemacros.h>
43 template < typename K, typename V> class TQMap;
51 struct TDE_EXPORT TQStringOrTQPair {
52 TQStringOrTQPair() : qstring(), qpair(0,0) {}
54 TQPair<const char*,int> qpair;
57 struct TDE_EXPORT AddrSpec {
58 TQString asString() const;
62 typedef TQValueList<AddrSpec> AddrSpecList;
64 struct TDE_EXPORT Mailbox {
68 typedef TQValueList<Mailbox> MailboxList;
70 struct TDE_EXPORT Address {
72 MailboxList mailboxList;
74 typedef TQValueList<Address> AddressList;
76 struct TDE_EXPORT DateTime {
78 long int secsEastOfGMT;
84 namespace HeaderParsing {
100 bool parseEncodedWord( const char* & scursor, const char * const send,
101 TQString & result, TQCString & language ) TDE_EXPORT;
108 bool parseAtom( const char* & scursor, const char * const send,
109 TQString & result, bool allow8Bit= false ) TDE_EXPORT;
110 bool parseAtom( const char* & scursor, const char * const send,
111 TQPair<const char*, int> & result, bool allow8Bit=false ) TDE_EXPORT;
114 bool parseToken( const char* & scursor, const char * const send,
115 TQString & result, bool allow8Bit=false ) TDE_EXPORT;
116 bool parseToken( const char* & scursor, const char * const send,
117 TQPair<const char*, int> & result, bool allow8Bit=false ) TDE_EXPORT;
119 bool parseGenericQuotedString( const char* & scursor, const char* const send,
120 TQString & result, bool isCRLF,
121 const char openChar='"',
122 const char closeChar='"' ) TDE_EXPORT;
124 bool parseComment( const char* & scursor, const char * const send,
125 TQString & result, bool isCRLF=false, bool reallySave=true ) TDE_EXPORT;
131 bool parsePhrase( const char* & scursor, const char * const send,
132 TQString & result, bool isCRLF=false ) TDE_EXPORT;
135 bool parseDotAtom( const char* & scursor, const char * const send,
136 TQString & result, bool isCRLF=false ) TDE_EXPORT;
147 void eatCFWS( const char* & scursor, const char * const send, bool isCRLF ) TDE_EXPORT;
149 bool parseDomain( const char* & scursor, const char * const send,
150 TQString & result, bool isCRLF=false ) TDE_EXPORT;
151 bool parseObsRoute( const char* & scursor, const char * const send,
152 TQStringList & result,
153 bool isCRLF=false, bool save=false ) TDE_EXPORT;
154 bool parseAddrSpec( const char* & scursor, const char * const send,
155 Types::AddrSpec & result, bool isCRLF=false ) TDE_EXPORT;
156 bool parseAngleAddr( const char* & scursor, const char * const send,
157 Types::AddrSpec & result, bool isCRLF=false ) TDE_EXPORT;
158 bool parseMailbox( const char* & scursor, const char * const send,
159 Types::Mailbox & result, bool isCRLF=false ) TDE_EXPORT;
160 bool parseGroup( const char* & scursor, const char * const send,
161 Types::Address & result, bool isCRLF=false ) TDE_EXPORT;
162 bool parseAddress( const char* & scursor, const char * const send,
163 Types::Address & result, bool isCRLF=false ) TDE_EXPORT;
164 bool parseAddressList( const char* & scursor, const char * const send,
165 Types::AddressList & result, bool isCRLF=false ) TDE_EXPORT;
167 bool parseParameter( const char* & scursor, const char * const send,
168 TQPair<TQString,Types::TQStringOrTQPair> & result,
169 bool isCRLF=false ) TDE_EXPORT;
170 bool parseParameterList( const char* & scursor, const char * const send,
171 TQMap<TQString,TQString> & result, bool isCRLF=false ) TDE_EXPORT;
173 bool parseRawParameterList( const char* & scursor, const char * const send,
174 TQMap<TQString,Types::TQStringOrTQPair> & result,
175 bool isCRLF=false ) TDE_EXPORT;
177 bool parseTime( const char* & scursor, const char * const send,
178 int & hour, int & min, int & sec, long int & secsEastOfGMT,
179 bool & timeZoneKnown, bool isCRLF=false ) TDE_EXPORT;
181 bool parseDateTime( const char* & scursor, const char * const send,
182 Types::DateTime & result, bool isCRLF=false ) TDE_EXPORT;
185 bool tryToMakeAnySenseOfDateString( const char* & scursor,
186 const char * const send,
187 time_t & result, bool isCRLF= false );
|