2 * Copyright (c) 2005-2010, Haiku, Inc.
3 * Distributed under the terms of the MIT license.
6 * DarkWyrm <darkwyrm@gmail.com>
8 #ifndef RESOURCE_DATA_H
9 #define RESOURCE_DATA_H
12 #include <Resources.h>
20 ResourceData(const type_code
&code
, const int32
&id
,
21 const char *name
, char *data
,
22 const size_t &length
);
23 ResourceData(const ResourceData
&data
);
25 void SetTo(const type_code
&code
, const int32
&id
,
26 const char *name
, char *data
, const size_t &length
);
27 ResourceData
& operator=(const ResourceData
&data
);
29 bool SetFromResource(const int32
&index
, BResources
&res
);
30 bool SetFromAttribute(const char *name
, BNode
&node
);
32 type_code
GetType(void) const { return fType
; }
33 const char * GetTypeString(void) const { return fTypeString
.String(); }
34 void SetType(const type_code
&code
);
36 int32
GetID(void) const { return fID
; }
37 const char * GetIDString(void) const { return fIDString
.String(); }
38 void SetID(const int32
&id
);
40 const char * GetName(void) const { return fName
.String(); }
41 void SetName(const char *name
) { fName
= name
; }
43 char * GetData(void) { return fData
; }
44 size_t GetLength(void) const { return fLength
; }
45 void SetData(const char *data
, const size_t &size
);
47 bool IsAttribute(void) const { return fAttr
; }
48 void SetAttribute(const bool &value
) { fAttr
= value
; }