7.12.2010 - add PIString
This commit is contained in:
10
pifile.cpp
10
pifile.cpp
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user