forked from Mirrors/openclonk
C4Group: Make more stuff private
C4Update needs to access some internal data of C4Group and uses a special derived class (C4GroupEx). Make everything it doesn't want to tamper with private so it's more obvious what is and isn't accessed from outside the class.alut-include-path
parent
aef2705825
commit
c73fed8aa6
|
@ -135,7 +135,7 @@ public:
|
|||
C4Group();
|
||||
~C4Group();
|
||||
|
||||
protected:
|
||||
private:
|
||||
enum Status
|
||||
{
|
||||
GRPF_Inactive,
|
||||
|
@ -157,7 +157,6 @@ protected:
|
|||
int MotherOffset;
|
||||
int EntryOffset;
|
||||
bool Modified;
|
||||
C4GroupHeader Head;
|
||||
C4GroupEntry *FirstEntry;
|
||||
BYTE *pInMemEntry; size_t iInMemEntrySize; // for reading from entries prefetched into memory
|
||||
#ifdef _DEBUG
|
||||
|
@ -174,6 +173,12 @@ protected:
|
|||
|
||||
bool NoSort; // If this flag is set, all entries will be marked NoSort in AddEntry
|
||||
|
||||
protected:
|
||||
// C4Update requires these to be available by a subclass (C4GroupEx)
|
||||
C4GroupHeader Head;
|
||||
C4GroupEntry *GetEntry(const char *szName);
|
||||
void Clear();
|
||||
|
||||
public:
|
||||
bool Open(const char *szGroupName, bool fCreate=false);
|
||||
bool Close();
|
||||
|
@ -252,10 +257,9 @@ public:
|
|||
const C4GroupHeader &GetHeader() const { return Head; }
|
||||
const C4GroupEntry *GetFirstEntry() const { return FirstEntry; }
|
||||
|
||||
protected:
|
||||
private:
|
||||
void Init();
|
||||
void Default();
|
||||
void Clear();
|
||||
bool EnsureChildFilePtr(C4Group *pChild);
|
||||
bool CloseExclusiveMother();
|
||||
bool Error(const char *szStatus);
|
||||
|
@ -277,7 +281,6 @@ protected:
|
|||
bool AddEntryOnDisk(const char *szFilename, const char *szAddAs=nullptr, bool fMove=false);
|
||||
bool SetFilePtr2Entry(const char *szName, bool NeedsToBeAGroup = false);
|
||||
bool AppendEntry2StdFile(C4GroupEntry *centry, CStdFile &stdfile);
|
||||
C4GroupEntry *GetEntry(const char *szName);
|
||||
C4GroupEntry *SearchNextEntry(const char *szName);
|
||||
C4GroupEntry *GetNextFolderEntry();
|
||||
uint32_t CalcCRC32(C4GroupEntry *pEntry);
|
||||
|
|
Loading…
Reference in New Issue