summaryrefslogtreecommitdiff
path: root/src/types.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-03-19 19:47:07 +0000
committerCarl Hetherington <cth@carlh.net>2019-03-19 19:47:07 +0000
commit3bae1fb76f8d4751ee62717e3f18cee47d1deb90 (patch)
treea74fbc1f602586a6bfd4e8c156f73caf3b1888ec /src/types.h
parent097f27fcbd28d81b1ff2ae37949b1fcc3a97a716 (diff)
Support RatingList.
Diffstat (limited to 'src/types.h')
-rw-r--r--src/types.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/types.h b/src/types.h
index a0965e83..7f315e08 100644
--- a/src/types.h
+++ b/src/types.h
@@ -38,10 +38,15 @@
#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
{
@@ -292,6 +297,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