1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
class CFileTxt : public CFile
{
public:
//--- methods for working with files
int Open(const string file_name,int open_flags);
//--- methods for data access
uint WriteString(const string value);
string ReadString();
};
int CFileTxt::Open(const string file_name,int open_flags)
{
int result=CFile::Open(file_name,open_flags|FILE_TXT);
//---
return(result);
}
uint CFileTxt::WriteString(const string value)
{
//--- checking
if(m_handle<0) return(0);
//---
return(FileWriteString(m_handle,value));
}
string CFileTxt::ReadString()
{
//--- checking
if(m_handle<0) return("");
//---
return(FileReadString(m_handle));
} |
Partager