libroot/posix/stdio: Remove unused portions.
[haiku.git] / src / apps / resedit / ResourceData.h
blob884c90b5331535d838e690c0f7f1bb7072fd88bb
1 /*
2 * Copyright (c) 2005-2010, Haiku, Inc.
3 * Distributed under the terms of the MIT license.
5 * Author:
6 * DarkWyrm <darkwyrm@gmail.com>
7 */
8 #ifndef RESOURCE_DATA_H
9 #define RESOURCE_DATA_H
11 #include <fs_attr.h>
12 #include <Resources.h>
13 #include <Node.h>
14 #include <String.h>
16 class ResourceData
18 public:
19 ResourceData(void);
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);
24 ~ResourceData(void);
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; }
50 private:
51 int32 fType;
52 BString fTypeString;
53 int32 fID;
54 BString fIDString;
55 BString fName;
56 char *fData;
57 size_t fLength;
58 bool fAttr;
61 #endif