X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fpsd%2Fdescriptor.cpp;h=a91f36c6be93db89739c65531ccd59887b141264;hb=3b7401b41df8379e16e0ec1074121214fd27910e;hp=c678a22764cfd582174804a90bf0ec48223fa17d;hpb=44f608adff3740ae911192caa484ee06883913eb;p=casparcg diff --git a/modules/psd/descriptor.cpp b/modules/psd/descriptor.cpp index c678a2276..a91f36c6b 100644 --- a/modules/psd/descriptor.cpp +++ b/modules/psd/descriptor.cpp @@ -22,12 +22,24 @@ #include "descriptor.h" #include "misc.h" +#include + #include +#include #include namespace caspar { namespace psd { + std::wstring debug_ptree(const boost::property_tree::wptree& tree) + { + std::wstringstream str; + boost::property_tree::xml_writer_settings w(' ', 3); + boost::property_tree::write_xml(str, tree, w); + str.flush(); + return str.str(); + } + class descriptor::context::scoped_holder { descriptor::context::ptr_type ctx_; @@ -44,7 +56,7 @@ namespace caspar { namespace psd { } }; - descriptor::descriptor() : context_(std::make_shared()) + descriptor::descriptor(const std::wstring& debug_name) : context_(std::make_shared(debug_name)) { context_->stack.push_back(&context_->root); } @@ -69,6 +81,9 @@ void descriptor::populate(bigendian_file_input_stream& stream) std::wstring key = stream.read_id_string(); read_value(key, stream); } + + if (context_->stack.size() == 1) + CASPAR_LOG(trace) << context_->debug_name << L":\n\n" << debug_ptree(context_->root) << L"\n"; } void descriptor::read_value(const std::wstring& key, bigendian_file_input_stream& stream)