xref: /haiku/src/add-ons/kernel/file_systems/packagefs/util/StringConstants.h (revision fce4895d1884da5ae6fb299d23c735c598e690b1)
1 /*
2  * Copyright 2013, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef STRING_CONSTANTS_H
6 #define STRING_CONSTANTS_H
7 
8 
9 #include "AutoPackageAttributes.h"
10 	// for the kAutoPackageAttributeNames array size
11 #include "String.h"
12 
13 
14 class StringConstants {
15 public:
16 			// generate the member variable declarations
17 			#define DEFINE_STRING_CONSTANT(name, value) \
18 				String	name;
19 			#define DEFINE_STRING_ARRAY_CONSTANT(name, size, ...) \
20 				String	name[size];
21 
22 			#include "StringConstantsPrivate.h"
23 
24 			#undef DEFINE_STRING_CONSTANT
25 			#undef DEFINE_STRING_ARRAY_CONSTANT
26 
27 public:
28 	static	bool				Init();
29 	static	void				Cleanup();
30 
31 	static	const StringConstants& Get()
32 									{ return sDefaultInstance; }
33 
34 private:
35 			bool				_Init();
36 
37 private:
38 	static	StringConstants		sDefaultInstance;
39 };
40 
41 
42 #endif	// STRING_CONSTANTS_H
43