Start cleanup of Catalog.{h,cpp}
* unify pointer style (to type* ) * always use boolean expressions in if * introduce some spacing for better readability * make a couple inline methods non-inline
This commit is contained in:
+20
-72
@@ -48,6 +48,8 @@ public:
|
|||||||
status_t InitCheck() const;
|
status_t InitCheck() const;
|
||||||
int32 CountItems() const;
|
int32 CountItems() const;
|
||||||
|
|
||||||
|
// TODO: drop this, as the lifetime of the returned object
|
||||||
|
// is indeterminate
|
||||||
BCatalogAddOn* CatalogAddOn();
|
BCatalogAddOn* CatalogAddOn();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -129,21 +131,21 @@ private:
|
|||||||
/* example:
|
/* example:
|
||||||
#define B_TRANSLATE_CONTEXT "MyDecentApp-Menu"
|
#define B_TRANSLATE_CONTEXT "MyDecentApp-Menu"
|
||||||
|
|
||||||
static const char *choices[] = {
|
static const char* choices[] = {
|
||||||
B_TRANSLATE_MARK("left"),
|
B_TRANSLATE_MARK("left"),
|
||||||
B_TRANSLATE_MARK("right"),
|
B_TRANSLATE_MARK("right"),
|
||||||
B_TRANSLATE_MARK("up"),
|
B_TRANSLATE_MARK("up"),
|
||||||
B_TRANSLATE_MARK("down")
|
B_TRANSLATE_MARK("down")
|
||||||
};
|
};
|
||||||
|
|
||||||
void MyClass::AddChoices(BMenu *menu) {
|
void MyClass::AddChoices(BMenu* menu) {
|
||||||
for (char **ch = choices; *ch; ch++) {
|
for (char** ch = choices; *ch != '\0'; ++ch) {
|
||||||
menu->AddItem(
|
menu->AddItem(
|
||||||
new BMenuItem(
|
new BMenuItem(
|
||||||
B_TRANSLATE(*ch),
|
B_TRANSLATE(*ch),
|
||||||
new BMessage(...)
|
new BMessage(...)
|
||||||
)
|
)
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
@@ -344,12 +346,13 @@ protected:
|
|||||||
// every catalog-add-on should export these symbols...
|
// every catalog-add-on should export these symbols...
|
||||||
// ...the function that instantiates a catalog for this add-on-type...
|
// ...the function that instantiates a catalog for this add-on-type...
|
||||||
extern "C"
|
extern "C"
|
||||||
BCatalogAddOn *instantiate_catalog(const char *signature,
|
BCatalogAddOn* instantiate_catalog(const char* signature, const char* language,
|
||||||
const char *language, uint32 fingerprint);
|
uint32 fingerprint);
|
||||||
|
|
||||||
// ...the function that creates an empty catalog for this add-on-type...
|
// ...the function that creates an empty catalog for this add-on-type...
|
||||||
extern "C"
|
extern "C"
|
||||||
BCatalogAddOn *create_catalog(const char *signature,
|
BCatalogAddOn* create_catalog(const char* signature, const char* language);
|
||||||
const char *language);
|
|
||||||
// ...and the priority which will be used to order the catalog-add-ons:
|
// ...and the priority which will be used to order the catalog-add-ons:
|
||||||
extern uint8 gCatalogAddOnPriority;
|
extern uint8 gCatalogAddOnPriority;
|
||||||
|
|
||||||
@@ -357,76 +360,22 @@ extern uint8 gCatalogAddOnPriority;
|
|||||||
/*
|
/*
|
||||||
* BCatalog - inlines for trivial accessors:
|
* BCatalog - inlines for trivial accessors:
|
||||||
*/
|
*/
|
||||||
inline status_t
|
inline const char*
|
||||||
BCatalog::GetSignature(BString *sig)
|
BCatalog::GetNoAutoCollectString(const char* string, const char* context,
|
||||||
{
|
const char* comment)
|
||||||
if (!sig)
|
|
||||||
return B_BAD_VALUE;
|
|
||||||
if (!fCatalog)
|
|
||||||
return B_NO_INIT;
|
|
||||||
*sig = fCatalog->fSignature;
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline status_t
|
|
||||||
BCatalog::GetLanguage(BString *lang)
|
|
||||||
{
|
|
||||||
if (!lang)
|
|
||||||
return B_BAD_VALUE;
|
|
||||||
if (!fCatalog)
|
|
||||||
return B_NO_INIT;
|
|
||||||
*lang = fCatalog->fLanguageName;
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline status_t
|
|
||||||
BCatalog::GetFingerprint(uint32 *fp)
|
|
||||||
{
|
|
||||||
if (!fp)
|
|
||||||
return B_BAD_VALUE;
|
|
||||||
if (!fCatalog)
|
|
||||||
return B_NO_INIT;
|
|
||||||
*fp = fCatalog->fFingerprint;
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const char *
|
|
||||||
BCatalog::GetNoAutoCollectString(const char *string, const char *context,
|
|
||||||
const char *comment)
|
|
||||||
{
|
{
|
||||||
return GetString(string, context, comment);
|
return GetString(string, context, comment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const char *
|
inline const char*
|
||||||
BCatalog::GetNoAutoCollectString(uint32 id)
|
BCatalog::GetNoAutoCollectString(uint32 id)
|
||||||
{
|
{
|
||||||
return GetString(id);
|
return GetString(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline status_t
|
inline BCatalogAddOn*
|
||||||
BCatalog::InitCheck() const
|
|
||||||
{
|
|
||||||
return fCatalog
|
|
||||||
? fCatalog->InitCheck()
|
|
||||||
: B_NO_INIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline int32
|
|
||||||
BCatalog::CountItems() const
|
|
||||||
{
|
|
||||||
if (!fCatalog)
|
|
||||||
return 0;
|
|
||||||
return fCatalog->CountItems();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline BCatalogAddOn *
|
|
||||||
BCatalog::CatalogAddOn()
|
BCatalog::CatalogAddOn()
|
||||||
{
|
{
|
||||||
return fCatalog;
|
return fCatalog;
|
||||||
@@ -436,16 +385,15 @@ BCatalog::CatalogAddOn()
|
|||||||
/*
|
/*
|
||||||
* BCatalogAddOn - inlines for trivial accessors:
|
* BCatalogAddOn - inlines for trivial accessors:
|
||||||
*/
|
*/
|
||||||
inline BCatalogAddOn *
|
inline BCatalogAddOn*
|
||||||
BCatalogAddOn::Next()
|
BCatalogAddOn::Next()
|
||||||
{
|
{
|
||||||
return fNext;
|
return fNext;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const char *
|
inline const char*
|
||||||
BCatalogAddOn::MarkForTranslation(const char *str,
|
BCatalogAddOn::MarkForTranslation(const char* str, const char* /* context */,
|
||||||
const char * /*ctx __attribute__ ((unused))*/,
|
const char* /* comment */)
|
||||||
const char * /*cmt __attribute__ ((unused))*/)
|
|
||||||
{
|
{
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|||||||
+132
-56
@@ -26,11 +26,11 @@ BCatalog::BCatalog()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BCatalog::BCatalog(const entry_ref &catalogOwner, const char *language,
|
BCatalog::BCatalog(const entry_ref& catalogOwner, const char* language,
|
||||||
uint32 fingerprint)
|
uint32 fingerprint)
|
||||||
{
|
{
|
||||||
fCatalog = MutableLocaleRoster::Default()->LoadCatalog(catalogOwner, language,
|
fCatalog = MutableLocaleRoster::Default()->LoadCatalog(catalogOwner,
|
||||||
fingerprint);
|
language, fingerprint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -40,65 +40,116 @@ BCatalog::~BCatalog()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const char *
|
const char*
|
||||||
BCatalog::GetString(const char *string, const char *context,
|
BCatalog::GetString(const char* string, const char* context,
|
||||||
const char *comment)
|
const char* comment)
|
||||||
{
|
{
|
||||||
const char *translated;
|
const char* translated;
|
||||||
for (BCatalogAddOn* cat = fCatalog; cat != NULL; cat = cat->fNext) {
|
for (BCatalogAddOn* cat = fCatalog; cat != NULL; cat = cat->fNext) {
|
||||||
translated = cat->GetString(string, context, comment);
|
translated = cat->GetString(string, context, comment);
|
||||||
if (translated)
|
if (translated != NULL)
|
||||||
return translated;
|
return translated;
|
||||||
}
|
}
|
||||||
|
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const char *
|
const char*
|
||||||
BCatalog::GetString(uint32 id)
|
BCatalog::GetString(uint32 id)
|
||||||
{
|
{
|
||||||
const char *translated;
|
const char* translated;
|
||||||
for (BCatalogAddOn* cat = fCatalog; cat != NULL; cat = cat->fNext) {
|
for (BCatalogAddOn* cat = fCatalog; cat != NULL; cat = cat->fNext) {
|
||||||
translated = cat->GetString(id);
|
translated = cat->GetString(id);
|
||||||
if (translated)
|
if (translated != NULL)
|
||||||
return translated;
|
return translated;
|
||||||
}
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BCatalog::GetData(const char *name, BMessage *msg)
|
BCatalog::GetData(const char* name, BMessage* msg)
|
||||||
{
|
{
|
||||||
if (!fCatalog)
|
if (fCatalog == NULL)
|
||||||
return B_NO_INIT;
|
return B_NO_INIT;
|
||||||
|
|
||||||
status_t res;
|
status_t res;
|
||||||
for (BCatalogAddOn* cat = fCatalog; cat != NULL; cat = cat->fNext) {
|
for (BCatalogAddOn* cat = fCatalog; cat != NULL; cat = cat->fNext) {
|
||||||
res = cat->GetData(name, msg);
|
res = cat->GetData(name, msg);
|
||||||
if (res != B_NAME_NOT_FOUND && res != EOPNOTSUPP)
|
if (res != B_NAME_NOT_FOUND && res != EOPNOTSUPP)
|
||||||
return res; // return B_OK if found, or specific error-code
|
return res; // return B_OK if found, or specific error-code
|
||||||
}
|
}
|
||||||
|
|
||||||
return B_NAME_NOT_FOUND;
|
return B_NAME_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BCatalog::GetData(uint32 id, BMessage *msg)
|
BCatalog::GetData(uint32 id, BMessage* msg)
|
||||||
{
|
{
|
||||||
if (!fCatalog)
|
if (fCatalog == NULL)
|
||||||
return B_NO_INIT;
|
return B_NO_INIT;
|
||||||
|
|
||||||
status_t res;
|
status_t res;
|
||||||
for (BCatalogAddOn* cat = fCatalog; cat != NULL; cat = cat->fNext) {
|
for (BCatalogAddOn* cat = fCatalog; cat != NULL; cat = cat->fNext) {
|
||||||
res = cat->GetData(id, msg);
|
res = cat->GetData(id, msg);
|
||||||
if (res != B_NAME_NOT_FOUND && res != EOPNOTSUPP)
|
if (res != B_NAME_NOT_FOUND && res != EOPNOTSUPP)
|
||||||
return res; // return B_OK if found, or specific error-code
|
return res; // return B_OK if found, or specific error-code
|
||||||
}
|
}
|
||||||
|
|
||||||
return B_NAME_NOT_FOUND;
|
return B_NAME_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BCatalog::SetCatalog(const entry_ref &catalogOwner, uint32 fingerprint)
|
BCatalog::GetSignature(BString* sig)
|
||||||
|
{
|
||||||
|
if (sig == NULL)
|
||||||
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
|
if (fCatalog == NULL)
|
||||||
|
return B_NO_INIT;
|
||||||
|
|
||||||
|
*sig = fCatalog->fSignature;
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
BCatalog::GetLanguage(BString* lang)
|
||||||
|
{
|
||||||
|
if (lang == NULL)
|
||||||
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
|
if (fCatalog == NULL)
|
||||||
|
return B_NO_INIT;
|
||||||
|
|
||||||
|
*lang = fCatalog->fLanguageName;
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
BCatalog::GetFingerprint(uint32* fp)
|
||||||
|
{
|
||||||
|
if (fp == NULL)
|
||||||
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
|
if (fCatalog == NULL)
|
||||||
|
return B_NO_INIT;
|
||||||
|
|
||||||
|
*fp = fCatalog->fFingerprint;
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
BCatalog::SetCatalog(const entry_ref& catalogOwner, uint32 fingerprint)
|
||||||
{
|
{
|
||||||
// This is not thread safe. It is used only in ReadOnlyBootPrompt and should
|
// This is not thread safe. It is used only in ReadOnlyBootPrompt and should
|
||||||
// not do harm there, but not sure what to do about it…
|
// not do harm there, but not sure what to do about it…
|
||||||
@@ -110,8 +161,22 @@ BCatalog::SetCatalog(const entry_ref &catalogOwner, uint32 fingerprint)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
BCatalog::InitCheck() const
|
||||||
|
{
|
||||||
|
return fCatalog != NULL ? fCatalog->InitCheck() : B_NO_INIT;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int32
|
||||||
|
BCatalog::CountItems() const
|
||||||
|
{
|
||||||
|
return fCatalog != NULL ? fCatalog->CountItems() : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//#pragma mark - BCatalogAddOn
|
//#pragma mark - BCatalogAddOn
|
||||||
BCatalogAddOn::BCatalogAddOn(const char *signature, const char *language,
|
BCatalogAddOn::BCatalogAddOn(const char* signature, const char* language,
|
||||||
uint32 fingerprint)
|
uint32 fingerprint)
|
||||||
:
|
:
|
||||||
fInitCheck(B_NO_INIT),
|
fInitCheck(B_NO_INIT),
|
||||||
@@ -154,29 +219,29 @@ BCatalogAddOn::CanHaveData() const
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BCatalogAddOn::GetData(const char *name, BMessage *msg)
|
BCatalogAddOn::GetData(const char* name, BMessage* msg)
|
||||||
{
|
{
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BCatalogAddOn::GetData(uint32 id, BMessage *msg)
|
BCatalogAddOn::GetData(uint32 id, BMessage* msg)
|
||||||
{
|
{
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BCatalogAddOn::SetString(const char *string, const char *translated,
|
BCatalogAddOn::SetString(const char* string, const char* translated,
|
||||||
const char *context, const char *comment)
|
const char* context, const char* comment)
|
||||||
{
|
{
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BCatalogAddOn::SetString(int32 id, const char *translated)
|
BCatalogAddOn::SetString(int32 id, const char* translated)
|
||||||
{
|
{
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
@@ -190,56 +255,56 @@ BCatalogAddOn::CanWriteData() const
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BCatalogAddOn::SetData(const char *name, BMessage *msg)
|
BCatalogAddOn::SetData(const char* name, BMessage* msg)
|
||||||
{
|
{
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BCatalogAddOn::SetData(uint32 id, BMessage *msg)
|
BCatalogAddOn::SetData(uint32 id, BMessage* msg)
|
||||||
{
|
{
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BCatalogAddOn::ReadFromFile(const char *path)
|
BCatalogAddOn::ReadFromFile(const char* path)
|
||||||
{
|
{
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BCatalogAddOn::ReadFromAttribute(const entry_ref &appOrAddOnRef)
|
BCatalogAddOn::ReadFromAttribute(const entry_ref& appOrAddOnRef)
|
||||||
{
|
{
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BCatalogAddOn::ReadFromResource(const entry_ref &appOrAddOnRef)
|
BCatalogAddOn::ReadFromResource(const entry_ref& appOrAddOnRef)
|
||||||
{
|
{
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BCatalogAddOn::WriteToFile(const char *path)
|
BCatalogAddOn::WriteToFile(const char* path)
|
||||||
{
|
{
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BCatalogAddOn::WriteToAttribute(const entry_ref &appOrAddOnRef)
|
BCatalogAddOn::WriteToAttribute(const entry_ref& appOrAddOnRef)
|
||||||
{
|
{
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BCatalogAddOn::WriteToResource(const entry_ref &appOrAddOnRef)
|
BCatalogAddOn::WriteToResource(const entry_ref& appOrAddOnRef)
|
||||||
{
|
{
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
@@ -258,7 +323,7 @@ BCatalogAddOn::CountItems() const
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BCatalogAddOn::SetNext(BCatalogAddOn *next)
|
BCatalogAddOn::SetNext(BCatalogAddOn* next)
|
||||||
{
|
{
|
||||||
fNext = next;
|
fNext = next;
|
||||||
}
|
}
|
||||||
@@ -266,8 +331,8 @@ BCatalogAddOn::SetNext(BCatalogAddOn *next)
|
|||||||
|
|
||||||
//#pragma mark - EditableCatalog
|
//#pragma mark - EditableCatalog
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
EditableCatalog::EditableCatalog(const char *type, const char *signature,
|
EditableCatalog::EditableCatalog(const char* type, const char* signature,
|
||||||
const char *language)
|
const char* language)
|
||||||
{
|
{
|
||||||
fCatalog = MutableLocaleRoster::Default()->CreateCatalog(type, signature,
|
fCatalog = MutableLocaleRoster::Default()->CreateCatalog(type, signature,
|
||||||
language);
|
language);
|
||||||
@@ -280,20 +345,22 @@ EditableCatalog::~EditableCatalog()
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
EditableCatalog::SetString(const char *string, const char *translated,
|
EditableCatalog::SetString(const char* string, const char* translated,
|
||||||
const char *context, const char *comment)
|
const char* context, const char* comment)
|
||||||
{
|
{
|
||||||
if (!fCatalog)
|
if (fCatalog == NULL)
|
||||||
return B_NO_INIT;
|
return B_NO_INIT;
|
||||||
|
|
||||||
return fCatalog->SetString(string, translated, context, comment);
|
return fCatalog->SetString(string, translated, context, comment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
EditableCatalog::SetString(int32 id, const char *translated)
|
EditableCatalog::SetString(int32 id, const char* translated)
|
||||||
{
|
{
|
||||||
if (!fCatalog)
|
if (fCatalog == NULL)
|
||||||
return B_NO_INIT;
|
return B_NO_INIT;
|
||||||
|
|
||||||
return fCatalog->SetString(id, translated);
|
return fCatalog->SetString(id, translated);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -301,87 +368,96 @@ EditableCatalog::SetString(int32 id, const char *translated)
|
|||||||
bool
|
bool
|
||||||
EditableCatalog::CanWriteData() const
|
EditableCatalog::CanWriteData() const
|
||||||
{
|
{
|
||||||
if (!fCatalog)
|
if (fCatalog == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return fCatalog->CanWriteData();
|
return fCatalog->CanWriteData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
EditableCatalog::SetData(const char *name, BMessage *msg)
|
EditableCatalog::SetData(const char* name, BMessage* msg)
|
||||||
{
|
{
|
||||||
if (!fCatalog)
|
if (fCatalog == NULL)
|
||||||
return B_NO_INIT;
|
return B_NO_INIT;
|
||||||
|
|
||||||
return fCatalog->SetData(name, msg);
|
return fCatalog->SetData(name, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
EditableCatalog::SetData(uint32 id, BMessage *msg)
|
EditableCatalog::SetData(uint32 id, BMessage* msg)
|
||||||
{
|
{
|
||||||
if (!fCatalog)
|
if (fCatalog == NULL)
|
||||||
return B_NO_INIT;
|
return B_NO_INIT;
|
||||||
|
|
||||||
return fCatalog->SetData(id, msg);
|
return fCatalog->SetData(id, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
EditableCatalog::ReadFromFile(const char *path)
|
EditableCatalog::ReadFromFile(const char* path)
|
||||||
{
|
{
|
||||||
if (!fCatalog)
|
if (fCatalog == NULL)
|
||||||
return B_NO_INIT;
|
return B_NO_INIT;
|
||||||
|
|
||||||
return fCatalog->ReadFromFile(path);
|
return fCatalog->ReadFromFile(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
EditableCatalog::ReadFromAttribute(const entry_ref &appOrAddOnRef)
|
EditableCatalog::ReadFromAttribute(const entry_ref& appOrAddOnRef)
|
||||||
{
|
{
|
||||||
if (!fCatalog)
|
if (fCatalog == NULL)
|
||||||
return B_NO_INIT;
|
return B_NO_INIT;
|
||||||
|
|
||||||
return fCatalog->ReadFromAttribute(appOrAddOnRef);
|
return fCatalog->ReadFromAttribute(appOrAddOnRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
EditableCatalog::ReadFromResource(const entry_ref &appOrAddOnRef)
|
EditableCatalog::ReadFromResource(const entry_ref& appOrAddOnRef)
|
||||||
{
|
{
|
||||||
if (!fCatalog)
|
if (fCatalog == NULL)
|
||||||
return B_NO_INIT;
|
return B_NO_INIT;
|
||||||
|
|
||||||
return fCatalog->ReadFromResource(appOrAddOnRef);
|
return fCatalog->ReadFromResource(appOrAddOnRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
EditableCatalog::WriteToFile(const char *path)
|
EditableCatalog::WriteToFile(const char* path)
|
||||||
{
|
{
|
||||||
if (!fCatalog)
|
if (fCatalog == NULL)
|
||||||
return B_NO_INIT;
|
return B_NO_INIT;
|
||||||
|
|
||||||
return fCatalog->WriteToFile(path);
|
return fCatalog->WriteToFile(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
EditableCatalog::WriteToAttribute(const entry_ref &appOrAddOnRef)
|
EditableCatalog::WriteToAttribute(const entry_ref& appOrAddOnRef)
|
||||||
{
|
{
|
||||||
if (!fCatalog)
|
if (fCatalog == NULL)
|
||||||
return B_NO_INIT;
|
return B_NO_INIT;
|
||||||
|
|
||||||
return fCatalog->WriteToAttribute(appOrAddOnRef);
|
return fCatalog->WriteToAttribute(appOrAddOnRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
EditableCatalog::WriteToResource(const entry_ref &appOrAddOnRef)
|
EditableCatalog::WriteToResource(const entry_ref& appOrAddOnRef)
|
||||||
{
|
{
|
||||||
if (!fCatalog)
|
if (fCatalog == NULL)
|
||||||
return B_NO_INIT;
|
return B_NO_INIT;
|
||||||
|
|
||||||
return fCatalog->WriteToResource(appOrAddOnRef);
|
return fCatalog->WriteToResource(appOrAddOnRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void EditableCatalog::MakeEmpty()
|
void EditableCatalog::MakeEmpty()
|
||||||
{
|
{
|
||||||
if (fCatalog)
|
if (fCatalog == NULL)
|
||||||
fCatalog->MakeEmpty();
|
fCatalog->MakeEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user