diff options
Diffstat (limited to 'src/pkl_file.cc')
| -rw-r--r-- | src/pkl_file.cc | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/pkl_file.cc b/src/pkl_file.cc index 6dfb627c..9119d883 100644 --- a/src/pkl_file.cc +++ b/src/pkl_file.cc @@ -29,23 +29,23 @@ using namespace boost; using namespace libdcp; PKLFile::PKLFile (string file) - : XMLFile (file, "PackingList") { - id = string_child ("Id"); - annotation_text = optional_string_child ("AnnotationText"); - issue_date = string_child ("IssueDate"); - issuer = string_child ("Issuer"); - creator = string_child ("Creator"); - assets = type_grand_children<PKLAsset> ("AssetList", "Asset"); + cxml::File f (file, "PackingList"); + + id = f.string_child ("Id"); + annotation_text = f.optional_string_child ("AnnotationText").get_value_or (""); + issue_date = f.string_child ("IssueDate"); + issuer = f.string_child ("Issuer"); + creator = f.string_child ("Creator"); + assets = type_grand_children<PKLAsset> (f, "AssetList", "Asset"); } -PKLAsset::PKLAsset (xmlpp::Node const * node) - : XMLNode (node) +PKLAsset::PKLAsset (boost::shared_ptr<const cxml::Node> node) { - id = string_child ("Id"); - annotation_text = optional_string_child ("AnnotationText"); - hash = string_child ("Hash"); - size = int64_child ("Size"); - type = string_child ("Type"); - original_file_name = optional_string_child ("OriginalFileName"); + id = node->string_child ("Id"); + annotation_text = node->optional_string_child ("AnnotationText").get_value_or (""); + hash = node->string_child ("Hash"); + size = node->number_child<int64_t> ("Size"); + type = node->string_child ("Type"); + original_file_name = node->optional_string_child ("OriginalFileName").get_value_or (""); } |
