diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-08-28 00:05:54 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-09-21 21:57:18 +0200 |
| commit | 140d631d7df68d47c36bd15558e9b58ef4038e27 (patch) | |
| tree | 2fcc5571493dec4f983a91a9c8fb47c10fd5555b | |
| parent | 0a8f009ceb86417704b2e2d2bb377c850d9e042e (diff) | |
Use vector for the Ratings list.
| -rw-r--r-- | src/cpl.h | 6 | ||||
| -rw-r--r-- | test/cpl_ratings_test.cc | 5 |
2 files changed, 6 insertions, 5 deletions
@@ -152,11 +152,11 @@ public: void set_content_versions (std::vector<ContentVersion> v); - std::list<Rating> ratings () const { + std::vector<Rating> ratings () const { return _ratings; } - void set_ratings (std::list<Rating> r) { + void set_ratings (std::vector<Rating> r) { _ratings = r; } @@ -177,8 +177,8 @@ private: std::string _annotation_text; std::string _content_title_text; ///< <ContentTitleText> ContentKind _content_kind; ///< <ContentKind> - std::list<Rating> _ratings; std::vector<ContentVersion> _content_versions; + std::vector<Rating> _ratings; std::list<boost::shared_ptr<Reel> > _reels; diff --git a/test/cpl_ratings_test.cc b/test/cpl_ratings_test.cc index 161dab0d..ae846998 100644 --- a/test/cpl_ratings_test.cc +++ b/test/cpl_ratings_test.cc @@ -37,12 +37,13 @@ using std::list; using std::string; +using std::vector; BOOST_AUTO_TEST_CASE (cpl_ratings) { dcp::CPL cpl ("annotation", dcp::FEATURE); - list<dcp::Rating> ratings; + vector<dcp::Rating> ratings; ratings.push_back (dcp::Rating("http://www.mpaa.org/2003-ratings", "PG-13")); ratings.push_back (dcp::Rating("http://www.movielabs.com/md/ratings/GB/BBFC/1/12A%3C/Agency", "12A")); cpl.set_ratings (ratings); @@ -86,6 +87,6 @@ BOOST_AUTO_TEST_CASE (cpl_ratings) ); dcp::CPL cpl2 ("build/test/cpl_ratings.xml"); - list<dcp::Rating> ratings2 = cpl2.ratings (); + vector<dcp::Rating> ratings2 = cpl2.ratings (); BOOST_TEST(ratings == ratings2); } |
