Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/rarfilesource.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOV2 <overfiend@sessionclan.de>2008-12-13 22:41:06 +0300
committerOctaneSnail <os@v12pwr.com>2008-12-14 12:40:29 +0300
commiteec02175a222f21d09e0f58891835e7ac9b28c71 (patch)
tree87cd446de26b7dce8d0f48574d029f8ccec86f1c /Mediatype.h
parent82e5a3271ae675ddfd4f9153b3e19e8c0f911097 (diff)
Implement automatic media file detection.
Signed-off-by: OctaneSnail <os@v12pwr.com>
Diffstat (limited to 'Mediatype.h')
-rw-r--r--Mediatype.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/Mediatype.h b/Mediatype.h
new file mode 100644
index 0000000..56a369e
--- /dev/null
+++ b/Mediatype.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2008, OV2 <overfiend@sessionclan.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef MEDIATYPE_H
+#define MEDIATYPE_H
+
+#include "list.h"
+
+class CheckByteDetails {
+public:
+ CheckByteDetails():offset(0),byteCount(0),mask(NULL),value(NULL) {}
+ ~CheckByteDetails()
+ {
+ if(mask)
+ delete [] mask;
+ if(value)
+ delete [] value;
+ }
+
+ LONGLONG offset;
+ unsigned int byteCount;
+ BYTE *mask;
+ BYTE *value;
+};
+
+class CheckByteGroup : public Node<CheckByteGroup> {
+public:
+ CheckByteGroup(): checkBytes(NULL),checkByteCount(0) {}
+ ~CheckByteGroup()
+ {
+ if(checkBytes)
+ delete [] checkBytes;
+ }
+
+ CheckByteDetails *checkBytes;
+ unsigned int checkByteCount;
+};
+
+class MediaType: public Node<MediaType> {
+public:
+ MediaType(): majorType(GUID_NULL),subType(GUID_NULL),checkByteGroupCount(0) {}
+ ~MediaType()
+ {
+ checkByteGroups.Clear();
+ }
+
+ GUID majorType;
+ GUID subType;
+ List<CheckByteGroup> checkByteGroups;
+ unsigned int checkByteGroupCount;
+};
+
+int getMediaTypeList(List<MediaType> *mediaTypeList);
+int checkFileForMediaType(File *file,List<MediaType> *mediaTypeList,MediaType **foundMediaType);
+
+#endif \ No newline at end of file