Description
Hello, I'm new to C++.
I'm using Baylor's GNU licensed socket example to pull from omdbapi.com a JSON object with information about movies. This is for a non-academic class and it's a side project just to keep me busy while the class goes over the basics.
I have a std::string JSON and it has the value of:
{"Title":"Star Trek Beyond","Year":"2016","Rated":"PG-13","Released":"22 Jul 2016","Runtime":"122 min","Genre":"Action, Adventure, Sci-Fi","Director":"Justin Lin","Writer":"Simon Pegg, Doug Jung, Gene Roddenberry (based upon "Star Trek" created by)","Actors":"Chris Pine, Zachary Quinto, Karl Urban, Zoe Saldana","Plot":"The USS Enterprise crew explores the furthest reaches of uncharted space, where they encounter a new ruthless enemy who puts them and everything the Federation stands for to the test.","Language":"English","Country":"USA, Hong Kong, China","Awards":"Nominated for 1 Oscar. Another 1 win & 17 nominations.","Poster":"https://images-na.ssl-images-amazon.com/images/M/MV5BODgzN2E1YjctODg5Yi00YzYwLWJjZjAtNDg2MGE2Y2MyYjBmXkEyXkFqcGdeQXVyNjM1MTQ0NTQ@._V1_SX300.jpg","Metascore":"68","imdbRating":"7.1","imdbVotes":"154,036","imdbID":"tt2660888","Type":"movie","Response":"True"}
This is my code:
string amazonData = getAmazonData("Star Trek Beyond");
string JSON = isolateJSON(&amazonData);
try {
movieObject = json::parse(JSON);
}
catch (exception& e) {
printf("%s\n", e.what());
}
VS has highlighted the json::parse and said "parse no instance of overloaded function". It appears to accept std::string so I'm not sure what the issue is.
Any help is appreciated.