diff options
Diffstat (limited to 'doc/html/decodeRFC2047_8cpp-source.html')
-rw-r--r-- | doc/html/decodeRFC2047_8cpp-source.html | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/doc/html/decodeRFC2047_8cpp-source.html b/doc/html/decodeRFC2047_8cpp-source.html index 50d2f7b..6e1d556 100644 --- a/doc/html/decodeRFC2047_8cpp-source.html +++ b/doc/html/decodeRFC2047_8cpp-source.html @@ -39,9 +39,9 @@ <a name="l00022"></a>00022 <span class="comment"> * These functions have been adapted from the KMail program</span> <a name="l00023"></a>00023 <span class="comment"> */</span> <a name="l00024"></a>00024 -<a name="l00025"></a>00025 QCString decodeQuotedPrintable(<span class="keyword">const</span> QCString& aStr) +<a name="l00025"></a>00025 TQCString decodeQuotedPrintable(<span class="keyword">const</span> TQCString& aStr) <a name="l00026"></a>00026 { -<a name="l00027"></a>00027 QCString bStr = aStr; +<a name="l00027"></a>00027 TQCString bStr = aStr; <a name="l00028"></a>00028 <span class="keywordflow">if</span> (aStr.isNull()) <a name="l00029"></a>00029 bStr = <span class="stringliteral">""</span>; <a name="l00030"></a>00030 @@ -52,44 +52,44 @@ <a name="l00035"></a>00035 <span class="keywordflow">return</span> dwdest.c_str(); <a name="l00036"></a>00036 } <a name="l00037"></a>00037 -<a name="l00038"></a>00038 QCString decodeBase64(<span class="keyword">const</span> QCString& aStr) +<a name="l00038"></a>00038 TQCString decodeBase64(<span class="keyword">const</span> TQCString& aStr) <a name="l00039"></a>00039 { -<a name="l00040"></a>00040 QCString bStr = aStr; +<a name="l00040"></a>00040 TQCString bStr = aStr; <a name="l00041"></a>00041 <span class="keywordflow">if</span> (aStr.isNull()) <a name="l00042"></a>00042 bStr = <span class="stringliteral">""</span>; <a name="l00043"></a>00043 <span class="keywordflow">while</span> (bStr.length() < 16) bStr += <span class="stringliteral">"="</span>; <a name="l00044"></a>00044 <a name="l00045"></a>00045 DwString dwsrc(bStr.data(), bStr.length()); <a name="l00046"></a>00046 DwString dwdest; -<a name="l00047"></a>00047 QCString result; +<a name="l00047"></a>00047 TQCString result; <a name="l00048"></a>00048 <a name="l00049"></a>00049 DwDecodeBase64(dwsrc, dwdest); <a name="l00050"></a>00050 result = dwdest.c_str(); <a name="l00051"></a>00051 <span class="keywordflow">return</span> result; <a name="l00052"></a>00052 } <a name="l00053"></a>00053 -<a name="l00054"></a>00054 QTextCodec* codecForName(<span class="keyword">const</span> QCString& _str) +<a name="l00054"></a>00054 TQTextCodec* codecForName(<span class="keyword">const</span> TQCString& _str) <a name="l00055"></a>00055 { <a name="l00056"></a>00056 <span class="keywordflow">if</span> (_str.isEmpty()) <span class="keywordflow">return</span> NULL; <a name="l00057"></a>00057 <span class="keywordflow">if</span> (_str.lower() == <span class="stringliteral">"shift_jis"</span> || _str.lower() == <span class="stringliteral">"shift-jis"</span>) -<a name="l00058"></a>00058 <span class="keywordflow">return</span> QTextCodec::codecForName(<span class="stringliteral">"sjis"</span>); -<a name="l00059"></a>00059 <span class="keywordflow">return</span> QTextCodec::codecForName(_str.lower().replace( -<a name="l00060"></a>00060 QRegExp(<span class="stringliteral">"windows"</span>), <span class="stringliteral">"cp"</span>) ); +<a name="l00058"></a>00058 <span class="keywordflow">return</span> TQTextCodec::codecForName(<span class="stringliteral">"sjis"</span>); +<a name="l00059"></a>00059 <span class="keywordflow">return</span> TQTextCodec::codecForName(_str.lower().replace( +<a name="l00060"></a>00060 TQRegExp(<span class="stringliteral">"windows"</span>), <span class="stringliteral">"cp"</span>) ); <a name="l00061"></a>00061 } <a name="l00062"></a>00062 -<a name="l00063"></a><a class="code" href="namespaceCodecs.html#a0ef7c083708a464b1f1357ba5470cde">00063</a> QString <a class="code" href="namespaceCodecs.html#a0ef7c083708a464b1f1357ba5470cde">Codecs::decodeRFC2047</a>(<span class="keyword">const</span> QCString& aStr) +<a name="l00063"></a><a class="code" href="namespaceCodecs.html#a0ef7c083708a464b1f1357ba5470cde">00063</a> TQString <a class="code" href="namespaceCodecs.html#a0ef7c083708a464b1f1357ba5470cde">Codecs::decodeRFC2047</a>(<span class="keyword">const</span> TQCString& aStr) <a name="l00064"></a>00064 { -<a name="l00065"></a>00065 QString result; -<a name="l00066"></a>00066 QCString charset; +<a name="l00065"></a>00065 TQString result; +<a name="l00066"></a>00066 TQCString charset; <a name="l00067"></a>00067 <span class="keywordtype">char</span> *pos, *beg, *end, *mid; -<a name="l00068"></a>00068 QCString str, cstr, LWSP_buffer; +<a name="l00068"></a>00068 TQCString str, cstr, LWSP_buffer; <a name="l00069"></a>00069 <span class="keywordtype">char</span> encoding, ch; <a name="l00070"></a>00070 <span class="keywordtype">bool</span> valid, lastWasEncodedWord=FALSE; <a name="l00071"></a>00071 <span class="keyword">const</span> <span class="keywordtype">int</span> maxLen=200; <a name="l00072"></a>00072 <span class="keywordtype">int</span> i; <a name="l00073"></a>00073 <a name="l00074"></a>00074 <span class="keywordflow">if</span> (aStr.find(<span class="stringliteral">"=?"</span>) < 0) -<a name="l00075"></a>00075 <span class="keywordflow">return</span> QString::fromLocal8Bit(aStr).replace(QRegExp(<span class="stringliteral">"\n[\t ]"</span>),<span class="stringliteral">" "</span>); +<a name="l00075"></a>00075 <span class="keywordflow">return</span> TQString::fromLocal8Bit(aStr).replace(TQRegExp(<span class="stringliteral">"\n[\t ]"</span>),<span class="stringliteral">" "</span>); <a name="l00076"></a>00076 <a name="l00077"></a>00077 <span class="keywordflow">for</span> (pos=aStr.data(); *pos; pos++) <a name="l00078"></a>00078 { @@ -155,7 +155,7 @@ <a name="l00138"></a>00138 <span class="comment">// valid encoding: decode and throw away separating LWSP</span> <a name="l00139"></a>00139 ch = *pos; <a name="l00140"></a>00140 *pos = <span class="charliteral">'\0'</span>; -<a name="l00141"></a>00141 str = QCString(mid).left((<span class="keywordtype">int</span>)(mid - pos - 1)); +<a name="l00141"></a>00141 str = TQCString(mid).left((<span class="keywordtype">int</span>)(mid - pos - 1)); <a name="l00142"></a>00142 <span class="keywordflow">if</span> (encoding == <span class="charliteral">'Q'</span>) <a name="l00143"></a>00143 { <a name="l00144"></a>00144 <span class="comment">// decode quoted printable text</span> @@ -169,13 +169,13 @@ <a name="l00152"></a>00152 <span class="comment">// decode base64 text</span> <a name="l00153"></a>00153 cstr = decodeBase64(str); <a name="l00154"></a>00154 } -<a name="l00155"></a>00155 QTextCodec *codec = codecForName(charset); +<a name="l00155"></a>00155 TQTextCodec *codec = codecForName(charset); <a name="l00156"></a>00156 <span class="keywordflow">if</span> (!codec) -<a name="l00157"></a>00157 codec = codecForName(KGlobal::locale()->encoding()); +<a name="l00157"></a>00157 codec = codecForName(TDEGlobal::locale()->encoding()); <a name="l00158"></a>00158 <span class="keywordflow">if</span> (codec) <a name="l00159"></a>00159 result += codec->toUnicode(cstr); <a name="l00160"></a>00160 <span class="keywordflow">else</span> -<a name="l00161"></a>00161 result += QString::fromLocal8Bit(cstr); +<a name="l00161"></a>00161 result += TQString::fromLocal8Bit(cstr); <a name="l00162"></a>00162 lastWasEncodedWord = TRUE; <a name="l00163"></a>00163 <a name="l00164"></a>00164 *pos = ch; |