29 #include YFM_YSLib_Service_File
30 #include YFM_YSLib_Service_FileSystem
41 if(
Open(filename, mode))
44 fsize = GetPosition();
48 File::File(
const char* filename, std::ios_base::openmode mode)
54 if(
Open(filename, mode))
57 fsize = GetPosition();
74 fsize = GetPosition();
86 File::Open(
const char* filename,
const char* mode)
94 File::Open(
const char* filename, std::ios_base::openmode mode)
102 if((
fp =
ufopen(filename.c_str(), mode)))
113 File::Truncate(
size_t size)
const
std::FILE ConversionState fp
YF_API bool truncate(std::FILE *, std::size_t) ynothrow
截断文件至指定长度。
void Close()
检查文件有效长度后读位置返回文件起始。
bool Open(const String &, const ucs2_t *=u"rb")
const char * openmode_conv(std::ios_base::openmode)
YSLib 标准字符串(使用 UCS-2 作为内部编码)。
YF_API std::FILE * ufopen(const char *filename, const char *mode) ynothrow
以 UTF-8 文件名打开文件。
char16_t ucs2_t
UCS-2 字符类型。