diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-10-10 16:07:44 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-10-10 16:07:44 +0100 |
| commit | e30c30ef7bbd8413ac0c8390abe574d5dd1cf5f7 (patch) | |
| tree | f67b4a9364264d433535dbc24a19b6df6ac59049 /src/asset.cc | |
| parent | 863ff8cced5b7d1d36ad6761fa1f6e2dbeafcad6 (diff) | |
Adapt to new libcxml ARI. Compiles but does not pass tests.1.0-new-cxml
Diffstat (limited to 'src/asset.cc')
| -rw-r--r-- | src/asset.cc | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/asset.cc b/src/asset.cc index 96196b41..8f4836e9 100644 --- a/src/asset.cc +++ b/src/asset.cc @@ -58,35 +58,35 @@ Asset::Asset (string id) } void -Asset::write_to_pkl (xmlpp::Node* node, Standard standard) const +Asset::write_to_pkl (cxml::NodePtr node, Standard standard) const { assert (!_file.empty ()); - xmlpp::Node* asset = node->add_child ("Asset"); - asset->add_child("Id")->add_child_text ("urn:uuid:" + _id); - asset->add_child("AnnotationText")->add_child_text (_id); - asset->add_child("Hash")->add_child_text (hash ()); - asset->add_child("Size")->add_child_text (raw_convert<string> (boost::filesystem::file_size (_file))); - asset->add_child("Type")->add_child_text (pkl_type (standard)); + cxml::NodePtr asset = node->add_child ("Asset"); + asset->add_child("Id")->set_content ("urn:uuid:" + _id); + asset->add_child("AnnotationText")->set_content (_id); + asset->add_child("Hash")->set_content (hash ()); + asset->add_child("Size")->set_content (raw_convert<string> (boost::filesystem::file_size (_file))); + asset->add_child("Type")->set_content (pkl_type (standard)); } void -Asset::write_to_assetmap (xmlpp::Node* node, boost::filesystem::path root) const +Asset::write_to_assetmap (cxml::NodePtr node, boost::filesystem::path root) const { assert (!_file.empty ()); - xmlpp::Node* asset = node->add_child ("Asset"); - asset->add_child("Id")->add_child_text ("urn:uuid:" + _id); - xmlpp::Node* chunk_list = asset->add_child ("ChunkList"); - xmlpp::Node* chunk = chunk_list->add_child ("Chunk"); + cxml::NodePtr asset = node->add_child ("Asset"); + asset->add_child("Id")->set_content ("urn:uuid:" + _id); + cxml::NodePtr chunk_list = asset->add_child ("ChunkList"); + cxml::NodePtr chunk = chunk_list->add_child ("Chunk"); optional<boost::filesystem::path> path = relative_to_root (root, _file); if (!path) { throw MiscError (String::compose ("Asset %1 is not within the directory %2", _file, root)); } - chunk->add_child("Path")->add_child_text (path.get().string ()); - chunk->add_child("VolumeIndex")->add_child_text ("1"); - chunk->add_child("Offset")->add_child_text ("0"); - chunk->add_child("Length")->add_child_text (raw_convert<string> (boost::filesystem::file_size (_file))); + chunk->add_child("Path")->set_content (path.get().string ()); + chunk->add_child("VolumeIndex")->set_content ("1"); + chunk->add_child("Offset")->set_content ("0"); + chunk->add_child("Length")->set_content (raw_convert<string> (boost::filesystem::file_size (_file))); } string |
