2021-04-28 12:43:51 +08:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include "alfstream.h"
|
|
|
|
|
|
|
|
#include "strutils.h"
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
|
|
|
namespace al {
|
|
|
|
|
|
|
|
ifstream::ifstream(const char *filename, std::ios_base::openmode mode)
|
2023-02-04 15:03:54 +08:00
|
|
|
: std::ifstream{utf8_to_wstr(filename).c_str(), mode}
|
|
|
|
{ }
|
2021-04-28 12:43:51 +08:00
|
|
|
|
2023-02-04 15:03:54 +08:00
|
|
|
void ifstream::open(const char *filename, std::ios_base::openmode mode)
|
|
|
|
{
|
|
|
|
std::wstring wstr{utf8_to_wstr(filename)};
|
|
|
|
std::ifstream::open(wstr.c_str(), mode);
|
2021-04-28 12:43:51 +08:00
|
|
|
}
|
|
|
|
|
2023-02-04 15:03:54 +08:00
|
|
|
ifstream::~ifstream() = default;
|
2021-04-28 12:43:51 +08:00
|
|
|
|
|
|
|
} // namespace al
|
|
|
|
|
|
|
|
#endif
|