2 * Copyright 2008-2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT license.
10 #include <InterfaceDefs.h>
17 #define COPYRIGHT_STRING "Copyright " B_UTF8_COPYRIGHT " "
20 BString
trim_string(const char* string
, size_t len
);
21 // Removes leading and trailing white space and replaces all sequences
22 // of white space by a single space.
24 void parse_named_url(const BString
& namedURL
, BString
& name
, BString
& url
);
30 explicit StringVector(const char* string
,...);
31 // NULL terminated list
32 StringVector(const BMessage
& strings
,
33 const char* fieldName
);
34 // all elements of the given field
35 StringVector(const StringVector
& other
);
38 bool IsEmpty() const { return fCount
== 0; }
39 int32
CountStrings() const { return fCount
; }
40 const char* StringAt(int32 index
) const;
42 void SetTo(const char* string
,...);
43 void SetTo(const char* string
, va_list strings
);
44 void SetTo(const BMessage
& strings
,
45 const char* fieldName
,
46 const char* prefix
= NULL
);
58 PackageCredit(const char* packageName
);
60 const BMessage
& packageDescription
);
61 PackageCredit(const PackageCredit
& other
);
66 bool IsBetterThan(const PackageCredit
& other
) const;
68 PackageCredit
& SetCopyrights(const char* copyright
,...);
69 PackageCredit
& SetCopyright(const char* copyright
);
70 PackageCredit
& SetLicenses(const char* license
,...);
71 PackageCredit
& SetLicense(const char* license
);
72 PackageCredit
& SetSources(const char* source
,...);
73 PackageCredit
& SetSource(const char* source
);
74 PackageCredit
& SetURL(const char* url
);
76 const char* PackageName() const;
78 const StringVector
& Copyrights() const;
79 int32
CountCopyrights() const;
80 const char* CopyrightAt(int32 index
) const;
82 const StringVector
& Licenses() const;
83 int32
CountLicenses() const;
84 const char* LicenseAt(int32 index
) const;
86 const StringVector
& Sources() const;
87 int32
CountSources() const;
88 const char* SourceAt(int32 index
) const;
90 const char* URL() const;
92 static bool NameLessInsensitive(const PackageCredit
* a
,
93 const PackageCredit
* b
);
96 int _MaxCopyrightYear() const;
100 StringVector fCopyrights
;
101 StringVector fLicenses
;
102 StringVector fSources
;
107 #endif // UTILITIES_H