blob: fd69c1b8d44fcec937b70ef52699e062ac61f939 [file] [log] [blame]
Adrien Destugues374c6dc2015-01-11 16:37:56 +01001/*
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
14class BFile;
15
16namespace BPrivate {
17
18
19class AmigaCatalog : public HashMapCatalog {
20 public:
Adrien Destuguesc102dfd2015-01-18 11:50:51 +010021 AmigaCatalog(const entry_ref &owner, const char *language,
Adrien Destugues374c6dc2015-01-11 16:37:56 +010022 uint32 fingerprint);
23 // constructor for normal use
Adrien Destugues374c6dc2015-01-11 16:37:56 +010024 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 Destuguesc102dfd2015-01-18 11:50:51 +010034 static BCatalogData *Instantiate(const entry_ref &signature,
Adrien Destugues374c6dc2015-01-11 16:37:56 +010035 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_ */