aboutsummaryrefslogtreecommitdiff
path: root/Src/apev2/header.h
diff options
context:
space:
mode:
Diffstat (limited to 'Src/apev2/header.h')
-rw-r--r--Src/apev2/header.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/Src/apev2/header.h b/Src/apev2/header.h
new file mode 100644
index 00000000..8f840414
--- /dev/null
+++ b/Src/apev2/header.h
@@ -0,0 +1,44 @@
+#ifndef NULLSOFT_APEV2_HEADER_H
+#define NULLSOFT_APEV2_HEADER_H
+
+#include <bfc/platform/types.h>
+
+namespace APEv2
+{
+
+#pragma pack(push, 1)
+ struct HeaderData
+ {
+ uint64_t preamble;
+ uint32_t version;
+ uint32_t size;
+ uint32_t items;
+ uint32_t flags;
+ uint16_t reserved;
+ };
+#pragma pack(pop)
+
+class Header
+{
+public:
+ Header(void *data);
+ Header(const HeaderData *data);
+ bool Valid();
+ uint32_t TagSize();
+ bool HasHeader();
+ bool HasFooter();
+ bool IsFooter();
+ bool IsHeader();
+ int Encode(void *data, size_t len);
+ uint32_t GetFlags();
+enum
+{
+ SIZE=32,
+};
+private:
+ HeaderData headerData;
+};
+}
+
+
+#endif \ No newline at end of file