2 * Copyright 2001-2010, Haiku Inc.
3 * Distributed under the terms of the MIT License.
5 #ifndef _RESOURCE_STRINGS_H
6 #define _RESOURCE_STRINGS_H
17 /*! \brief Simple class to access the string resources in a file.
19 A BResourceStrings object reads the string type resources from a given
20 resource file and provides fast read only access to them.
22 class BResourceStrings
{
25 BResourceStrings(const entry_ref
& ref
);
26 virtual ~BResourceStrings();
29 virtual BString
* NewString(int32 id
);
30 virtual const char* FindString(int32 id
);
32 virtual status_t
SetStringFile(const entry_ref
* ref
);
33 status_t
GetStringFile(entry_ref
* outRef
);
36 RESOURCE_TYPE
= 'CSTR'
40 struct _string_id_hash
{
44 void assign_string(const char* str
, bool makeCopy
);
46 _string_id_hash
* next
;
57 status_t
_Rehash(int32 newSize
);
58 _string_id_hash
* _AddString(char* str
, int32 id
,
61 virtual _string_id_hash
* _FindString(int32 id
);
63 virtual status_t
_Reserved_ResourceStrings_0(void*);
64 virtual status_t
_Reserved_ResourceStrings_1(void*);
65 virtual status_t
_Reserved_ResourceStrings_2(void*);
66 virtual status_t
_Reserved_ResourceStrings_3(void*);
67 virtual status_t
_Reserved_ResourceStrings_4(void*);
68 virtual status_t
_Reserved_ResourceStrings_5(void*);
76 BResources
*fResources
;
77 _string_id_hash
**fHashTable
;
80 uint32 _reserved
[16]; // FBC
84 #endif // _RESOURCE_STRINGS_H