OpenClonk
C4GroupEntry Class Reference

#include <C4Group.h>

Inheritance diagram for C4GroupEntry:
[legend]
Collaboration diagram for C4GroupEntry:
[legend]

Public Types

enum  EntryStatus { C4GRES_InGroup , C4GRES_OnDisk , C4GRES_InMemory , C4GRES_Deleted }
 

Public Member Functions

 ~C4GroupEntry ()
 
void Set (const DirectoryIterator &directories, const char *path)
 

Public Attributes

char DiskPath [_MAX_PATH_LEN] = { 0 }
 
EntryStatus Status = C4GRES_InGroup
 
bool DeleteOnDisk = false
 
bool HoldBuffer = false
 
bool BufferIsStdbuf = false
 
bool NoSort = false
 
BYTEMemoryBuffer = nullptr
 
C4GroupEntryNext = nullptr
 
char FileName [260] = { 0 }
 
int32_t Packed = 0
 
int32_t ChildGroup = 0
 
int32_t Size = 0
 
int32_t Offset = 0
 
int32_t Reserved1 = 0
 
int32_t Reserved2 = 0
 
char Reserved3 = '\0'
 
unsigned int Reserved4 = 0
 
char Executable = '\0'
 
BYTE Buffer [26] = { 0 }
 

Detailed Description

Definition at line 109 of file C4Group.h.

Member Enumeration Documentation

◆ EntryStatus

Enumerator
C4GRES_InGroup 
C4GRES_OnDisk 
C4GRES_InMemory 
C4GRES_Deleted 

Definition at line 114 of file C4Group.h.

115  {
120  };
@ C4GRES_InGroup
Definition: C4Group.h:116
@ C4GRES_InMemory
Definition: C4Group.h:118
@ C4GRES_OnDisk
Definition: C4Group.h:117
@ C4GRES_Deleted
Definition: C4Group.h:119

Constructor & Destructor Documentation

◆ ~C4GroupEntry()

C4GroupEntry::~C4GroupEntry ( )

Definition at line 596 of file C4Group.cpp.

597 {
598  if (HoldBuffer)
599  if (MemoryBuffer)
600  {
601  if (BufferIsStdbuf)
603  else
604  delete [] MemoryBuffer;
605  }
606 }
bool BufferIsStdbuf
Definition: C4Group.h:127
BYTE * MemoryBuffer
Definition: C4Group.h:129
bool HoldBuffer
Definition: C4Group.h:126
static void DeletePointer(void *data)
Definition: StdBuf.h:196

References BufferIsStdbuf, StdBuf::DeletePointer(), HoldBuffer, and MemoryBuffer.

Here is the call graph for this function:

Member Function Documentation

◆ Set()

void C4GroupEntry::Set ( const DirectoryIterator directories,
const char *  path 
)

Definition at line 608 of file C4Group.cpp.

609 {
610  InplaceReconstruct(this);
611 
612  SCopy(GetFilename(*directories),FileName, _MAX_FNAME);
613  SCopy(*directories, DiskPath, _MAX_PATH-1);
614  Size = directories.GetFileSize();
616  Packed = false;
617  ChildGroup = false;
618  // Notice folder entries are not checked for ChildGroup status.
619  // This would cause extreme performance loss and be good for
620  // use in entry list display only.
621 }
#define _MAX_FNAME
#define _MAX_PATH
void SCopy(const char *szSource, char *sTarget, size_t iMaxL)
Definition: Standard.cpp:152
std::enable_if< std::is_nothrow_default_constructible< T >::value >::type InplaceReconstruct(T *obj)
Definition: Standard.h:35
char * GetFilename(char *szPath)
Definition: StdFile.cpp:42
char DiskPath[_MAX_PATH_LEN]
Definition: C4Group.h:123
EntryStatus Status
Definition: C4Group.h:124
size_t GetFileSize() const
Definition: StdFile.cpp:1059
char FileName[260]
Definition: C4Group.h:94
int32_t Size
Definition: C4Group.h:97
int32_t Packed
Definition: C4Group.h:95
int32_t ChildGroup
Definition: C4Group.h:96

References _MAX_FNAME, _MAX_PATH, C4GRES_OnDisk, C4GroupEntryCore::ChildGroup, DiskPath, C4GroupEntryCore::FileName, GetFilename(), DirectoryIterator::GetFileSize(), InplaceReconstruct(), C4GroupEntryCore::Packed, SCopy(), C4GroupEntryCore::Size, and Status.

Here is the call graph for this function:

Member Data Documentation

◆ Buffer

BYTE C4GroupEntryCore::Buffer[26] = { 0 }
inherited

Definition at line 104 of file C4Group.h.

◆ BufferIsStdbuf

bool C4GroupEntry::BufferIsStdbuf = false

Definition at line 127 of file C4Group.h.

Referenced by ~C4GroupEntry().

◆ ChildGroup

int32_t C4GroupEntryCore::ChildGroup = 0
inherited

Definition at line 96 of file C4Group.h.

Referenced by C4Group::Delete(), C4Group::ExtractEntry(), C4Group::OpenAsChild(), and Set().

◆ DeleteOnDisk

bool C4GroupEntry::DeleteOnDisk = false

Definition at line 125 of file C4Group.h.

Referenced by C4Group::DeleteEntry().

◆ DiskPath

char C4GroupEntry::DiskPath[_MAX_PATH_LEN] = { 0 }

Definition at line 123 of file C4Group.h.

Referenced by C4Group::DeleteEntry(), and Set().

◆ Executable

char C4GroupEntryCore::Executable = '\0'
inherited

◆ FileName

char C4GroupEntryCore::FileName[260] = { 0 }
inherited

◆ HoldBuffer

bool C4GroupEntry::HoldBuffer = false

Definition at line 126 of file C4Group.h.

Referenced by ~C4GroupEntry().

◆ MemoryBuffer

BYTE* C4GroupEntry::MemoryBuffer = nullptr

Definition at line 129 of file C4Group.h.

Referenced by ~C4GroupEntry().

◆ Next

C4GroupEntry* C4GroupEntry::Next = nullptr

◆ NoSort

bool C4GroupEntry::NoSort = false

Definition at line 128 of file C4Group.h.

Referenced by C4GroupEx::SetNoSort().

◆ Offset

int32_t C4GroupEntryCore::Offset = 0
inherited

Definition at line 98 of file C4Group.h.

Referenced by C4Group::OpenAsChild(), and C4Group::Save().

◆ Packed

int32_t C4GroupEntryCore::Packed = 0
inherited

Definition at line 95 of file C4Group.h.

Referenced by Set().

◆ Reserved1

int32_t C4GroupEntryCore::Reserved1 = 0
inherited

Definition at line 99 of file C4Group.h.

◆ Reserved2

int32_t C4GroupEntryCore::Reserved2 = 0
inherited

Definition at line 100 of file C4Group.h.

◆ Reserved3

char C4GroupEntryCore::Reserved3 = '\0'
inherited

Definition at line 101 of file C4Group.h.

◆ Reserved4

unsigned int C4GroupEntryCore::Reserved4 = 0
inherited

Definition at line 102 of file C4Group.h.

◆ Size

int32_t C4GroupEntryCore::Size = 0
inherited

◆ Status

EntryStatus C4GroupEntry::Status = C4GRES_InGroup

Definition at line 124 of file C4Group.h.

Referenced by C4Group::DeleteEntry(), and Set().


The documentation for this class was generated from the following files: