PIFile::readAll release
patch deploy_tool: ignore libc.so and take last dpkg dependency instead of first
This commit is contained in:
@@ -252,32 +252,7 @@ llong PIFile::readAll(void * data) {
|
||||
}
|
||||
|
||||
|
||||
PIByteArray PIFile::readAll(bool forceRead) {
|
||||
PIByteArray a;
|
||||
llong cp = pos();
|
||||
if (forceRead) {
|
||||
seekToBegin();
|
||||
for (;;) {
|
||||
uchar byte = static_cast<uchar>(fgetc(PRIVATE->fd));
|
||||
if (feof(PRIVATE->fd) || ferror(PRIVATE->fd)) break;
|
||||
a.push_back(byte);
|
||||
}
|
||||
seek(cp);
|
||||
return a;
|
||||
}
|
||||
llong s = size();
|
||||
if (s < 0) return a;
|
||||
a.resize(s);
|
||||
seekToBegin();
|
||||
auto _r = fread(a.data(), 1, s, PRIVATE->fd);
|
||||
NO_UNUSED(_r);
|
||||
seek(cp);
|
||||
if (s >= 0) a.resize(s);
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
PIByteArray PIFile::_readAll() {
|
||||
PIByteArray PIFile::readAll() {
|
||||
if (!isOpened()) return {};
|
||||
llong prev_pos = pos();
|
||||
PIByteArray ret, buffer(4_KiB);
|
||||
@@ -647,10 +622,10 @@ bool PIFile::applyFileInfo(const PIString & path, const PIFile::FileInfo & info)
|
||||
}
|
||||
|
||||
|
||||
PIByteArray PIFile::readAll(const PIString & path, bool forceRead) {
|
||||
PIByteArray PIFile::readAll(const PIString & path) {
|
||||
PIFile f(path, PIIODevice::ReadOnly);
|
||||
if (!f.isOpened()) return PIByteArray();
|
||||
return f.readAll(forceRead);
|
||||
return f.readAll();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user