aboutsummaryrefslogtreecommitdiffstats
path: root/common/alfstream.cpp
blob: 8991ce0352a0f6ea1d83a419e810036b90dfa17c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

#include "config.h"

#include "alfstream.h"

#include "strutils.h"

#ifdef _WIN32

namespace al {

ifstream::ifstream(const char *filename, std::ios_base::openmode mode)
  : std::ifstream{utf8_to_wstr(filename).c_str(), mode}
{ }

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);
}

ifstream::~ifstream() = default;

} // namespace al

#endif