PIByteArray works on binary stream

This commit is contained in:
2022-05-10 15:23:18 +03:00
parent 0f9e592273
commit b2bc385397
58 changed files with 254 additions and 923 deletions

View File

@@ -140,30 +140,3 @@ PIResourcesStorage * PIResourcesStorage::instance() {
static PIResourcesStorage * ret = new PIResourcesStorage();
return ret;
}
PIByteArray & operator <<(PIByteArray & b, const PIResourcesStorage::__RCEntry & v) {
PIChunkStream cs;
cs.add(1, v.section).add(2, v.name).add(3, v.file).add(4, v.size)
.add(5, v.offset).add(6, v.flags).add(7, v.alias);
b << cs.data();
return b;
}
PIByteArray & operator >>(PIByteArray & b, PIResourcesStorage::__RCEntry & v) {
PIByteArray ba; b >> ba;
PIChunkStream cs(ba);
while (!cs.atEnd()) {
switch (cs.read()) {
case 1: cs.get(v.section); break;
case 2: cs.get(v.name); break;
case 3: cs.get(v.file); break;
case 4: cs.get(v.size); break;
case 5: cs.get(v.offset); break;
case 6: cs.get(v.flags); break;
case 7: cs.get(v.alias); break;
}
}
return b;
}