PIByteArray works on binary stream
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user