00001
00002
00003
00004
00005
00006 #ifndef RC_AUXDATA_H
00007 #define RC_AUXDATA_H
00008
00009 #define AUX_DEFAULT_ENTRIES_SIZE 4
00010
00011 typedef struct {
00012
00013 char *tag;
00014 void *data;
00015 u32 size;
00016
00017 } AuxData_t;
00018
00019 class Auxiliary {
00020
00021 public:
00022
00023 Auxiliary(
00024 u32 entries_size = AUX_DEFAULT_ENTRIES_SIZE
00025 );
00026
00027 ~Auxiliary();
00028
00029
00030 public:
00031
00032 void setData(
00033 char *tag,
00034 void *data,
00035 u32 size
00036 );
00037
00038 void setString(
00039 char *tag,
00040 char *str
00041 );
00042
00043 void remove(
00044 char *name
00045 );
00046
00047 void *getData(
00048 char *tag
00049 );
00050
00051 void *getData(
00052 char *tag,
00053 i32 *size
00054 );
00055
00056 char *getString(
00057 char *tag
00058 );
00059
00060
00061 AuxData_t *getEntries();
00062
00063 u32 getEntryCount() const;
00064
00065 void copyTo(
00066 Auxiliary *aux
00067 );
00068
00069 private:
00070
00071 i32 findEntry(
00072 const char *tag
00073 );
00074
00075 void ensureStorage();
00076
00077 private:
00078
00079 AuxData_t *entries;
00080 u32 n_entries;
00081 u32 max_entries;
00082
00083 };
00084
00085 #endif
00086
00087