renamed HTTP.(hh|cc) to Agent

pull/40/head
Matchman Green 2012-05-10 00:22:27 +08:00
parent b51e5c593f
commit efaa5df229
6 changed files with 16 additions and 6 deletions

View File

@ -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 )
{

View File

@ -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 )

View File

@ -21,13 +21,18 @@
#include <string>
#include "http/HTTP.hh"
#include "http/Agent.hh"
#include "util/DateTime.hh"
#include <iosfwd>
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 ;

View File

@ -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"

View File

@ -22,7 +22,7 @@
#include "JsonResponse.hh"
#include "Json.hh"
#include "http/HTTP.hh"
#include "http/Agent.hh"
// for debugging
#include <iostream>