summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-01-17 21:30:34 +0000
committerCarl Hetherington <cth@carlh.net>2013-01-17 21:30:34 +0000
commitc289685296d58228df0a88354e966105b242c915 (patch)
tree7a6d0ae7f447038cf6a43c9dbf10eca08b59fd6b /src
parentc2cf8eb8d22265988bbf81e0331a98a7aa6786ed (diff)
Add Size operators; install util.h
Diffstat (limited to 'src')
-rw-r--r--src/util.cc11
-rw-r--r--src/util.h3
-rw-r--r--src/wscript1
3 files changed, 15 insertions, 0 deletions
diff --git a/src/util.cc b/src/util.cc
index 4ddb466c..1cbec719 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -277,3 +277,14 @@ libdcp::empty_or_white_space (string s)
return true;
}
+
+bool libdcp::operator== (libdcp::Size const & a, libdcp::Size const & b)
+{
+ return (a.width == b.width && a.height == b.height);
+}
+
+bool libdcp::operator!= (libdcp::Size const & a, libdcp::Size const & b)
+{
+ return !(a == b);
+}
+
diff --git a/src/util.h b/src/util.h
index dd153cb3..f5685970 100644
--- a/src/util.h
+++ b/src/util.h
@@ -49,6 +49,9 @@ struct Size {
int height;
};
+extern bool operator== (Size const & a, Size const & b);
+extern bool operator!= (Size const & a, Size const & b);
+
extern std::string make_uuid ();
extern std::string make_digest (std::string filename);
extern std::string content_kind_to_string (ContentKind kind);
diff --git a/src/wscript b/src/wscript
index 04656976..d243ae46 100644
--- a/src/wscript
+++ b/src/wscript
@@ -49,6 +49,7 @@ def build(bld):
subtitle_asset.h
test_mode.h
types.h
+ util.h
version.h
xml.h
"""