04.11.2011 - adjust for Windows & QNX, multiprotocol, repeater, signals, process, codec, console input
This commit is contained in:
16
pifile.cpp
16
pifile.cpp
@@ -22,8 +22,8 @@ PIString PIFile::readLine() {
|
||||
}
|
||||
|
||||
|
||||
int PIFile::readAll(void * data) {
|
||||
int cp = pos(), s = size();
|
||||
llong PIFile::readAll(void * data) {
|
||||
llong cp = pos(), s = size();
|
||||
stream.seekg(0);
|
||||
stream.read((char * )data, s);
|
||||
seek(cp);
|
||||
@@ -32,7 +32,7 @@ int PIFile::readAll(void * data) {
|
||||
|
||||
|
||||
PIByteArray PIFile::readAll() {
|
||||
int s = size();
|
||||
llong s = size();
|
||||
if (s < 0) return PIByteArray();
|
||||
PIByteArray a(s);
|
||||
s = readAll(a.data());
|
||||
@@ -41,9 +41,9 @@ PIByteArray PIFile::readAll() {
|
||||
}
|
||||
|
||||
|
||||
int PIFile::size() {
|
||||
llong PIFile::size() {
|
||||
if (!stream.is_open()) return -1;
|
||||
int s, cp = stream.tellg();
|
||||
llong s, cp = stream.tellg();
|
||||
stream.seekg(0, fstream::end);
|
||||
s = stream.tellg();
|
||||
stream.seekg(cp, fstream::beg);
|
||||
@@ -51,8 +51,8 @@ int PIFile::size() {
|
||||
}
|
||||
|
||||
|
||||
void PIFile::resize(int new_size, char fill_) {
|
||||
int ds = new_size - size();
|
||||
void PIFile::resize(llong new_size, char fill_) {
|
||||
llong ds = new_size - size();
|
||||
if (ds == 0) return;
|
||||
if (ds > 0) {
|
||||
char * buff = new char[ds];
|
||||
@@ -65,7 +65,7 @@ void PIFile::resize(int new_size, char fill_) {
|
||||
}
|
||||
|
||||
|
||||
int PIFile::pos() {
|
||||
llong PIFile::pos() {
|
||||
if (cmode[Read]) return stream.tellg();
|
||||
if (cmode[Write]) return stream.tellp();
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user