Blender
V5.3
source
blender
blenlib
intern
fileops.cc
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2023 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9
#include "
BLI_fileops.hh
"
10
11
#ifdef WIN32
12
# include "
utfconv.hh
"
13
#endif
14
15
namespace
blender
{
16
17
fstream::fstream
(
const
char
*filepath, std::ios_base::openmode mode)
18
{
19
this->
open
(filepath, mode);
20
}
21
22
fstream::fstream
(
const
std::string &filepath, std::ios_base::openmode mode)
23
{
24
this->
open
(filepath, mode);
25
}
26
27
void
fstream::open
(
StringRefNull
filepath, ios_base::openmode mode)
28
{
29
#ifdef WIN32
30
const
char
*filepath_cstr = filepath.
c_str
();
31
UTF16_ENCODE
(filepath_cstr);
32
std::wstring filepath_wstr(filepath_cstr_16);
33
std::fstream::open(filepath_wstr.c_str(), mode);
34
UTF16_UN_ENCODE
(filepath_cstr);
35
#else
36
std::fstream::open(filepath, mode);
37
#endif
38
}
39
40
}
// namespace blender
BLI_fileops.hh
File and directory operations.
blender::StringRefNull
Definition
BLI_string_ref.hh:144
blender::StringRefNull::c_str
constexpr const char * c_str() const
blender::fstream::open
void open(StringRefNull filepath, ios_base::openmode mode=ios_base::in|ios_base::out)
Definition
fileops.cc:27
blender::fstream::fstream
fstream()=default
blender
BMesh Iterators.
Definition
ANIM_action.hh:30
utfconv.hh
UTF16_ENCODE
#define UTF16_ENCODE(in8str)
Definition
utfconv.hh:80
UTF16_UN_ENCODE
#define UTF16_UN_ENCODE(in8str)
Definition
utfconv.hh:84
Generated on
for Blender by
doxygen
1.18.0