Made API config private member

This commit is contained in:
Sude 2013-05-04 19:46:42 +03:00
parent bc787e5f6c
commit 7a9dd503a1
2 changed files with 4 additions and 2 deletions

View File

@ -70,7 +70,6 @@ size_t writeMemoryCallback(char *ptr, size_t size, size_t nmemb, void *userp);
class API class API
{ {
public: public:
apiConfig config;
userDetails user; userDetails user;
API(const std::string& token,const std::string& secret, const bool& verbose = false, const bool& bVerifyPeer = true); API(const std::string& token,const std::string& secret, const bool& verbose = false, const bool& bVerifyPeer = true);
@ -88,9 +87,12 @@ class API
void clearError(); void clearError();
bool getError() { return this->error; }; bool getError() { return this->error; };
std::string getErrorMessage() { return this->error_message; }; std::string getErrorMessage() { return this->error_message; };
std::string getToken() { return this->config.oauth_token; };
std::string getSecret() { return this->config.oauth_secret; };
virtual ~API(); virtual ~API();
protected: protected:
private: private:
apiConfig config;
CURL* curlhandle; CURL* curlhandle;
void setError(const std::string& err); void setError(const std::string& err);
bool error; bool error;

View File

@ -120,7 +120,7 @@ int Downloader::login()
std::ofstream ofs(config.sConfigFilePath.c_str()); std::ofstream ofs(config.sConfigFilePath.c_str());
if (ofs) if (ofs)
{ {
ofs << "token = " << gogAPI->config.oauth_token << std::endl << "secret = " << gogAPI->config.oauth_secret << std::endl; ofs << "token = " << gogAPI->getToken() << std::endl << "secret = " << gogAPI->getSecret() << std::endl;
ofs.close(); ofs.close();
return 0; return 0;
} }