diff --git a/libgrive/src/drive/Drive.cc b/libgrive/src/drive/Drive.cc index 5bf2cb3..0e176c2 100644 --- a/libgrive/src/drive/Drive.cc +++ b/libgrive/src/drive/Drive.cc @@ -22,7 +22,7 @@ #include "CommonUri.hh" #include "Entry.hh" -#include "http/HTTP.hh" +#include "http/Agent.hh" #include "http/XmlResponse.hh" #include "protocol/Json.hh" #include "protocol/JsonResponse.hh" @@ -188,12 +188,12 @@ void Drive::UpdateFile( const Json& entry ) if ( pit != m_coll.end() ) path = pit->Dir() / file.Filename() ; } - + // compare checksum first if file exists std::ifstream ifile( path.Str().c_str(), std::ios::binary | std::ios::in ) ; if ( ifile && file.ServerMD5() == crypt::MD5(ifile.rdbuf()) ) changed = false ; - + // if the checksum is different, file is changed and we need to update if ( changed ) { diff --git a/libgrive/src/drive/Entry.cc b/libgrive/src/drive/Entry.cc index f52df34..2b12cf4 100644 --- a/libgrive/src/drive/Entry.cc +++ b/libgrive/src/drive/Entry.cc @@ -46,6 +46,10 @@ Entry::Entry( const Json& entry ) Update( entry ) ; } +Entry::Entry( const xml::Node& n ) +{ +} + Entry::Entry( const std::string& title, const std::string& href ) : m_title( title ), m_self_href( href ) diff --git a/libgrive/src/drive/Entry.hh b/libgrive/src/drive/Entry.hh index c199241..2cba2c8 100644 --- a/libgrive/src/drive/Entry.hh +++ b/libgrive/src/drive/Entry.hh @@ -21,13 +21,18 @@ #include -#include "http/HTTP.hh" +#include "http/Agent.hh" #include "util/DateTime.hh" #include namespace gr { +namespace xml +{ + class Node ; +} + class Json ; class OAuth2 ; class Path ; @@ -37,6 +42,7 @@ class Entry public : explicit Entry( const Path& file ) ; explicit Entry( const Json& entry ) ; + explicit Entry( const xml::Node& n ) ; Entry( const std::string& title, const std::string& href ) ; std::string Title() const ; diff --git a/libgrive/src/http/HTTP.cc b/libgrive/src/http/Agent.cc similarity index 99% rename from libgrive/src/http/HTTP.cc rename to libgrive/src/http/Agent.cc index 89f4787..0d352bb 100644 --- a/libgrive/src/http/HTTP.cc +++ b/libgrive/src/http/Agent.cc @@ -17,7 +17,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "HTTP.hh" +#include "Agent.hh" #include "Download.hh" #include "Exception.hh" diff --git a/libgrive/src/http/HTTP.hh b/libgrive/src/http/Agent.hh similarity index 100% rename from libgrive/src/http/HTTP.hh rename to libgrive/src/http/Agent.hh diff --git a/libgrive/src/protocol/OAuth2.cc b/libgrive/src/protocol/OAuth2.cc index 439683b..fa6cd4a 100644 --- a/libgrive/src/protocol/OAuth2.cc +++ b/libgrive/src/protocol/OAuth2.cc @@ -22,7 +22,7 @@ #include "JsonResponse.hh" #include "Json.hh" -#include "http/HTTP.hh" +#include "http/Agent.hh" // for debugging #include