设为首页 加入收藏

TOP

※C++随笔※=>☆C++基础☆=>※№ C++文件操作 (fstream)(六)
2015-11-21 01:15:20 来源: 作者: 【 】 浏览:21
Tags:随笔 > 基础 文件 操作 fstream
end, ? // 2: relative to the end of the file?
? ? * @return VOID?
? ? * @note?
? ? * @attention ? ?Output stream operation?
? ? */ ?
? ? VOID Seekp(DWORD dwSeek, FILE_REFERENCE_POS eFileRefPos); ?
??
? ? /**?
? ? * Tellp Returns the current pointer position (Reading and writing binary files)?
? ? *?
? ? * @param VOID?
? ? * @return VOID?
? ? * @note?
? ? * @attention ? ?Output stream operation?
? ? */ ?
? ? VOID Tellp(VOID); ?
??
??
/////////////////////////////////////Close the file///////////////////////////////////// ?
? ? /**?
? ? * Close (Close the file)?
? ? *?
? ? * @param VOID?
? ? * @return VOID?
? ? * @note?
? ? * @attention?
? ? */ ?
? ? VOID Close(VOID); ?
??
protected: ?
private: ?
? ? /**?
? ? *Copy Construct?
? ? *?
? ? * @param const AL_File& cAL_File?
? ? * @return?
? ? */ ?
? ? AL_File(const AL_File& cAL_File); ?
??
? ? /**?
? ? *Assignment?
? ? *?
? ? * @param const AL_File& cAL_File?
? ? * @return AL_File&?
? ? */ ?
? ? AL_File &operator =(const AL_File& cAL_File); ?
??
??
public: ?
? ? ////////////////////////////open model////////////////////////////////////////////// ?
? ? static const WORD MODEL_IN ? ? ? ? ?= std::ios::in; ? ? ? ? // 0x01, for reading the file does not exist, create (ifstream Open default) ?
? ? static const WORD MODEL_OUT ? ? ? ? = std::ios::out; ? ? ? ?// 0x02, for writing, the file does not exist, to create, if the file already exists, clear the original content (ofstream default Open) ?
? ? static const WORD MODEL_ATE ? ? ? ? = std::ios::ate; ? ? ? ?// 0x04, when the file is opened, the pointer in the file last. Can change the position of the pointer, often used in combination and in, out ?
? ? static const WORD MODEL_APP ? ? ? ? = std::ios::app; ? ? ? ?// 0x08, for writing, the file does not exist, to create, to write new content after the original contents of the file if the file already exists, the total in the final pointer position ?
? ? static const WORD MODEL_TRUNC ? ? ? = std::ios::trunc; ? ? ?// 0x10, length of the file read and write before first truncated to 0 (default) ?
? ? static const WORD MODEL_NOCREATE ? ?= std::ios::_Nocreate; ?// 0x20, file does not exist error, often used in combination and in or app ?
? ? static const WORD MODEL_NOREPLACE ? = std::ios::_Noreplace; // 0x40, file exists generates an error when used in combination, often and out ?
? ? static const WORD MODEL_BINARY ? ? ?= std::ios::binary; ? ? // 0x80, binary format file ?
??
? ? ////////////////////////////open access////////////////////////////////////////////// ?
? ? static const WORD ACCESS_ORDINARY ? = 0; ? ? ? ? ? ? ? ? ? ?// 0: ordinary files, open access ?
? ? static const WORD ACCESS_READONLY ? = 1; ? ? ? ? ? ? ? ? ? ?// 1: read-only file ?
? ? static const WORD ACCESS_HIDDEN ? ? = 2; ? ? ? ? ? ? ? ? ? ?// 2: hidden file ?
? ? static const WORD ACCESS_SYSTEM ? ? = 4; ? ? ? ? ? ? ? ? ? ?// 4: System Files ?
??
? ? ////////////////////////////////////////////////////////////////////////// ?
? ? enum FILE_REFERENCE_POS ?
? ? { ?
? ? ? ? FILE_REFERENCE_POS_BEG = std::ios :: beg, ? // 0: relative to the file header ?
? ? ? ? FILE_REFERENCE_POS_CUR = std::ios :: cur, ? // 1: relative to the current position ?
? ? ? ? FILE_REFERENCE_POS_END = std::ios :: end, ? // 2: relative to the end of the file ?
? ? }; ?
??
protected: ?
private: ?
? ? NCHARfstream* ? m_pfstream; ?
}; ?
??
#endif // CXX_AL_FILE_H ?
/* EOF */ ?
? ? ??
?
[cpp] view plainc
首页 上一页 3 4 5 6 7 8 9 下一页 尾页 6/11/11
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇POJ3006:Dirichlet's Theorem.. 下一篇字符串系列――10010 Where's..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: