xref: /haiku/src/apps/aboutsystem/Utilities.h (revision 425b1199b0cb2116ac84cd286d29569e62d86774)
1 /*
2  * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT license.
4  */
5 #ifndef UTILITIES_H
6 #define UTILITIES_H
7 
8 #include <String.h>
9 
10 
11 class BMessage;
12 
13 
14 BString trim_string(const char* string, size_t len);
15 	// Removes leading and trailing white space and replaces all sequences
16 	// of white space by a single space.
17 
18 
19 class Licenses {
20 public:
21 								Licenses(const char* license,...);
22 									// NULL terminated list
23 								Licenses(const BMessage& licenses);
24 									// all elements of field "License"
25 								~Licenses();
26 
27 			int32				CountLicenses() const	{ return fCount; }
28 			const char*			LicenseAt(int32 index) const;
29 
30 private:
31 			BString*			fLicenses;
32 			int32				fCount;
33 };
34 
35 
36 #endif	// UTILITIES_H
37