Add ContentVersion class.
[libdcp.git] / src / types.cc
index 29e2c387ff05d028c02bce6724b87ff49d85bee7..746b6f6a81e234385225cbec68891448dc478132 100644 (file)
@@ -208,7 +208,7 @@ dcp::string_to_effect (string s)
                return SHADOW;
        }
 
-       boost::throw_exception (DCPReadError ("unknown subtitle effect type"));
+       boost::throw_exception (ReadError ("unknown subtitle effect type"));
 }
 
 string
@@ -237,7 +237,7 @@ dcp::string_to_halign (string s)
                return HALIGN_RIGHT;
        }
 
-       boost::throw_exception (DCPReadError ("unknown subtitle halign type"));
+       boost::throw_exception (ReadError ("unknown subtitle halign type"));
 }
 
 string
@@ -266,7 +266,7 @@ dcp::string_to_valign (string s)
                return VALIGN_BOTTOM;
        }
 
-       boost::throw_exception (DCPReadError ("unknown subtitle valign type"));
+       boost::throw_exception (ReadError ("unknown subtitle valign type"));
 }
 
 string
@@ -299,7 +299,7 @@ dcp::string_to_direction (string s)
                return DIRECTION_BTT;
        }
 
-       boost::throw_exception (DCPReadError ("unknown subtitle direction type"));
+       boost::throw_exception (ReadError ("unknown subtitle direction type"));
 }
 
 /** Convert a content kind to a string which can be used in a
@@ -462,3 +462,13 @@ dcp::operator<< (ostream& s, Rating const & r)
        s << r.agency << " " << r.label;
        return s;
 }
+
+
+void
+ContentVersion::as_xml (xmlpp::Element* parent) const
+{
+       xmlpp::Node* cv = parent->add_child("ContentVersion");
+       cv->add_child("Id")->add_child_text(id);
+       cv->add_child("LabelText")->add_child_text(label_text);
+}
+