YSTest
PreAlpha_b500_20140530
The YSLib Test Project
|
文件基类。 更多...
#include <File.h>
Public 成员函数 | |
File () | |
构造。 更多... | |
File (const char *, const char *="rb") | |
构造:使用指定文件路径初始化对象。 更多... | |
File (const char *, std::ios_base::openmode) | |
File (const String &, const ucs2_t *=u"rb") | |
File (const String &, std::ios_base::openmode) | |
virtual | ~File () |
析构。 更多... | |
PDefHOp (bool,!,) const ynothrow ImplRet(!bool(*this)) explicit DefCvt(const ynothrow | |
判断无效性。 更多... | |
fp | DefGetter (const ynothrow, FILE *, Ptr, fp) DefGetter(const ynothrow |
fp fsize | DefGetter (const ynothrow, ptrdiff_t, Position, std::ftell(fp)) PDefH(int |
< 取文件大小。 更多... | |
fp fsize ptrdiff_t int whence const | ImplRet (std::fseek(fp, offset, whence)) PDefH(int |
检测文件结束符。 更多... | |
void | Close () |
检查文件有效长度后读位置返回文件起始。 更多... | |
bool | Open (const String &, const ucs2_t *=u"rb") |
bool | Open (const String &, std::ios_base::openmode) |
Public 属性 | |
bool | |
fp | size_t |
fp | Size |
fp fsize | Seek |
fp fsize ptrdiff_t | offset |
fp fsize ptrdiff_t int whence const | CheckEOF |
Private 属性 | |
std::FILE * | fp |
size_t | fsize |
文件大小。 更多... | |
相关函数 | |
(请注意: 这些不是成员函数.) | |
template<typename _tChar > | |
File & | operator>> (File &f, typename std::char_traits< _tChar >::char_type &c) |
从指定文件读字符。 更多... | |
template<typename _tString > | |
File & | operator>> (File &f, _tString &str) |
从指定文件读空白符分隔的字符串。 更多... | |
File & | operator<< (File &f, char c) |
向指定文件写字符。 更多... | |
File & | operator<< (File &f, const char *str) |
向指定文件写字符串。 更多... | |
template<typename _tString > | |
File & | operator<< (File &f, const _tString &str) |
向指定文件写字符串。 更多... | |
额外继承的成员函数 | |
![]() | |
noncopyable (const noncopyable &)=delete | |
禁止复制构造。 更多... | |
noncopyable & | operator= (const noncopyable &)=delete |
禁止赋值复制。 更多... | |
noncopyable ()=default | |
protected 构造:默认实现。 更多... | |
~noncopyable ()=default | |
protected 析构:默认实现。 更多... | |
|
explicit |
YSLib::File::File | ( | const char * | filename, |
std::ios_base::openmode | mode | ||
) |
|
explicit |
void YSLib::File::Close | ( | ) |
< 取文件大小。
取文件指针的位置,返回值语义同 std::ftell 。
设置文件指针位置。
std::fseek
。 检测文件结束符。
std::feof()
。 YSLib::File::PDefHOp | ( | bool | , |
! | |||
) | const |
判断无效性。
判断有效性。
|
private |