summaryrefslogtreecommitdiffstats
path: root/macosx/NSCodingMacro.h
diff options
context:
space:
mode:
authorritsuka <[email protected]>2014-12-22 07:55:39 +0000
committerritsuka <[email protected]>2014-12-22 07:55:39 +0000
commita052152ebb5b1844ca76ca65b1fed359307e8ad4 (patch)
treedf12b6ae8d8e02c3aa9f835d4f828bea00501607 /macosx/NSCodingMacro.h
parent546f57a1402492f2aedeab1ca6cf9f3d3201795f (diff)
MacGui: implement NSCoding protocol in HBJob.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6638 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/NSCodingMacro.h')
-rw-r--r--macosx/NSCodingMacro.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/macosx/NSCodingMacro.h b/macosx/NSCodingMacro.h
new file mode 100644
index 000000000..7cfbfc755
--- /dev/null
+++ b/macosx/NSCodingMacro.h
@@ -0,0 +1,23 @@
+/* NSCodingMacro.h $
+
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr/>.
+ It may be used under the terms of the GNU General Public License. */
+
+#ifndef HandBrake_NSCodingMacro_h
+#define HandBrake_NSCodingMacro_h
+
+#define OBJC_STRINGIFY(x) @#x
+#define encodeInt(x) [coder encodeInt:x forKey:OBJC_STRINGIFY(x)]
+#define encodeInteger(x) [coder encodeInteger:x forKey:OBJC_STRINGIFY(x)]
+#define encodeBool(x) [coder encodeBool:x forKey:OBJC_STRINGIFY(x)]
+#define encodeDouble(x) [coder encodeDouble:x forKey:OBJC_STRINGIFY(x)]
+#define encodeObject(x) [coder encodeObject:x forKey:OBJC_STRINGIFY(x)]
+
+#define decodeInt(x) x = [decoder decodeIntForKey:OBJC_STRINGIFY(x)]
+#define decodeInteger(x) x = [decoder decodeIntegerForKey:OBJC_STRINGIFY(x)]
+#define decodeBool(x) x = [decoder decodeBoolForKey:OBJC_STRINGIFY(x)]
+#define decodeDouble(x) x = [decoder decodeDoubleForKey:OBJC_STRINGIFY(x)]
+#define decodeObject(x) x = [decoder decodeObjectForKey:OBJC_STRINGIFY(x)]
+
+#endif