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/StringConv.cpp | |
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/StringConv.cpp')
-rw-r--r-- | protocols/Twitter/StringConv.cpp | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/protocols/Twitter/StringConv.cpp b/protocols/Twitter/StringConv.cpp deleted file mode 100644 index c0e4f9221c..0000000000 --- a/protocols/Twitter/StringConv.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/*
-
-Copyright (c) 2010 Brook Miles
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-*/
-
-#include <windows.h>
-#include <string>
-#include "StringConv.h"
-
-std::string WideToMB(const std::wstring& str, UINT codePage)
-{
- std::string ret;
- if(str.length() > 0)
- {
- DWORD mbChars = WideCharToMultiByte(codePage, 0, str.c_str(), -1, NULL, 0, NULL, NULL);
- _ASSERTE(mbChars > 0);
- if(mbChars > 0)
- {
- char* buf = new char[mbChars];
- _ASSERTE( buf != NULL );
- if( buf != NULL )
- {
- ZeroMemory(buf, mbChars);
-
- DWORD charsConverted = WideCharToMultiByte(codePage, 0, str.c_str(), -1, buf, mbChars, NULL, NULL);
- _ASSERTE( charsConverted > 0 );
- _ASSERTE( charsConverted <= mbChars );
-
- buf[mbChars - 1] = 0;
- ret = buf;
-
- delete[] buf;
- }
- }
- }
- return ret;
-}
-
-std::wstring MBToWide(const std::string& str, UINT codePage)
-{
- std::wstring ret;
- if(str.length() > 0)
- {
- DWORD wChars = MultiByteToWideChar(codePage, 0, str.c_str(), -1, NULL, 0);
- _ASSERTE(wChars > 0);
- if(wChars > 0)
- {
- wchar_t* buf = new wchar_t[wChars];
- _ASSERTE( buf != NULL );
- if( buf != NULL )
- {
- size_t bytesNeeded = sizeof(wchar_t)*wChars;
- ZeroMemory(buf, bytesNeeded);
-
- DWORD charsConverted = MultiByteToWideChar(codePage, 0, str.c_str(), -1, buf, wChars);
- _ASSERTE( charsConverted > 0 );
- _ASSERTE( charsConverted <= wChars );
-
- buf[wChars - 1] = 0;
- ret = buf;
-
- delete[] buf;
- }
- }
- }
- return ret;
-}
-
|