Fix FreeBSD build.
[haiku.git] / src / tools / restest / ResourceItem.h
blob4732bd6138d562f7d16b2f974782d3e06be4ba8b
1 // ResourceItem.h
3 #ifndef RESOURCE_ITEM_H
4 #define RESOURCE_ITEM_H
6 #include <String.h>
7 #include <SupportDefs.h>
9 class BPositionIO;
11 class ResourceItem {
12 public:
13 typedef int32 roff_t;
15 public:
16 ResourceItem();
17 virtual ~ResourceItem();
19 void SetLocation(roff_t offset, roff_t size);
20 void SetIdentity(type_code type, int32 id,
21 const char* name);
23 void SetOffset(roff_t offset);
24 roff_t GetOffset() const;
26 void SetSize(roff_t size);
27 roff_t GetSize() const;
29 void SetType(type_code type);
30 type_code GetType() const;
32 void SetID(int32 id);
33 int32 GetID() const;
35 void SetName(const char* name);
36 const char* GetName() const;
38 void SetData(const void* data, roff_t size = -1);
39 void UnsetData();
40 void* AllocData(roff_t size = -1);
41 void* GetData() const;
43 status_t LoadData(BPositionIO& file,
44 roff_t position = -1,
45 roff_t size = -1);
46 status_t WriteData(BPositionIO& file) const;
48 void PrintToStream();
50 private:
51 roff_t fOffset;
52 roff_t fSize;
53 type_code fType;
54 int32 fID;
55 BString fName;
56 void* fData;
59 #endif // RESOURCE_ITEM_H