Handle Int16 and ADPCM formats in alstreamcb
[openal-soft.git] / common / alfstream.h
blob62b2e12c756844e0850291d4cdfdcfd762ad5525
1 #ifndef AL_FSTREAM_H
2 #define AL_FSTREAM_H
4 #ifdef _WIN32
6 #include <string>
7 #include <fstream>
10 namespace al {
12 // Inherit from std::ifstream to accept UTF-8 filenames
13 class ifstream final : public std::ifstream {
14 public:
15 explicit ifstream(const char *filename, std::ios_base::openmode mode=std::ios_base::in);
16 explicit ifstream(const std::string &filename, std::ios_base::openmode mode=std::ios_base::in)
17 : ifstream{filename.c_str(), mode} { }
19 explicit ifstream(const wchar_t *filename, std::ios_base::openmode mode=std::ios_base::in)
20 : std::ifstream{filename, mode} { }
21 explicit ifstream(const std::wstring &filename, std::ios_base::openmode mode=std::ios_base::in)
22 : ifstream{filename.c_str(), mode} { }
24 void open(const char *filename, std::ios_base::openmode mode=std::ios_base::in);
25 void open(const std::string &filename, std::ios_base::openmode mode=std::ios_base::in)
26 { open(filename.c_str(), mode); }
28 ~ifstream() override;
31 } // namespace al
33 #else /* _WIN32 */
35 #include <fstream>
37 namespace al {
39 using ifstream = std::ifstream;
41 } // namespace al
43 #endif /* _WIN32 */
45 #endif /* AL_FSTREAM_H */