![]() |
Shadowrun: Awakened 29 September 2011 - Build 871
|
#include "stdafx.h"#include <stdio.h>#include <stdlib.h>#include <iostream>#include <map>#include <memory>#include <cppconn/driver.h>#include <cppconn/exception.h>#include <cppconn/resultset.h>#include <cppconn/statement.h>#include <cppconn/prepared_statement.h>#include "DbConnectionFactory.h"#include "DbProcedures.h"
Include dependency graph for UScriptDbProcedures.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Functions | |
| __declspec (dllexport) void clearCharQuality(int pInCharId | |
| INLINE std::string | convertString (wchar_t *string) |
| INLINE wchar_t * | convertString (const std::string &string) |
| __declspec | ( | dllexport | ) |
| INLINE std::string convertString | ( | wchar_t * | string | ) |
Converts from a wchar_t* to std::string instance
Definition at line 23 of file UScriptDbProcedures.h.
{
size_t size = wcslen(string);
size_t outCharCount;
char *buf = new char[size];
wcstombs_s(&outCharCount, buf, size, string, size);
std::string ret(buf);
delete[] buf;
return ret;
}
| INLINE wchar_t* convertString | ( | const std::string & | string | ) |
Converts from a std::string to wchar_t* instance
Definition at line 37 of file UScriptDbProcedures.h.
{
//the memory allocated here should theoretically be managed by the DLLBind mechanism, so there is no corresponding delete
//If at a later time, we find a memory leak in the applicable, this could be it.
wchar_t *ret = new wchar_t[string.size()];
size_t size = (size_t)string.size();
size_t outCharCount;
mbstowcs_s(&outCharCount, ret, size, string.c_str(),size);
return ret;
}
Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.