OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
group-handle.cpp File Reference
Include dependency graph for group-handle.cpp:

Go to the source code of this file.

Macros

#define GROUP_TO_HANDLE(group)   (reinterpret_cast<C4GroupHandle*>(group))
 
#define HANDLE_TO_GROUP(handle)   (reinterpret_cast<C4Group*>(handle))
 

Functions

C4GroupHandlec4_group_handle_new (void)
 
void c4_group_handle_free (C4GroupHandle *handle)
 
const gchar * c4_group_handle_get_error (C4GroupHandle *handle)
 
gboolean c4_group_handle_open (C4GroupHandle *handle, const gchar *path, gboolean create)
 
gboolean c4_group_handle_open_as_child (C4GroupHandle *handle, C4GroupHandle *mother, const gchar *name, gboolean exclusive, gboolean create)
 
const gchar * c4_group_handle_get_name (C4GroupHandle *handle)
 
gchar * c4_group_handle_get_full_name (C4GroupHandle *handle)
 
void c4_group_handle_reset_search (C4GroupHandle *handle)
 
gboolean c4_group_handle_find_next_entry (C4GroupHandle *handle, const gchar *wildcard, gsize *size, gchar *filename, gboolean start_at_filename)
 
gboolean c4_group_handle_access_next_entry (C4GroupHandle *handle, const gchar *wildcard, gsize *size, gchar *filename, gboolean start_at_filename)
 
gboolean c4_group_handle_access_entry (C4GroupHandle *handle, const gchar *wildcard, gsize *size, gchar *filename, gboolean needs_to_be_a_group)
 
gsize c4_group_handle_accessed_entry_size (C4GroupHandle *handle)
 
gboolean c4_group_handle_read (C4GroupHandle *handle, gpointer buffer, gsize size)
 
gboolean c4_group_handle_is_folder (C4GroupHandle *handle)
 

Macro Definition Documentation

#define GROUP_TO_HANDLE (   group)    (reinterpret_cast<C4GroupHandle*>(group))

Definition at line 20 of file group-handle.cpp.

Referenced by c4_group_handle_new().

Function Documentation

gboolean c4_group_handle_access_entry ( C4GroupHandle handle,
const gchar *  wildcard,
gsize *  size,
gchar *  filename,
gboolean  needs_to_be_a_group 
)

Definition at line 79 of file group-handle.cpp.

References HANDLE_TO_GROUP.

Referenced by mape_group_load_entry().

80 {
81  return HANDLE_TO_GROUP(handle)->AccessEntry(wildcard, size, filename, needs_to_be_a_group);
82 }
#define HANDLE_TO_GROUP(handle)

Here is the caller graph for this function:

gboolean c4_group_handle_access_next_entry ( C4GroupHandle handle,
const gchar *  wildcard,
gsize *  size,
gchar *  filename,
gboolean  start_at_filename 
)

Definition at line 74 of file group-handle.cpp.

References HANDLE_TO_GROUP.

75 {
76  return HANDLE_TO_GROUP(handle)->AccessNextEntry(wildcard, size, filename, start_at_filename);
77 }
#define HANDLE_TO_GROUP(handle)
gsize c4_group_handle_accessed_entry_size ( C4GroupHandle handle)

Definition at line 84 of file group-handle.cpp.

References HANDLE_TO_GROUP.

85 {
86  return HANDLE_TO_GROUP(handle)->AccessedEntrySize();
87 }
#define HANDLE_TO_GROUP(handle)
gboolean c4_group_handle_find_next_entry ( C4GroupHandle handle,
const gchar *  wildcard,
gsize *  size,
gchar *  filename,
gboolean  start_at_filename 
)

Definition at line 69 of file group-handle.cpp.

References HANDLE_TO_GROUP.

Referenced by mape_group_get_next_entry(), and mape_group_has_entry().

70 {
71  return HANDLE_TO_GROUP(handle)->FindNextEntry(wildcard, filename, size, start_at_filename);
72 }
#define HANDLE_TO_GROUP(handle)

Here is the caller graph for this function:

void c4_group_handle_free ( C4GroupHandle handle)

Definition at line 30 of file group-handle.cpp.

References HANDLE_TO_GROUP.

Referenced by mape_group_close(), mape_group_open(), and mape_group_open_child().

31 {
32  delete HANDLE_TO_GROUP(handle);
33 }
#define HANDLE_TO_GROUP(handle)

Here is the caller graph for this function:

const gchar* c4_group_handle_get_error ( C4GroupHandle handle)

Definition at line 35 of file group-handle.cpp.

References HANDLE_TO_GROUP.

Referenced by mape_group_load_entry(), mape_group_open(), and mape_group_open_child().

36 {
37  return HANDLE_TO_GROUP(handle)->GetError();
38 }
#define HANDLE_TO_GROUP(handle)

Here is the caller graph for this function:

gchar* c4_group_handle_get_full_name ( C4GroupHandle handle)

Definition at line 56 of file group-handle.cpp.

References StdStrBuf::getData(), StdStrBuf::getSize(), and HANDLE_TO_GROUP.

Referenced by mape_group_get_full_name(), and mape_group_is_child_folder().

57 {
58  StdStrBuf buf(HANDLE_TO_GROUP(handle)->GetFullName());
59  gchar* res = static_cast<gchar*>(g_malloc(buf.getSize()*sizeof(gchar)));
60  memcpy(res, buf.getData(), buf.getSize());
61  return res;
62 }
#define HANDLE_TO_GROUP(handle)

Here is the call graph for this function:

Here is the caller graph for this function:

const gchar* c4_group_handle_get_name ( C4GroupHandle handle)

Definition at line 51 of file group-handle.cpp.

References HANDLE_TO_GROUP.

Referenced by mape_group_get_name().

52 {
53  return HANDLE_TO_GROUP(handle)->GetName();
54 }
#define HANDLE_TO_GROUP(handle)

Here is the caller graph for this function:

gboolean c4_group_handle_is_folder ( C4GroupHandle handle)

Definition at line 94 of file group-handle.cpp.

References HANDLE_TO_GROUP, C4Group::IsOpen(), and C4Group::IsPacked().

Referenced by mape_group_is_child_folder().

95 {
96  C4Group *group = HANDLE_TO_GROUP(handle);
97  return group->IsOpen() && !group->IsPacked();
98 }
bool IsOpen() const
Definition: C4Group.cpp:1891
#define HANDLE_TO_GROUP(handle)
bool IsPacked() const
Definition: C4Group.cpp:2009

Here is the call graph for this function:

Here is the caller graph for this function:

C4GroupHandle* c4_group_handle_new ( void  )

Definition at line 25 of file group-handle.cpp.

References GROUP_TO_HANDLE.

Referenced by mape_group_open(), and mape_group_open_child().

26 {
27  return GROUP_TO_HANDLE(new C4Group);
28 }
#define GROUP_TO_HANDLE(group)

Here is the caller graph for this function:

gboolean c4_group_handle_open ( C4GroupHandle handle,
const gchar *  path,
gboolean  create 
)

Definition at line 40 of file group-handle.cpp.

References HANDLE_TO_GROUP.

Referenced by mape_group_open().

41 {
42  return HANDLE_TO_GROUP(handle)->Open(path, create);
43 }
#define HANDLE_TO_GROUP(handle)

Here is the caller graph for this function:

gboolean c4_group_handle_open_as_child ( C4GroupHandle handle,
C4GroupHandle mother,
const gchar *  name,
gboolean  exclusive,
gboolean  create 
)

Definition at line 45 of file group-handle.cpp.

References HANDLE_TO_GROUP.

Referenced by mape_group_open_child().

46 {
47  return HANDLE_TO_GROUP(handle)->OpenAsChild(HANDLE_TO_GROUP(mother),
48  name, exclusive, create);
49 }
#define HANDLE_TO_GROUP(handle)

Here is the caller graph for this function:

gboolean c4_group_handle_read ( C4GroupHandle handle,
gpointer  buffer,
gsize  size 
)

Definition at line 89 of file group-handle.cpp.

References HANDLE_TO_GROUP.

Referenced by mape_group_load_entry().

90 {
91  return HANDLE_TO_GROUP(handle)->Read(buffer, size);
92 }
#define HANDLE_TO_GROUP(handle)

Here is the caller graph for this function:

void c4_group_handle_reset_search ( C4GroupHandle handle)

Definition at line 64 of file group-handle.cpp.

References HANDLE_TO_GROUP.

Referenced by mape_group_has_entry(), and mape_group_rewind().

65 {
66  HANDLE_TO_GROUP(handle)->ResetSearch();
67 }
#define HANDLE_TO_GROUP(handle)

Here is the caller graph for this function: