diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-12-18 16:43:02 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-12-18 16:43:02 +0100 |
| commit | d36d580b7e38cfc2f3189c178ca6553aea921b28 (patch) | |
| tree | 280b24d3da429ddc973d80b8a43ca06d644d2af7 | |
| parent | 16cf80a019cc9df15580e0fb21b5d340a58c0b94 (diff) | |
White space: dkdm_wrapper.{cc,h}
| -rw-r--r-- | src/lib/dkdm_wrapper.cc | 30 | ||||
| -rw-r--r-- | src/lib/dkdm_wrapper.h | 36 |
2 files changed, 33 insertions, 33 deletions
diff --git a/src/lib/dkdm_wrapper.cc b/src/lib/dkdm_wrapper.cc index c735c3b95..33d5fd6be 100644 --- a/src/lib/dkdm_wrapper.cc +++ b/src/lib/dkdm_wrapper.cc @@ -36,7 +36,7 @@ using std::vector; shared_ptr<DKDMBase> -DKDMBase::read (cxml::ConstNodePtr node) +DKDMBase::read(cxml::ConstNodePtr node) { if (node->name() == "DKDM") { return make_shared<DKDM>(dcp::EncryptedKDM(node->content())); @@ -48,7 +48,7 @@ DKDMBase::read (cxml::ConstNodePtr node) auto group = make_shared<DKDMGroup>(*name); for (auto i: node->node_children()) { if (auto c = read(i)) { - group->add (c); + group->add(c); } } return group; @@ -59,7 +59,7 @@ DKDMBase::read (cxml::ConstNodePtr node) string -DKDM::name () const +DKDM::name() const { return fmt::format("{} ({})", _dkdm.content_title_text(), _dkdm.cpl_id()); } @@ -78,40 +78,40 @@ DKDMGroup::as_xml(xmlpp::Element* element) const auto f = cxml::add_child(element, "DKDMGroup"); f->set_attribute("name", _name); for (auto i: _children) { - i->as_xml (f); + i->as_xml(f); } } void -DKDMGroup::add (shared_ptr<DKDMBase> child, shared_ptr<DKDM> previous) +DKDMGroup::add(shared_ptr<DKDMBase> child, shared_ptr<DKDM> previous) { - DCPOMATIC_ASSERT (child); + DCPOMATIC_ASSERT(child); if (previous) { - auto i = find (_children.begin(), _children.end(), previous); + auto i = find(_children.begin(), _children.end(), previous); if (i != _children.end()) { ++i; } - _children.insert (i, child); + _children.insert(i, child); } else { - _children.push_back (child); + _children.push_back(child); } - child->set_parent (dynamic_pointer_cast<DKDMGroup>(shared_from_this())); + child->set_parent(dynamic_pointer_cast<DKDMGroup>(shared_from_this())); } void -DKDMGroup::remove (shared_ptr<DKDMBase> child) +DKDMGroup::remove(shared_ptr<DKDMBase> child) { for (auto i = _children.begin(); i != _children.end(); ++i) { if (*i == child) { - _children.erase (i); - child->set_parent (shared_ptr<DKDMGroup>()); + _children.erase(i); + child->set_parent(shared_ptr<DKDMGroup>()); return; } - auto g = dynamic_pointer_cast<DKDMGroup> (*i); + auto g = dynamic_pointer_cast<DKDMGroup>(*i); if (g) { - g->remove (child); + g->remove(child); } } } diff --git a/src/lib/dkdm_wrapper.h b/src/lib/dkdm_wrapper.h index 0bbd46407..297ac438f 100644 --- a/src/lib/dkdm_wrapper.h +++ b/src/lib/dkdm_wrapper.h @@ -35,20 +35,20 @@ class DKDMGroup; class DKDMBase : public std::enable_shared_from_this<DKDMBase> { public: - virtual ~DKDMBase () {} - virtual std::string name () const = 0; - virtual void as_xml (xmlpp::Element *) const = 0; + virtual ~DKDMBase() {} + virtual std::string name() const = 0; + virtual void as_xml(xmlpp::Element *) const = 0; /** @return true if this thing is, or contains, any actual DKDM */ virtual bool contains_dkdm() const = 0; virtual std::vector<dcp::EncryptedKDM> all_dkdms() const = 0; - static std::shared_ptr<DKDMBase> read (cxml::ConstNodePtr node); + static std::shared_ptr<DKDMBase> read(cxml::ConstNodePtr node); - std::shared_ptr<DKDMGroup> parent () const { + std::shared_ptr<DKDMGroup> parent() const { return _parent; } - void set_parent (std::shared_ptr<DKDMGroup> parent) { + void set_parent(std::shared_ptr<DKDMGroup> parent) { _parent = parent; } @@ -60,12 +60,12 @@ private: class DKDM : public DKDMBase { public: - explicit DKDM (dcp::EncryptedKDM k) - : _dkdm (k) + explicit DKDM(dcp::EncryptedKDM k) + : _dkdm(k) {} - std::string name () const override; - void as_xml (xmlpp::Element *) const override; + std::string name() const override; + void as_xml(xmlpp::Element *) const override; bool contains_dkdm() const override { return true; } @@ -73,7 +73,7 @@ public: return { _dkdm }; } - dcp::EncryptedKDM dkdm () const { + dcp::EncryptedKDM dkdm() const { return _dkdm; } @@ -85,26 +85,26 @@ private: class DKDMGroup : public DKDMBase { public: - explicit DKDMGroup (std::string name) - : _name (name) + explicit DKDMGroup(std::string name) + : _name(name) {} - std::string name () const override { + std::string name() const override { return _name; } - void as_xml (xmlpp::Element *) const override; + void as_xml(xmlpp::Element *) const override; bool contains_dkdm() const override; std::vector<dcp::EncryptedKDM> all_dkdms() const override; - std::list<std::shared_ptr<DKDMBase>> children () const { + std::list<std::shared_ptr<DKDMBase>> children() const { return _children; } - void add (std::shared_ptr<DKDMBase> child, std::shared_ptr<DKDM> previous = std::shared_ptr<DKDM>()); - void remove (std::shared_ptr<DKDMBase> child); + void add(std::shared_ptr<DKDMBase> child, std::shared_ptr<DKDM> previous = std::shared_ptr<DKDM>()); + void remove(std::shared_ptr<DKDMBase> child); bool contains(std::string dkdm_id) const; |
