47 extern int iC4GroupRewindFilePtrNoWarn;
48 #define C4GRP_DISABLE_REWINDWARN ++iC4GroupRewindFilePtrNoWarn;
49 #define C4GRP_ENABLE_REWINDWARN --iC4GroupRewindFilePtrNoWarn;
51 #define C4GRP_DISABLE_REWINDWARN ;
52 #define C4GRP_ENABLE_REWINDWARN ;
62 #define C4GroupFileID "RedWolf Design GrpFolder"
70 bool C4Group_CopyItem(
const char *source,
const char *target,
bool no_sorting =
false,
bool reset_attributes =
false);
71 bool C4Group_MoveItem(
const char *source,
const char *target,
bool no_sorting =
false);
81 #pragma pack (push, 1)
138 std::unique_ptr<P> p;
152 bool Open(
const char *group_name,
bool do_create =
false);
154 bool Save(
bool reopen);
155 bool OpenAsChild(
C4Group *mother,
const char *entry_name,
bool is_exclusive =
false,
bool do_create =
false);
158 bool Add(
const char *filename,
const char *entry_name);
159 bool Add(
const char *entry_name,
void *buffer,
int size,
bool add_as_child =
false,
bool hold_buffer =
false,
bool is_executable =
false);
160 bool Add(
const char *entry_name,
StdBuf &buffer,
bool add_as_child =
false,
bool hold_buffer =
false,
bool is_executable =
false);
161 bool Add(
const char *entry_name,
StdStrBuf &buffer,
bool add_as_child =
false,
bool hold_buffer =
false,
bool is_executable =
false);
162 bool Merge(
const char *folders);
163 bool Move(
const char *filename,
const char *entry_name);
164 bool Extract(
const char *files,
const char *destination =
nullptr,
const char *exclude =
nullptr);
165 bool ExtractEntry(
const char *filename,
const char *destination =
nullptr);
166 bool Delete(
const char *files,
bool recursive =
false);
167 bool DeleteEntry(
const char *filename,
bool do_recycle =
false);
168 bool Rename(
const char *filename,
const char *new_name);
169 bool Sort(
const char *list);
170 bool SortByList(
const char **list,
const char *filename =
nullptr);
172 size_t *size =
nullptr,
173 char *filename =
nullptr,
174 bool needs_to_be_a_group =
false);
176 size_t *size =
nullptr,
177 char *filename =
nullptr,
178 bool start_at_filename =
false);
181 size_t *size_info =
nullptr,
182 int zeros_to_append = 0);
189 size_t *size =
nullptr);
193 bool found_entry =
FindEntry(wildcard, &name);
202 size_t *size =
nullptr,
203 bool start_at_filename =
false);
206 size_t *size =
nullptr,
207 bool start_at_filename =
false)
209 StdStrBuf name(start_at_filename ? filename :
"");
210 bool found_entry =
FindNextEntry(wildcard, &name, size, start_at_filename);
211 if (found_entry && filename)
217 bool Read(
void *buffer,
size_t size)
override;
218 bool Advance(
int offset)
override;
224 int EntryCount(
const char *wildcard =
nullptr);
225 size_t EntrySize(
const char *wildcard =
nullptr);
227 unsigned int EntryCRC32(
const char *wildcard =
nullptr);
233 int PreCacheEntries(
const char *search_pattern,
bool cache_previous =
false);
240 bool EnsureChildFilePtr(
C4Group *child);
241 bool CloseExclusiveMother();
242 bool Error(
const char *status_message);
243 bool OpenReal(
const char *group_name);
244 bool OpenRealGrpFile();
245 bool SetFilePtr(
int offset);
246 bool RewindFilePtr();
247 bool AdvanceFilePtr(
int offset);
252 const char *entry_name =
nullptr,
253 BYTE *buffer =
nullptr,
254 bool delete_on_disk =
false,
255 bool hold_buffer =
false,
256 bool is_executable =
false,
257 bool buffer_is_stdbuf =
false);
258 bool AddEntryOnDisk(
const char *filename,
const char *entry_name =
nullptr,
bool move =
false);
259 bool SetFilePtr2Entry(
const char *entry_name,
bool needs_to_be_a_group =
false);
const int32_t C4GroupSwapThreshold
void C4Group_SetTempPath(const char *path)
bool C4Group_ExplodeDirectory(const char *filename)
const int C4GroupMaxError
bool C4Group_PackDirectoryTo(const char *filename, const char *to_filename)
const int C4GroupFileVer2
bool C4Group_PackDirectory(const char *filename)
void C4Group_SetSortList(const char **sort_list)
bool C4Group_MoveItem(const char *source, const char *target, bool no_sorting=false)
void C4Group_SetProcessCallback(bool(*callback)(const char *, int))
bool C4Group_TestIgnore(const char *filename)
bool C4Group_CopyItem(const char *source, const char *target, bool no_sorting=false, bool reset_attributes=false)
bool C4Group_UnpackDirectory(const char *filename)
const int C4GroupFileVer1
bool C4Group_IsGroup(const char *filename)
const char * C4Group_GetTempPath()
bool C4Group_ReadFile(const char *filename, char **data, size_t *size)
bool C4Group_DeleteItem(const char *item_name, bool do_recycle=false)
void SCopy(const char *szSource, char *sTarget, size_t iMaxL)
void Set(const DirectoryIterator &directories, const char *path)
char DiskPath[_MAX_PATH_LEN]
bool Rename(const char *filename, const char *new_name)
bool Read(void *buffer, size_t size) override
bool FindNextEntry(const char *wildcard, StdStrBuf *filename=nullptr, size_t *size=nullptr, bool start_at_filename=false)
const C4GroupEntry * GetFirstEntry() const
bool DeleteEntry(const char *filename, bool do_recycle=false)
bool HasPackedMother() const
bool Merge(const char *folders)
size_t EntrySize(const char *wildcard=nullptr)
const C4GroupHeader & GetHeader() const
bool Extract(const char *files, const char *destination=nullptr, const char *exclude=nullptr)
const char * GetName() const
size_t AccessedEntrySize() const override
bool AccessNextEntry(const char *wildcard, size_t *size=nullptr, char *filename=nullptr, bool start_at_filename=false)
bool FindEntry(const char *wildcard, char *filename)
bool AccessEntry(const char *wildcard, size_t *size=nullptr, char *filename=nullptr, bool needs_to_be_a_group=false)
int EntryCount(const char *wildcard=nullptr)
StdStrBuf GetFullName() const
int PreCacheEntries(const char *search_pattern, bool cache_previous=false)
bool ExtractEntry(const char *filename, const char *destination=nullptr)
bool Add(const char *filename, const char *entry_name)
unsigned int EntryCRC32(const char *wildcard=nullptr)
C4Group & operator=(C4Group &&)=default
bool LoadEntry(const char *entry_name, char **buffer, size_t *size_info=nullptr, int zeros_to_append=0)
bool OpenAsChild(C4Group *mother, const char *entry_name, bool is_exclusive=false, bool do_create=false)
bool SetNoSort(bool no_sorting)
C4GroupEntry * GetEntry(const char *entry_name)
bool LoadEntry(const StdStrBuf &name, StdBuf *buffer)
bool LoadEntryString(const char *entry_name, StdStrBuf *buffer)
bool OpenChild(const char *entry_name)
bool Sort(const char *list)
void SetStdOutput(bool log_status)
C4Group(C4Group &&)=default
void ResetSearch(bool reload_contents=false)
bool Move(const char *filename, const char *entry_name)
bool Delete(const char *files, bool recursive=false)
bool FindNextEntry(const char *wildcard, char *filename, size_t *size=nullptr, bool start_at_filename=false)
bool SortByList(const char **list, const char *filename=nullptr)
bool FindEntry(const char *wildcard, StdStrBuf *filename=nullptr, size_t *size=nullptr)
bool Open(const char *group_name, bool do_create=false)
bool Advance(int offset) override
bool LoadEntryString(const StdStrBuf &name, StdStrBuf *buffer)
const char * getData() const