2 ** Distributed under the terms of the MIT License.
3 ** Copyright 2003-2004,2012. All rights reserved.
5 ** Authors: Axel Dörfler, axeld@pinc-software.de
6 ** Oliver Tappe, zooey@hirschkaefer.de
10 #include <CatalogData.h>
13 // Provides an implementation of BCatalog for the build host, in effect only
14 // supporting setting and getting of catalog entries.
24 BCatalog::BCatalog(const entry_ref
& catalogOwner
, const char *language
,
38 BCatalog::GetString(const char *string
, const char *context
, const char *comment
)
40 if (fCatalogData
== 0)
43 const char *translated
;
44 for (BCatalogData
* cat
= fCatalogData
; cat
!= NULL
; cat
= cat
->fNext
) {
45 translated
= cat
->GetString(string
, context
, comment
);
55 BCatalog::GetString(uint32 id
)
57 if (fCatalogData
== 0)
60 const char *translated
;
61 for (BCatalogData
* cat
= fCatalogData
; cat
!= NULL
; cat
= cat
->fNext
) {
62 translated
= cat
->GetString(id
);
72 BCatalog::GetData(const char *name
, BMessage
*msg
)
74 if (fCatalogData
== 0)
78 for (BCatalogData
* cat
= fCatalogData
; cat
!= NULL
; cat
= cat
->fNext
) {
79 res
= cat
->GetData(name
, msg
);
80 if (res
!= B_NAME_NOT_FOUND
&& res
!= EOPNOTSUPP
)
82 // return B_OK if found, or specific error-code
85 return B_NAME_NOT_FOUND
;
90 BCatalog::GetData(uint32 id
, BMessage
*msg
)
92 if (fCatalogData
== 0)
96 for (BCatalogData
* cat
= fCatalogData
; cat
!= NULL
; cat
= cat
->fNext
) {
97 res
= cat
->GetData(id
, msg
);
98 if (res
!= B_NAME_NOT_FOUND
&& res
!= EOPNOTSUPP
)
100 // return B_OK if found, or specific error-code
103 return B_NAME_NOT_FOUND
;