summaryrefslogtreecommitdiff
path: root/src/libaudtag/tag_module.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libaudtag/tag_module.h')
-rw-r--r--src/libaudtag/tag_module.h30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/libaudtag/tag_module.h b/src/libaudtag/tag_module.h
index a520c13..71360f7 100644
--- a/src/libaudtag/tag_module.h
+++ b/src/libaudtag/tag_module.h
@@ -23,17 +23,23 @@
#include "libaudcore/tuple.h"
#include "libaudcore/vfs.h"
-typedef Tuple* pTuple;
-
-typedef struct _module {
- char *name;
- int type; /* set to TAG_TYPE_NONE if the module cannot create new tags */
- bool_t(*can_handle_file) (VFSFile *fd);
- bool_t (* read_tag) (Tuple * tuple, VFSFile * handle);
- bool_t (* read_image) (VFSFile * handle, void * * data, int64_t * size);
- bool_t (* write_tag) (const Tuple * tuple, VFSFile * handle);
-} tag_module_t;
-
-tag_module_t * find_tag_module (VFSFile * handle, int new_type);
+namespace audtag {
+
+struct TagModule {
+ const char *m_name;
+ TagType m_type; /* set to None if the module cannot create new tags */
+
+ virtual bool can_handle_file (VFSFile &fd);
+ virtual bool read_tag (Tuple & tuple, VFSFile & handle);
+ virtual Index<char> read_image (VFSFile & handle);
+ virtual bool write_tag (const Tuple & tuple, VFSFile & handle);
+
+protected:
+ TagModule(const char *name, TagType type) : m_name(name), m_type(type) { };
+};
+
+TagModule * find_tag_module (VFSFile & handle, TagType new_type);
+
+}
#endif /* TAG_MODULE_H */