7.12.2010 - add PIString

This commit is contained in:
peri4
2010-12-07 01:55:30 +03:00
parent e321b5187d
commit 08f214dbfa
10 changed files with 360 additions and 134 deletions

View File

@@ -1,20 +1,20 @@
#include "pifile.h"
bool PIFile::open(const string & path_, Flags<Mode> mode_) {
bool PIFile::open(const PIString & path_, Flags<Mode> mode_) {
cpath = path_;
cmode = mode_;
if (cmode[New]) {
stream.open(cpath.c_str(), fstream::in | fstream::out | fstream::trunc);
stream.open(cpath, fstream::in | fstream::out | fstream::trunc);
stream.close();
cmode &= ~New;
stream.open(cpath.c_str(), (fstream::openmode)(int)cmode | fstream::binary);
} else stream.open(cpath.c_str(), (fstream::openmode)(int)cmode | fstream::binary);
stream.open(cpath, (fstream::openmode)(int)cmode | fstream::binary);
} else stream.open(cpath, (fstream::openmode)(int)cmode | fstream::binary);
return isOpened();
}
string PIFile::readLine() {
PIString PIFile::readLine() {
char * buff = new char[4096];
stream.getline(buff, 4096);
return string(buff);