diff --git a/libgrive/CMakeLists.txt b/libgrive/CMakeLists.txt index 9231d34..43cb74f 100644 --- a/libgrive/CMakeLists.txt +++ b/libgrive/CMakeLists.txt @@ -34,6 +34,7 @@ file (GLOB XML_HEADERS file (GLOB LIBGRIVE_SRC src/drive/*.cc + src/http/*.cc src/protocol/*.cc src/util/*.cc src/xml/*.cc diff --git a/libgrive/src/drive/Drive.cc b/libgrive/src/drive/Drive.cc index 6604fb9..515fe75 100644 --- a/libgrive/src/drive/Drive.cc +++ b/libgrive/src/drive/Drive.cc @@ -21,7 +21,7 @@ #include "File.hh" -#include "protocol/HTTP.hh" +#include "http/HTTP.hh" #include "protocol/Json.hh" #include "protocol/JsonResponse.hh" #include "protocol/OAuth2.hh" diff --git a/libgrive/src/drive/File.cc b/libgrive/src/drive/File.cc index de3640a..5403ba0 100644 --- a/libgrive/src/drive/File.cc +++ b/libgrive/src/drive/File.cc @@ -19,10 +19,10 @@ #include "File.hh" -#include "protocol/Download.hh" +#include "http/Download.hh" +#include "http/StringResponse.hh" #include "protocol/Json.hh" #include "protocol/OAuth2.hh" -#include "protocol/StringResponse.hh" #include "util/OS.hh" #include "util/Path.hh" diff --git a/libgrive/src/drive/File.hh b/libgrive/src/drive/File.hh index 2346a29..6537ff6 100644 --- a/libgrive/src/drive/File.hh +++ b/libgrive/src/drive/File.hh @@ -21,7 +21,7 @@ #include -#include "protocol/HTTP.hh" +#include "http/HTTP.hh" #include "util/DateTime.hh" #include diff --git a/libgrive/src/protocol/Download.cc b/libgrive/src/http/Download.cc similarity index 100% rename from libgrive/src/protocol/Download.cc rename to libgrive/src/http/Download.cc diff --git a/libgrive/src/protocol/Download.hh b/libgrive/src/http/Download.hh similarity index 100% rename from libgrive/src/protocol/Download.hh rename to libgrive/src/http/Download.hh diff --git a/libgrive/src/protocol/Exception.cc b/libgrive/src/http/Exception.cc similarity index 100% rename from libgrive/src/protocol/Exception.cc rename to libgrive/src/http/Exception.cc diff --git a/libgrive/src/protocol/Exception.hh b/libgrive/src/http/Exception.hh similarity index 100% rename from libgrive/src/protocol/Exception.hh rename to libgrive/src/http/Exception.hh diff --git a/libgrive/src/protocol/HTTP.cc b/libgrive/src/http/HTTP.cc similarity index 100% rename from libgrive/src/protocol/HTTP.cc rename to libgrive/src/http/HTTP.cc diff --git a/libgrive/src/protocol/HTTP.hh b/libgrive/src/http/HTTP.hh similarity index 100% rename from libgrive/src/protocol/HTTP.hh rename to libgrive/src/http/HTTP.hh diff --git a/libgrive/src/protocol/Receivable.hh b/libgrive/src/http/Receivable.hh similarity index 100% rename from libgrive/src/protocol/Receivable.hh rename to libgrive/src/http/Receivable.hh diff --git a/libgrive/src/protocol/StringResponse.cc b/libgrive/src/http/StringResponse.cc similarity index 100% rename from libgrive/src/protocol/StringResponse.cc rename to libgrive/src/http/StringResponse.cc diff --git a/libgrive/src/protocol/StringResponse.hh b/libgrive/src/http/StringResponse.hh similarity index 100% rename from libgrive/src/protocol/StringResponse.hh rename to libgrive/src/http/StringResponse.hh diff --git a/libgrive/src/protocol/JsonResponse.cc b/libgrive/src/protocol/JsonResponse.cc index fd5c904..fc66d66 100644 --- a/libgrive/src/protocol/JsonResponse.cc +++ b/libgrive/src/protocol/JsonResponse.cc @@ -19,7 +19,7 @@ #include "JsonResponse.hh" -#include "Json.hh" +#include "protocol/Json.hh" namespace gr { namespace http { diff --git a/libgrive/src/protocol/JsonResponse.hh b/libgrive/src/protocol/JsonResponse.hh index fc9dc17..8856872 100644 --- a/libgrive/src/protocol/JsonResponse.hh +++ b/libgrive/src/protocol/JsonResponse.hh @@ -19,8 +19,8 @@ #pragma once -#include "Receivable.hh" -#include "StringResponse.hh" +#include "http/Receivable.hh" +#include "http/StringResponse.hh" namespace gr { diff --git a/libgrive/src/protocol/OAuth2.cc b/libgrive/src/protocol/OAuth2.cc index 2ad29ba..439683b 100644 --- a/libgrive/src/protocol/OAuth2.cc +++ b/libgrive/src/protocol/OAuth2.cc @@ -19,9 +19,10 @@ #include "OAuth2.hh" -#include "protocol/HTTP.hh" -#include "protocol/Json.hh" -#include "protocol/JsonResponse.hh" +#include "JsonResponse.hh" +#include "Json.hh" + +#include "http/HTTP.hh" // for debugging #include @@ -99,10 +100,8 @@ void OAuth2::Refresh( ) http::Agent http ; http.Post( token_url, post, &resp ) ; -std::cout << "here" << std::endl ; - Json jresp = resp.Response() ; - m_access = jresp["access_token"].As() ; + m_access = resp.Response()["access_token"].As() ; } std::string OAuth2::RefreshToken( ) const