diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-01-01 23:17:07 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-01-01 23:17:07 +0000 |
| commit | aef58f7a1caf6a67c2c0b12ba3a6bc632d890f4e (patch) | |
| tree | de09dea793415454c0e656b5cfd27a027abc8f57 /src/subtitle_asset.cc | |
| parent | 039ea029c811b7f74f02befad10d2106ad645e74 (diff) | |
Use libxml++ to write CPLs.
Diffstat (limited to 'src/subtitle_asset.cc')
| -rw-r--r-- | src/subtitle_asset.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc index c7051eae..998abc07 100644 --- a/src/subtitle_asset.cc +++ b/src/subtitle_asset.cc @@ -20,6 +20,7 @@ #include <fstream> #include <boost/lexical_cast.hpp> #include <boost/algorithm/string.hpp> +#include <libxml++/nodes/element.h> #include "subtitle_asset.h" #include "util.h" @@ -375,15 +376,14 @@ SubtitleAsset::add (shared_ptr<Subtitle> s) } void -SubtitleAsset::write_to_cpl (ostream& s) const +SubtitleAsset::write_to_cpl (xmlpp::Element* parent) const { /* XXX: should EditRate, Duration and IntrinsicDuration be in here? */ - - s << " <MainSubtitle>\n" - << " <Id>urn:uuid:" << _uuid << "</Id>\n" - << " <AnnotationText>" << _file_name << "</AnnotationText>\n" - << " <EntryPoint>0</EntryPoint>\n" - << " </MainSubtitle>\n"; + + xmlpp::Element* main_subtitle = parent->add_child("MainSubtitle"); + main_subtitle->add_child("Id")->add_child_text("urn:uuid:" + _uuid); + main_subtitle->add_child("AnnotationText")->add_child_text(_file_name); + main_subtitle->add_child("EntryPoint")->add_child_text("0"); } struct SubtitleSorter { |
