never used and never worked for us.
#undef _IRR_COMPILE_WITH_GUI_\r
#endif\r
\r
-//! Define _IRR_WCHAR_FILESYSTEM to enable unicode filesystem support for the engine.\r
-/** This enables the engine to read/write from unicode filesystem. If you\r
-disable this feature, the engine behave as before (ansi). This is currently only supported\r
-for Windows based systems. You also have to set #define UNICODE for this to compile.\r
-*/\r
-//#define _IRR_WCHAR_FILESYSTEM\r
-#ifdef NO_IRR_WCHAR_FILESYSTEM\r
-#undef _IRR_WCHAR_FILESYSTEM\r
-#endif\r
-\r
//! Define _IRR_COMPILE_WITH_LIBJPEG_ to enable compiling the engine using libjpeg.\r
/** This enables the engine to read jpeg images. If you comment this out,\r
the engine will no longer read .jpeg images. */\r
\r
#endif // _IRR_WINDOWS_API_\r
\r
-#ifndef _IRR_WINDOWS_API_\r
- #undef _IRR_WCHAR_FILESYSTEM\r
-#endif\r
-\r
#if defined(_IRR_SOLARIS_PLATFORM_)\r
#undef _IRR_COMPILE_WITH_JOYSTICK_EVENTS_\r
#endif\r
#define swprintf_irr _snwprintf\r
#define snprintf_irr _snprintf\r
#endif\r
-\r
-// define the wchar_t type if not already built in.\r
-#ifdef _MSC_VER\r
-#ifndef _WCHAR_T_DEFINED\r
-//! A 16 bit wide character type.\r
-/**\r
- Defines the wchar_t-type.\r
- In VS6, its not possible to tell\r
- the standard compiler to treat wchar_t as a built-in type, and\r
- sometimes we just don't want to include the huge stdlib.h or wchar.h,\r
- so we'll use this.\r
-*/\r
-typedef unsigned short wchar_t;\r
-#define _WCHAR_T_DEFINED\r
-#endif // wchar is not defined\r
-#endif // microsoft compiler\r
#else\r
#define swprintf_irr swprintf\r
#define snprintf_irr snprintf\r
{\r
\r
//! Type name for character type used by the file system.\r
-/** Should the wide character version of the FileSystem be used it is a\r
-16 bit character variable. Used for Unicode Filesystem and Unicode strings.\r
-Else it is a 8 bit character variable. Used for ansi Filesystem and non-unicode\r
-strings\r
-*/\r
-#if defined(_IRR_WCHAR_FILESYSTEM)\r
- typedef wchar_t fschar_t;\r
- #define _IRR_TEXT(X) L##X\r
-#else\r
typedef char fschar_t;\r
#define _IRR_TEXT(X) X\r
-#endif\r
\r
} // end namespace irr\r
\r
//! \return An io::path string containing the properly encoded string.
io::path toPATH_s(const unicode::EUTF_ENDIAN endian = unicode::EUTFEE_NATIVE, const bool addBOM = false) const
{
-#if defined(_IRR_WCHAR_FILESYSTEM)
- return toWCHAR_s(endian, addBOM);
-#else
return toUTF8_s(addBOM);
-#endif
}
//! Loads an unknown stream of data.
{\r
#if defined(_IRR_WINDOWS_API_)\r
fschar_t tmp[_MAX_PATH];\r
- #if defined(_IRR_WCHAR_FILESYSTEM )\r
- _wgetcwd(tmp, _MAX_PATH);\r
- WorkingDirectory[FILESYSTEM_NATIVE] = tmp;\r
- WorkingDirectory[FILESYSTEM_NATIVE].replace(L'\\', L'/');\r
- #else\r
_getcwd(tmp, _MAX_PATH);\r
WorkingDirectory[FILESYSTEM_NATIVE] = tmp;\r
WorkingDirectory[FILESYSTEM_NATIVE].replace('\\', '/');\r
- #endif\r
#endif\r
\r
#if (defined(_IRR_POSIX_API_) || defined(_IRR_OSX_PLATFORM_))\r
// so try it until the call was successful\r
// Note that neither the first nor the second parameter may be 0 according to POSIX\r
\r
- #if defined(_IRR_WCHAR_FILESYSTEM )\r
- u32 pathSize=256;\r
- wchar_t *tmpPath = new wchar_t[pathSize];\r
- while ((pathSize < (1<<16)) && !(wgetcwd(tmpPath,pathSize)))\r
- {\r
- delete [] tmpPath;\r
- pathSize *= 2;\r
- tmpPath = new char[pathSize];\r
- }\r
- if (tmpPath)\r
- {\r
- WorkingDirectory[FILESYSTEM_NATIVE] = tmpPath;\r
- delete [] tmpPath;\r
- }\r
- #else\r
u32 pathSize=256;\r
char *tmpPath = new char[pathSize];\r
while ((pathSize < (1<<16)) && !(getcwd(tmpPath,pathSize)))\r
WorkingDirectory[FILESYSTEM_NATIVE] = tmpPath;\r
delete [] tmpPath;\r
}\r
- #endif\r
#endif\r
\r
WorkingDirectory[type].validate();\r
WorkingDirectory[FILESYSTEM_NATIVE] = newDirectory;\r
\r
#if defined(_MSC_VER)\r
- #if defined(_IRR_WCHAR_FILESYSTEM)\r
- success = (_wchdir(newDirectory.c_str()) == 0);\r
- #else\r
success = (_chdir(newDirectory.c_str()) == 0);\r
- #endif\r
#else\r
- #if defined(_IRR_WCHAR_FILESYSTEM)\r
- success = (_wchdir(newDirectory.c_str()) == 0);\r
- #else\r
success = (chdir(newDirectory.c_str()) == 0);\r
- #endif\r
#endif\r
}\r
\r
#if defined(_IRR_WINDOWS_API_)\r
fschar_t *p=0;\r
fschar_t fpath[_MAX_PATH];\r
- #if defined(_IRR_WCHAR_FILESYSTEM )\r
- p = _wfullpath(fpath, filename.c_str(), _MAX_PATH);\r
- core::stringw tmp(p);\r
- tmp.replace(L'\\', L'/');\r
- #else\r
p = _fullpath(fpath, filename.c_str(), _MAX_PATH);\r
core::stringc tmp(p);\r
tmp.replace('\\', '/');\r
- #endif\r
return tmp;\r
#elif (defined(_IRR_POSIX_API_) || defined(_IRR_OSX_PLATFORM_))\r
c8* p=0;\r
return true;\r
\r
#if defined(_MSC_VER)\r
- #if defined(_IRR_WCHAR_FILESYSTEM)\r
- return (_waccess(filename.c_str(), 0) != -1);\r
- #else\r
return (_access(filename.c_str(), 0) != -1);\r
- #endif\r
#elif defined(F_OK)\r
- #if defined(_IRR_WCHAR_FILESYSTEM)\r
- return (_waccess(filename.c_str(), F_OK) != -1);\r
- #else\r
return (access(filename.c_str(), F_OK) != -1);\r
- #endif\r
#else\r
return (access(filename.c_str(), 0) != -1);\r
#endif\r
#include "CGUIFileOpenDialog.h"\r
#ifdef _IRR_COMPILE_WITH_GUI_\r
\r
-#include <locale.h>\r
-\r
#include "IGUISkin.h"\r
#include "IGUIEnvironment.h"\r
#include "IVideoDriver.h"\r
\r
void CGUIFileOpenDialog::pathToStringW(irr::core::stringw& result, const irr::io::path& p)\r
{\r
-#ifndef _IRR_WCHAR_FILESYSTEM\r
- char* oldLocale = setlocale(LC_CTYPE, NULL);\r
- setlocale(LC_CTYPE,""); // multibyteToWString is affected by LC_CTYPE. Filenames seem to need the system-locale.\r
core::multibyteToWString(result, p);\r
- setlocale(LC_CTYPE, oldLocale);\r
-#else\r
- result = p.c_str();\r
-#endif\r
}\r
\r
//! fills the listbox with files.\r
return;\r
}\r
\r
-#if defined ( _IRR_WCHAR_FILESYSTEM )\r
- File = _wfopen(Filename.c_str(), L"rb");\r
-#else\r
File = fopen(Filename.c_str(), "rb");\r
-#endif\r
\r
if (File)\r
{\r
return;\r
}\r
\r
-#if defined(_IRR_WCHAR_FILESYSTEM)\r
- File = _wfopen(Filename.c_str(), append ? L"ab" : L"wb");\r
-#else\r
File = fopen(Filename.c_str(), append ? "ab" : "wb");\r
-#endif\r
\r
if (File)\r
{\r