AMFP Enhanced
C++ reference: the code this unofficial fork added
Loading...
Searching...
No Matches
LuxFsPath.h
Go to the documentation of this file.
1/*
2 * AMFP-2026: file paths for std::fstream / remove on every platform. MSVC takes the engine's
3 * wide paths directly; Linux and macOS take UTF-8.
4 */
5#ifndef LUX_FS_PATH_H
6#define LUX_FS_PATH_H
7
8#include "LuxBase.h"
9#include <cstdio>
10
11#ifdef WIN32
12// Usable as a constructor argument: the wide string is the caller's.
13#define LUX_FS_PATH(asWide) (asWide).c_str()
14inline int LuxRemoveFile(const tWString& asPath) { return _wremove(asPath.c_str()); }
15#else
16// The temporary UTF-8 string lives until the end of the full expression (the open call).
17#define LUX_FS_PATH(asWide) cString::S16BitToUTF8(asWide).c_str()
18inline int LuxRemoveFile(const tWString& asPath) { return std::remove(cString::S16BitToUTF8(asPath).c_str()); }
19#endif
20
21#endif
int LuxRemoveFile(const tWString &asPath)
Definition LuxFsPath.h:18