※C++随笔※=>☆C++基础☆=>※№ C++文件操作 (fstream)(十)

2014-11-24 07:22:03 · 作者: · 浏览: 9
eekg(DWORD dwSeek)
{
if (NULL == m_pfstream) {
return;
}
m_pfstream->seekg(dwSeek);
}
/**
* Seekg Relatively move (Reading and writing binary files)
*
* @param DWORD dwSeek relatively move position
* @param FILE_REFERENCE_POS eFileRefPos file reference position
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
* @return VOID
* @note
* @attention Input stream operation
*/
VOID
AL_File::Seekg(DWORD dwSeek, FILE_REFERENCE_POS eFileRefPos)
{
if (NULL == m_pfstream) {
return;
}
m_pfstream->seekg(dwSeek, eFileRefPos);
}
/**
* Tellg Returns the current pointer position (Reading and writing binary files)
*
* @param VOID
* @return VOID
* @note
* @attention Input stream operation
*/
VOID
AL_File::Tellg(VOID)
{
if (NULL == m_pfstream) {
return;
}
m_pfstream->tellg();
}
/**
* Seekp Absolutely move (Reading and writing binary files)
*
* @param DWORD dwSeek absolute move position
* @return VOID
* @note
* @attention Output stream operation
*/
VOID
AL_File::Seekp(DWORD dwSeek)
{
if (NULL == m_pfstream) {
return;
}
m_pfstream->seekp(dwSeek);
}
/**
* Seekp Relatively move (Reading and writing binary files)
*
* @param DWORD dwSeek relatively move position
* @param FILE_REFERENCE_POS eFileRefPos file reference position
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
* @return VOID
* @note
* @attention Output stream operation
*/
VOID
AL_File::Seekp(DWORD dwSeek, FILE_REFERENCE_POS eFileRefPos)
{
if (NULL == m_pfstream) {
return;
}
m_pfstream->seekp(dwSeek, eFileRefPos);
}
/**
* Tellp Returns the current pointer position (Reading and writing binary files)
*
* @param VOID
* @return VOID
* @note
* @attention Output stream operation
*/
VOID
AL_File::Tellp(VOID)
{
if (NULL == m_pfstream) {
return;
}
m_pfstream->tellp();
}
/////////////////////////////////////Close the file/////////////////////////////////////
/**
* Close (Close the file)
*
* @param VOID
* @return VOID
* @note
* @attention
*/
VOID
AL_File::Close(VOID)
{
if (NULL == m_pfstream) {
return;
}
m_pfstream->close();
}
/* EOF */
附其它几篇相关文章:
http://www.iteye.com/topic/383903
http://blog.csdn.net/mak0000/article/details/3230199
文件路径函数
ExpandFileName() 返回文件的全路径(含驱动器、路径)
ExtractFileExt() 从文件名中抽取扩展名
ExtractFileName() 从文件名中抽取不含路径的文件名
ExtractFilePath() 从文件名中抽取路径名
ExtractFileDir() 从文件