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: |
Adrien Destugues | c102dfd | 2015-01-18 11:50:51 +0100 | [diff] [blame] | 21 | AmigaCatalog(const entry_ref &owner, const char *language, |
Adrien Destugues | 374c6dc | 2015-01-11 16:37:56 +0100 | [diff] [blame] | 22 | uint32 fingerprint); |
| 23 | // constructor for normal use |
Adrien Destugues | 374c6dc | 2015-01-11 16:37:56 +0100 | [diff] [blame] | 24 | AmigaCatalog(const char *path, const char *signature, |
| 25 | const char *language); |
| 26 | // constructor for editor-app |
| 27 | |
| 28 | ~AmigaCatalog(); |
| 29 | |
| 30 | // implementation for editor-interface: |
| 31 | status_t ReadFromFile(const char *path = NULL); |
| 32 | status_t WriteToFile(const char *path = NULL); |
| 33 | |
Adrien Destugues | c102dfd | 2015-01-18 11:50:51 +0100 | [diff] [blame] | 34 | static BCatalogData *Instantiate(const entry_ref &signature, |
Adrien Destugues | 374c6dc | 2015-01-11 16:37:56 +0100 | [diff] [blame] | 35 | const char *language, uint32 fingerprint); |
| 36 | |
| 37 | static const char *kCatMimeType; |
| 38 | |
| 39 | private: |
| 40 | void UpdateAttributes(BFile& catalogFile); |
| 41 | void UpdateAttributes(const char* path); |
| 42 | |
| 43 | mutable BString fPath; |
| 44 | }; |
| 45 | |
| 46 | |
| 47 | } // namespace BPrivate |
| 48 | |
| 49 | |
| 50 | #endif /* _AMIGA_CATALOG_H_ */ |