diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-10-13 18:34:25 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-10-13 18:34:25 +0000 |
commit | 1a9f50fcbc79413ccc669349b682aa6a6ebb398b (patch) | |
tree | a7673155e97d56f5714a5f9cb3e74f941e961346 /protocols/Twitter/src/Base64Coder.h | |
parent | 5aa2a6fdad72feeff99041bfdf17fd607a45033a (diff) |
Twitter: folders restructurization
git-svn-id: http://svn.miranda-ng.org/main/trunk@1909 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Twitter/src/Base64Coder.h')
-rw-r--r-- | protocols/Twitter/src/Base64Coder.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/protocols/Twitter/src/Base64Coder.h b/protocols/Twitter/src/Base64Coder.h new file mode 100644 index 0000000000..d65868070e --- /dev/null +++ b/protocols/Twitter/src/Base64Coder.h @@ -0,0 +1,69 @@ +// Base64Coder.h: interface for the Base64Coder class.
+// http://support.microsoft.com/kb/191239
+//////////////////////////////////////////////////////////////////////
+
+#if !defined(AFX_BASE64CODER_H__B2E45717_0625_11D2_A80A_00C04FB6794C__INCLUDED_)
+#define AFX_BASE64CODER_H__B2E45717_0625_11D2_A80A_00C04FB6794C__INCLUDED_
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#ifdef _AFXDLL
+ #include <afx.h>
+ typedef CString String;
+#else
+ #include <windows.h>
+ #include <string>
+ typedef std::string String;
+#endif
+
+class Base64Coder
+{
+ // Internal bucket class.
+ class TempBucket
+ {
+ public:
+ BYTE nData[4];
+ BYTE nSize;
+ void Clear() { ::ZeroMemory(nData, 4); nSize = 0; };
+ };
+
+ PBYTE m_pDBuffer;
+ PBYTE m_pEBuffer;
+ DWORD m_nDBufLen;
+ DWORD m_nEBufLen;
+ DWORD m_nDDataLen;
+ DWORD m_nEDataLen;
+
+public:
+ Base64Coder();
+ virtual ~Base64Coder();
+
+public:
+ virtual void Encode(const PBYTE, DWORD);
+ virtual void Decode(const PBYTE, DWORD);
+ //virtual void Encode(LPCSTR sMessage);
+ //virtual void Decode(LPCSTR sMessage);
+
+ virtual LPCSTR DecodedMessage() const;
+ virtual LPCSTR EncodedMessage() const;
+
+ virtual void AllocEncode(DWORD);
+ virtual void AllocDecode(DWORD);
+ virtual void SetEncodeBuffer(const PBYTE pBuffer, DWORD nBufLen);
+ virtual void SetDecodeBuffer(const PBYTE pBuffer, DWORD nBufLen);
+
+protected:
+ virtual void _EncodeToBuffer(const TempBucket &Decode, PBYTE pBuffer);
+ virtual ULONG _DecodeToBuffer(const TempBucket &Decode, PBYTE pBuffer);
+ virtual void _EncodeRaw(TempBucket &, const TempBucket &);
+ virtual void _DecodeRaw(TempBucket &, const TempBucket &);
+ virtual BOOL _IsBadMimeChar(BYTE);
+
+ static char m_DecodeTable[256];
+ static BOOL m_Init;
+ void _Init();
+};
+
+#endif // !defined(AFX_BASE64CODER_H__B2E45717_0625_11D2_A80A_00C04FB6794C__INCLUDED_)
|