Commit 6193e6f4 by Andrew Dahl

Code Cleanup

parent 026819d4
Showing with 1 additions and 25 deletions
......@@ -93,12 +93,9 @@ int main(int argc, char **)
xmlrpc_c::carriageParm_curl0 myCarriageParm(serverUrl);
xmlrpc_c::clientSimple simpClient;
// xmlrpc_c::value result;
int choice = 0;
//myClient.call(serverUrl, methodName, "s", &result, isbn.c_str());
//cout << bookHandle.valueToBook(result) << endl;
while(true)
{
......
......@@ -13,28 +13,7 @@ BookHandler::BookHandler()
Book BookHandler::paramListToBook(xmlrpc_c::paramList const& paramList)
{
map<string, xmlrpc_c::value> data = paramList.getStruct(0);
paramList.verifyEnd(1);
vector<xmlrpc_c::value> author_values = xmlrpc_c::value_array(data.at(XML_AUTHORS)).vectorValueValue();
vector<string> authors(4, "");
int size = author_values.size();
if(size > 4)
size = 4;
for(size--; size >= 0; size--)
authors[size] = xmlrpc_c::value_string(author_values[size]);
return Book(xmlrpc_c::value_string(data.at(XML_TITLE)), // Title
xmlrpc_c::value_string(data.at(XML_PUBLISHER)), // Publisher
xmlrpc_c::value_string(data.at(XML_ISBN)), // ISBN
xmlrpc_c::value_int(data.at(XML_PUBLICATION_YEAR)), // Publication Year
xmlrpc_c::value_double(data.at(XML_PRICE)), // Book Price
xmlrpc_c::value_int(data.at(XML_STOCK)), // In Stock
authors[0], authors[1], authors[2], authors[3]); // Authors
return(this->valueToBook(paramList[0]));
}
Book BookHandler::valueToBook(xmlrpc_c::value value)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment