From 1f284533185a798c0ed36669bd6c9729adf6ec5a Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 19 Jan 2021 00:32:53 +0100 Subject: Rename encrypted() to any_encrypted() and add all_encrypted(). --- src/cpl.cc | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/cpl.cc') diff --git a/src/cpl.cc b/src/cpl.cc index 76f6002b..a976e072 100644 --- a/src/cpl.cc +++ b/src/cpl.cc @@ -584,10 +584,10 @@ CPL::equals (shared_ptr other, EqualityOptions opt, NoteHandler not /** @return true if we have any encrypted content */ bool -CPL::encrypted () const +CPL::any_encrypted () const { for (auto i: _reels) { - if (i->encrypted ()) { + if (i->any_encrypted()) { return true; } } @@ -595,6 +595,21 @@ CPL::encrypted () const return false; } + +/** @return true if we have all our encryptable content is encrypted */ +bool +CPL::all_encrypted () const +{ + for (auto i: _reels) { + if (!i->all_encrypted()) { + return false; + } + } + + return true; +} + + /** Add a KDM to this CPL. If the KDM is for any of this CPLs assets it will be used * to decrypt those assets. * @param kdm KDM. -- cgit v1.2.3