A command-line client for interacting with "book" and "member" servers via XMLRPC calls. Servers were created by other students.

booktype.h 1.5KB

    #ifndef __KAVAMA_FINAL_BOOKTYPE__ #define __KAVAMA_FINAL_BOOKTYPE__ #include <string> #include <vector> #include <map> #include <xmlrpc-c/base.hpp> const int BOOKTYPE_MAX_AUTHORS = 4; class BookType { private: std::string _isbn; std::vector<std::string> _authors; std::string _title; std::string _publisher; int _publishYear; float _price; int _stock; public: BookType(); // ToXML :: Converts a BookType into a XMLRPC-C Struct // This is unmarshalling the object ('linearlize' it) const xmlrpc_c::value_struct ToXML(); // FromXML :: Converts a XMLRPC-C Struct into a BookType // This is marshalling the object (de-'linearlize' it) void FromXML(xmlrpc_c::value_struct const& params); // Methods that deal with private data members std::string ISBN(); void ISBN(std::string); // Authors :: Get the author at the particular index // returns: string of authors name std::string Authors(int index); // Authors :: vector of authors (un-mutiable) const std::vector<std::string> Authors(); // AddAuthor :: Add an author to the internal list of authors, if applied // Pre: Internal list must not be 'full'. // Post: Author added if void AddAuthor(std::string author); // ClearAuthors :: Clear the internal author list. bool ClearAuthors(); int AuthorsCount(); std::string Title(); void Title(std::string); std::string Publisher(); void Publisher(std::string); int PublicationYear(); void PublicationYear(int); float Price(); void Price(float); int Stock(); void Stock(int); }; #endif