541ff51a6e
* rename BCatalogAddOn to BCatalogData, since it doesn't represent an add-on, but rather the catalog data provided by an add-on * move BCatalogData out of Catalog.{h,cpp} into its own header and implementation file * drop BCatalogData::MarkForTranslation() methods, they're not needed * drop BCatalog::GetNoAutoCollectString() methods, they're not being used anywhere * cleanup the B_TRANSLATE_... macros somewhat * add versions of the B_TRANSLATE_MARK_... macros that are meant to be used in void context (when the string isn't being used by the program, just meant to be picked up by collectcatkeys). * adjust several apps to use B_TRANSLATE_MARK_..._VOID where needed * adjust users of BCatalogAddOn accordingly
53 lines
1.1 KiB
C++
53 lines
1.1 KiB
C++
/*
|
|
* Copyright 2009, Adrien Destugues, pulkomandy@gmail.com.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _PLAINTEXT_CATALOG_H_
|
|
#define _PLAINTEXT_CATALOG_H_
|
|
|
|
|
|
#include <HashMapCatalog.h>
|
|
#include <DataIO.h>
|
|
#include <String.h>
|
|
|
|
|
|
class BFile;
|
|
|
|
namespace BPrivate {
|
|
|
|
|
|
class PlainTextCatalog : public HashMapCatalog {
|
|
public:
|
|
PlainTextCatalog(const char *signature, const char *language,
|
|
uint32 fingerprint);
|
|
// constructor for normal use
|
|
PlainTextCatalog(entry_ref *appOrAddOnRef);
|
|
// constructor for embedded catalog
|
|
PlainTextCatalog(const char *path, const char *signature,
|
|
const char *language);
|
|
// constructor for editor-app
|
|
|
|
~PlainTextCatalog();
|
|
|
|
// implementation for editor-interface:
|
|
status_t ReadFromFile(const char *path = NULL);
|
|
status_t WriteToFile(const char *path = NULL);
|
|
|
|
static BCatalogData *Instantiate(const char *signature,
|
|
const char *language, uint32 fingerprint);
|
|
|
|
static const char *kCatMimeType;
|
|
|
|
private:
|
|
void UpdateAttributes(BFile& catalogFile);
|
|
void UpdateAttributes(const char* path);
|
|
|
|
mutable BString fPath;
|
|
};
|
|
|
|
|
|
} // namespace BPrivate
|
|
|
|
|
|
#endif /* _PLAINTEXT_CATALOG_H_ */
|