wavelength 1.0.0
Loading...
Searching...
No Matches
ArkFile.h
Go to the documentation of this file.
1#pragma once
2
3#include "os/File.h"
4#include "utl/Str.h"
5
11class ArkFile : public File {
12public:
20 ArkFile(const char *name, int mode);
21
27 virtual ~ArkFile();
28
37 virtual int Read(void *data, int bytes);
38
48 virtual bool ReadAsync(void *data, int bytes);
49
58 virtual int Write(const void *data, int bytes);
59
68 virtual int Seek(int offset, int origin);
69
76 virtual int Tell();
77
83 virtual void Flush();
84
91 virtual bool Eof();
92
99 virtual bool Fail();
100
107 virtual int Size();
108
115 virtual int UncompressedSize();
116
124 virtual bool ReadDone(int *bytes);
125
132 void TaskDone(int bytes);
133
134private:
135 int mReserved04; // +0x04, not written by any routine recovered so far.
136 __int64 mArcOffset;
137 int mSize;
138 int mUCSize;
139 int mNumOutstanding;
140 int mBytesRead;
141 int mTell;
142 int mFail;
143 String mFilename;
144};
Read-only file of the main archive, read through the disc cache.
Definition arkfile.h:11
virtual int Write(const void *data, int bytes)
Fail, because the archive is read-only.
virtual ~ArkFile()
Drop the reads still waiting for blocks.
virtual bool Fail()
Report whether the file was not found or was opened for writing.
virtual int Tell()
Report the position.
virtual int Seek(int offset, int origin)
Move the position.
virtual bool ReadAsync(void *data, int bytes)
Queue a read of each block the bytes cover, at most up to the end of the file.
void TaskDone(int bytes)
Count the bytes one block delivered.
ArkFile(const char *name, int mode)
Find a file in the archive.
virtual bool ReadDone(int *bytes)
Poll the block manager and report whether every block of the read arrived.
virtual int Read(void *data, int bytes)
Read bytes and wait for them.
virtual int Size()
Report the size in the archive.
virtual void Flush()
Do nothing.
virtual int UncompressedSize()
Report the size before compression.
virtual bool Eof()
Report whether the position is at the end.
Open file of the host or the disc.
Definition file.h:29
Growable text buffer that is also a PrnStream.
Definition string.h:19