Adrien Destugues | 374c6dc | 2015-01-11 16:37:56 +0100 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2009-2015, Adrien Destugues, pulkomandy@pulkomandy.tk. |
| 3 | * Distributed under the terms of the MIT License. |
| 4 | */ |
| 5 | #ifndef _AMIGA_CATALOG_H_ |
| 6 | #define _AMIGA_CATALOG_H_ |
| 7 | |
| 8 | |
| 9 | #include <HashMapCatalog.h> |
| 10 | #include <DataIO.h> |
| 11 | #include <String.h> |
| 12 | |
| 13 | |
| 14 | class BFile; |
| 15 | |
| 16 | namespace BPrivate { |
| 17 | |
| 18 | |
| 19 | class AmigaCatalog : public HashMapCatalog { |
| 20 | public: |
| 21 | AmigaCatalog(const char *signature, const char *language, |
| 22 | uint32 fingerprint); |
| 23 | // constructor for normal use |
| 24 | AmigaCatalog(entry_ref *appOrAddOnRef); |
| 25 | // constructor for embedded catalog |
| 26 | AmigaCatalog(const char *path, const char *signature, |
| 27 | const char *language); |
| 28 | // constructor for editor-app |
| 29 | |
| 30 | ~AmigaCatalog(); |
| 31 | |
| 32 | // implementation for editor-interface: |
| 33 | status_t ReadFromFile(const char *path = NULL); |
| 34 | status_t WriteToFile(const char *path = NULL); |
| 35 | |
| 36 | static BCatalogData *Instantiate(const char *signature, |
| 37 | const char *language, uint32 fingerprint); |
| 38 | |
| 39 | static const char *kCatMimeType; |
| 40 | |
| 41 | private: |
| 42 | void UpdateAttributes(BFile& catalogFile); |
| 43 | void UpdateAttributes(const char* path); |
| 44 | |
| 45 | mutable BString fPath; |
| 46 | }; |
| 47 | |
| 48 | |
| 49 | } // namespace BPrivate |
| 50 | |
| 51 | |
| 52 | #endif /* _AMIGA_CATALOG_H_ */ |