More tests.
[libdcp.git] / src / types.h
index a0965e8364790fa6129e1cf4a72588ea6116c18f..8297dbcc393d8026892719905b8886bcf2a471ae 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
 
     This file is part of libdcp.
 
 #ifndef LIBDCP_TYPES_H
 #define LIBDCP_TYPES_H
 
+#include <libcxml/cxml.h>
 #include <boost/shared_ptr.hpp>
 #include <boost/function.hpp>
 #include <string>
 
+namespace xmlpp {
+       class Element;
+}
+
 namespace dcp
 {
 
@@ -99,7 +104,9 @@ enum ContentKind
        TEASER,
        POLICY,
        PUBLIC_SERVICE_ANNOUNCEMENT,
-       ADVERTISEMENT
+       ADVERTISEMENT,
+       EPISODE,
+       PROMO
 };
 
 extern std::string content_kind_to_string (ContentKind kind);
@@ -292,6 +299,27 @@ enum Marker {
 std::string marker_to_string (Marker);
 Marker marker_from_string (std::string);
 
+class Rating
+{
+public:
+       Rating (std::string agency_, std::string label_)
+               : agency (agency_)
+               , label (label_)
+       {}
+
+       explicit Rating (cxml::ConstNodePtr node);
+
+       void as_xml (xmlpp::Element* parent) const;
+
+       /** URI of the agency issuing the rating */
+       std::string agency;
+       /** Rating (e.g. PG, PG-13, 12A etc) */
+       std::string label;
+};
+
+extern bool operator== (Rating const & a, Rating const & b);
+extern std::ostream& operator<< (std::ostream& s, Rating const & r);
+
 }
 
 #endif