diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2012-09-07 16:38:44 +0200 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2012-09-07 16:38:44 +0200 |
commit | 26310b6ff3b4cb92cc9bb462536a9c5235fc3389 (patch) | |
tree | eb7cb931ba1c512b217ae138eafb4776a9c614e2 /src/libcrawler | |
parent | 4cb96d5377df049bd49bb6c0a109d89fcbd015ff (diff) | |
download | crawler-26310b6ff3b4cb92cc9bb462536a9c5235fc3389.tar.gz crawler-26310b6ff3b4cb92cc9bb462536a9c5235fc3389.tar.bz2 |
added a libutil for porting stuff and helpers
Diffstat (limited to 'src/libcrawler')
-rwxr-xr-x | src/libcrawler/win32/errormsg.cpp | 27 | ||||
-rwxr-xr-x | src/libcrawler/win32/stringutils.cpp | 21 |
2 files changed, 0 insertions, 48 deletions
diff --git a/src/libcrawler/win32/errormsg.cpp b/src/libcrawler/win32/errormsg.cpp deleted file mode 100755 index c0a65d8..0000000 --- a/src/libcrawler/win32/errormsg.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "win32/errormsg.hpp" - -using namespace std; - -#define WIN32_MEAN_AND_LEAN -#include <windows.h> - -string getLastError( ) -{ - LPTSTR buf; - DWORD size; - - DWORD lastErr = GetLastError( ); - - if( !FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS | - FORMAT_MESSAGE_MAX_WIDTH_MASK, - NULL, lastErr, 0, (LPTSTR)&buf, - 0, NULL ) ) { - return "<no message available>"; - } - - return string( buf ); -} - diff --git a/src/libcrawler/win32/stringutils.cpp b/src/libcrawler/win32/stringutils.cpp deleted file mode 100755 index 607735c..0000000 --- a/src/libcrawler/win32/stringutils.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "win32/stringutils.hpp" - -using namespace std; - -#define WIN32_MEAN_AND_LEAN -#include <windows.h> - -std::wstring s2ws( const std::string &s ) -{ - // get size for buffer and allocate it - int len; - int slength = (int)s.length( )+1; - len = MultiByteToWideChar( CP_ACP, 0, s.c_str( ), slength, 0, 0 ); - wchar_t *buf = new wchar_t[len]; - - // convert - MultiByteToWideChar( CP_ACP, 0, s.c_str( ), slength, buf, len ); - std::wstring res( buf ); - delete[] buf; - return res; -} |