diff options
Diffstat (limited to 'libtmdb')
-rw-r--r-- | libtmdb/Jamfile.jam | 5 | ||||
-rw-r--r-- | libtmdb/conversions.cpp | 2 | ||||
-rw-r--r-- | libtmdb/conversions.h | 2 | ||||
-rw-r--r-- | libtmdb/testModels.cpp | 14 | ||||
-rw-r--r-- | libtmdb/tmdb-proxy.cpp | 8 | ||||
-rw-r--r-- | libtmdb/tmdb-proxy.h | 8 |
6 files changed, 22 insertions, 17 deletions
diff --git a/libtmdb/Jamfile.jam b/libtmdb/Jamfile.jam index faf02b9..f6c8366 100644 --- a/libtmdb/Jamfile.jam +++ b/libtmdb/Jamfile.jam @@ -2,8 +2,7 @@ import testing ; lib slicer : : : : <include>/usr/include/slicer ; lib slicer-json : : : : <include>/usr/include/slicer ; -lib Ice ; -lib IceUtil ; +lib Ice : : <name>Ice++11 ; lib jsonpp ; lib pthread ; lib boost_system ; @@ -15,7 +14,6 @@ lib adhocutil : : : : <include>/usr/include/adhocutil ; lib tmdb : [ glob *.cpp *.ice : test*.cpp ] : <library>Ice - <library>IceUtil <library>jsonpp <library>pthread <library>slicer @@ -29,7 +27,6 @@ lib tmdb : : : <include>. <library>Ice - <library>IceUtil <library>pthread ; diff --git a/libtmdb/conversions.cpp b/libtmdb/conversions.cpp index 7f291da..1067dd8 100644 --- a/libtmdb/conversions.cpp +++ b/libtmdb/conversions.cpp @@ -6,7 +6,7 @@ namespace Slicer { std::string - dateToString(const IceUtil::Optional<::TMDb::Date> & in) + dateToString(const Ice::optional<::TMDb::Date> & in) { if (!in) { return std::string(); diff --git a/libtmdb/conversions.h b/libtmdb/conversions.h index c64cf92..72aeee2 100644 --- a/libtmdb/conversions.h +++ b/libtmdb/conversions.h @@ -5,7 +5,7 @@ #include <tmdb-common.h> namespace Slicer { - DLL_PUBLIC std::string dateToString(const IceUtil::Optional<::TMDb::Date> &); + DLL_PUBLIC std::string dateToString(const Ice::optional<::TMDb::Date> &); DLL_PUBLIC IceUtil::Optional<::TMDb::Date> stringToDate(const std::string &); } diff --git a/libtmdb/testModels.cpp b/libtmdb/testModels.cpp index 3b1b289..2b61644 100644 --- a/libtmdb/testModels.cpp +++ b/libtmdb/testModels.cpp @@ -8,6 +8,14 @@ namespace std { std::ostream & + operator<<(std::ostream & o, const Ice::optional<TMDb::Date> & d) + { + if (d) { + o << *d; + } + return o; + } + std::ostream & operator<<(std::ostream & o, const TMDb::Date & d) { o << d.Year << '-' << d.Month << '-' << d.Day; @@ -23,13 +31,13 @@ BOOST_AUTO_TEST_CASE( deserialize_searchmulti_json_breakingbad ) BOOST_REQUIRE_EQUAL(3, results->TotalResults); BOOST_REQUIRE_EQUAL("::TMDb::SearchMatchTv", results->Results[0]->ice_id()); - auto tv = TMDb::SearchMatchTvPtr::dynamicCast(results->Results[0]); + auto tv = std::dynamic_pointer_cast<TMDb::SearchMatchTv>(results->Results[0]); BOOST_REQUIRE_EQUAL("Breaking Bad", tv->Name); BOOST_REQUIRE_EQUAL("/1yeVJox3rjo2jBKrrihIMj7uoS9.jpg", tv->PosterPath); BOOST_REQUIRE_EQUAL(1396, tv->Id); BOOST_REQUIRE_EQUAL("::TMDb::SearchMatchMovie", results->Results[1]->ice_id()); - auto movie = TMDb::SearchMatchMoviePtr::dynamicCast(results->Results[1]); + auto movie = std::dynamic_pointer_cast<TMDb::SearchMatchMovie>(results->Results[1]); BOOST_REQUIRE_EQUAL("No Half Measures: Creating the Final Season of Breaking Bad", movie->Title); BOOST_REQUIRE_EQUAL("/8OixSR45U5dbqv8F0tlspmTbXxN.jpg", movie->PosterPath); BOOST_REQUIRE_EQUAL(239459, movie->Id); @@ -43,7 +51,7 @@ BOOST_AUTO_TEST_CASE( deserialize_searchmulti_json_bradpitt ) BOOST_REQUIRE_EQUAL(1, results->TotalResults); BOOST_REQUIRE_EQUAL("::TMDb::SearchMatchPerson", results->Results[0]->ice_id()); - auto person = TMDb::SearchMatchPersonPtr::dynamicCast(results->Results[0]); + auto person = std::dynamic_pointer_cast<TMDb::SearchMatchPerson>(results->Results[0]); BOOST_REQUIRE_EQUAL("Brad Pitt", person->Name); BOOST_REQUIRE_EQUAL(287, person->Id); } diff --git a/libtmdb/tmdb-proxy.cpp b/libtmdb/tmdb-proxy.cpp index b20752c..d3c1e8f 100644 --- a/libtmdb/tmdb-proxy.cpp +++ b/libtmdb/tmdb-proxy.cpp @@ -7,25 +7,25 @@ namespace TMDb { } SearchMultiResultsPtr - Proxy::SearchMulti(const std::string & query, const IceUtil::Optional<int> & page, const Ice::Current&) + Proxy::SearchMulti(const std::string query, const IceUtil::Optional<int> page, const Ice::Current&) { return GetData<SearchMultiResultsPtr>("/search/multi", { { "query", query }, { "page", page } }); } SearchMovieResultsPtr - Proxy::SearchMovies(const std::string & query, const IceUtil::Optional<int> & year, const IceUtil::Optional<int> & page, const Ice::Current&) + Proxy::SearchMovies(const std::string query, const IceUtil::Optional<int> year, const IceUtil::Optional<int> page, const Ice::Current&) { return GetData<SearchMovieResultsPtr>("/search/movies", { { "query", query }, { "page", page }, { "year", year } }); } SearchPersonResultsPtr - Proxy::SearchPersons(const std::string & query, const IceUtil::Optional<int> & page, const Ice::Current&) + Proxy::SearchPersons(const std::string query, const IceUtil::Optional<int> page, const Ice::Current&) { return GetData<SearchPersonResultsPtr>("/search/person", { { "query", query }, { "page", page } }); } SearchTvResultsPtr - Proxy::SearchTv(const std::string & query, const IceUtil::Optional<int> & page, const Ice::Current&) + Proxy::SearchTv(const std::string query, const IceUtil::Optional<int> page, const Ice::Current&) { return GetData<SearchTvResultsPtr>("/search/tv", { { "query", query}, { "page", page } }); } diff --git a/libtmdb/tmdb-proxy.h b/libtmdb/tmdb-proxy.h index 472e522..1fbe9d1 100644 --- a/libtmdb/tmdb-proxy.h +++ b/libtmdb/tmdb-proxy.h @@ -7,10 +7,10 @@ namespace TMDb { public: Proxy(const std::string & baseUrl, const std::string & apikey); - SearchMultiResultsPtr SearchMulti(const std::string&, const IceUtil::Optional<int>&, const Ice::Current&) override; - SearchMovieResultsPtr SearchMovies(const std::string&, const IceUtil::Optional<int>&, const IceUtil::Optional<int>&, const Ice::Current&) override; - SearchPersonResultsPtr SearchPersons(const std::string&, const IceUtil::Optional<int>&, const Ice::Current&) override; - SearchTvResultsPtr SearchTv(const std::string&, const IceUtil::Optional<int>&, const Ice::Current&) override; + SearchMultiResultsPtr SearchMulti(const std::string, const IceUtil::Optional<int>, const Ice::Current&) override; + SearchMovieResultsPtr SearchMovies(const std::string, const IceUtil::Optional<int>, const IceUtil::Optional<int>, const Ice::Current&) override; + SearchPersonResultsPtr SearchPersons(const std::string, const IceUtil::Optional<int>, const Ice::Current&) override; + SearchTvResultsPtr SearchTv(const std::string, const IceUtil::Optional<int>, const Ice::Current&) override; MoviePtr GetMovie(Ice::Int, const Ice::Current&) override; TvSeriesPtr GetTvSeries(Ice::Int, const Ice::Current&) override; }; |