Subversion Repositories spk

Rev

Rev 196 | Rev 211 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 196 Rev 197
Line 29... Line 29...
29
 
29
 
30
class SPKEXPORT CFileIO
30
class SPKEXPORT CFileIO
31
{
31
{
32
public:
32
public:
33
	static bool Remove(const Utils::WString &filename);
33
	static bool Remove(const Utils::WString &filename);
34
	static bool Exists(const Utils::WString &filename);
34
	static bool Exists(const Utils::WString& filename);
-
 
35
	static bool Rename(const Utils::WString& from, const Utils::WString& to);
35
 
36
 
36
public:
37
public:
37
	CFileIO();
38
	CFileIO();
38
	CFileIO(const Utils::WString &sFilename, bool bBinary);
39
	CFileIO(const Utils::WString &sFilename, bool bBinary);
39
	CFileIO(const Utils::WString &filename);
40
	CFileIO(const Utils::WString &filename);
Line 60... Line 61...
60
	bool write(const unsigned char *buf, size_t iSize);
61
	bool write(const unsigned char *buf, size_t iSize);
61
	bool put(const unsigned char c);
62
	bool put(const unsigned char c);
62
 
63
 
63
	void close();
64
	void close();
64
 
65
 
-
 
66
	Utils::String readEndOfLineStr();
65
	Utils::String readEndOfLine();
67
	Utils::WString readEndOfLine();
66
 
68
 
67
	void seek(size_t iPos);
69
	void seek(size_t iPos);
68
	void seekEnd(size_t iPos = 0);
70
	void seekEnd(size_t iPos = 0);
69
	void seekStart(size_t iPos = 0);
71
	void seekStart(size_t iPos = 0);
70
	size_t position();
72
	size_t position();
71
 
73
 
72
	int readSize();
74
	int readSize();
73
	bool read(unsigned char *buf, size_t iSize, bool bEndChar = false);
75
	bool read(unsigned char* buf, size_t iSize, bool bEndChar = false);
-
 
76
	bool read(wchar_t* buf, size_t iSize, bool bEndChar = false);
74
	unsigned char *read(size_t iAmount);
77
	unsigned char *read(size_t iAmount);
75
	unsigned char *readAll(size_t *pSize = NULL);
78
	unsigned char *readAll(size_t *pSize = NULL);
76
 
79
 
77
	std::fstream &stream();
80
	std::fstream &stream();
78
 
81
 
79
	std::vector<Utils::String>* readLines() const;
82
	std::vector<Utils::String>* readLines() const;
80
	size_t readLines(std::vector<Utils::String>& to) const;
83
	size_t readLines(std::vector<Utils::String>& to) const;
-
 
84
	size_t readLines(std::vector<Utils::WString>& to) const;
81
	size_t readLines(Utils::CStringList& to) const;
85
	size_t readLines(Utils::CStringList& to) const;
82
	Utils::CStringList *readLinesStr();
86
	Utils::CStringList *readLinesStr();
83
 
87
 
84
	bool writeFile(std::vector<Utils::String> *lines);
88
	bool writeFile(std::vector<Utils::String>* lines);
-
 
89
	bool writeFile(const std::vector<Utils::WString> &lines) const;
85
	bool writeFileUTF(std::vector<Utils::String> *lines);
90
	bool writeFileUTF(std::vector<Utils::String>* lines);
-
 
91
	bool writeFileUTF(std::vector<Utils::WString>* lines);
86
	bool writeFile(Utils::CStringList* lines);
92
	bool writeFile(Utils::CStringList* lines);
87
	bool writeFile(Utils::WStringList* lines);
93
	bool writeFile(Utils::WStringList* lines);
88
 
94
 
89
	bool remove();
95
	bool remove();
90
	bool Rename(const Utils::WString &toFile);
96
	bool Rename(const Utils::WString &toFile);
Line 138... Line 144...
138
	bool _start(int iFlags, bool bSeekP);
144
	bool _start(int iFlags, bool bSeekP);
139
 
145
 
140
	void _readFileSize ();
146
	void _readFileSize ();
141
	void _seek(int iPos, int iFrom);
147
	void _seek(int iPos, int iFrom);
142
 
148
 
143
	bool _write(const char *buf, va_list args);
149
	bool _write(const char* buf, va_list args);
-
 
150
	bool _write(const wchar_t* buf, va_list args);
144
 
151
 
145
	void _updateFilename();
152
	void _updateFilename();
146
 
153
 
147
	const char* _fileData() const;
154
	std::string _fileData() const;
148
	static const char* _toFileData(const Utils::WString &str);
155
	static std::string _toFileData(const Utils::WString &str);
149
 
156
 
150
private:
157
private:
151
	Utils::WString	_sFilename;
158
	Utils::WString	_sFilename;
152
	Utils::WString	_sFile;
159
	Utils::WString	_sFile;
153
	Utils::WString	_sExt;
160
	Utils::WString	_sExt;