grive2/libgrive/src/drive/Drive.hh

70 lines
1.5 KiB
C++
Raw Normal View History

2012-04-25 20:13:17 +04:00
/*
grive: an GPL program to sync a local directory with Google Drive
Copyright (C) 2012 Wan Wai Ho
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation version 2
of the License.
2012-04-25 20:13:17 +04:00
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#pragma once
2012-05-16 20:52:17 +04:00
#include "State.hh"
#include "http/Header.hh"
#include "json/Val.hh"
2012-05-13 11:27:58 +04:00
#include "util/Exception.hh"
2012-04-25 20:13:17 +04:00
#include <string>
#include <vector>
namespace gr {
namespace http
{
class Agent ;
}
namespace v1 {
class Entry ;
2012-04-25 20:13:17 +04:00
class Drive
{
public :
Drive( http::Agent *agent, const Val& options ) ;
2012-04-25 20:13:17 +04:00
void DetectChanges() ;
2012-05-13 21:07:23 +04:00
void Update() ;
2012-06-17 12:33:38 +04:00
void DryRun() ;
void SaveState() ;
2012-05-13 11:27:58 +04:00
struct Error : virtual Exception {} ;
2012-04-25 20:13:17 +04:00
private :
void SyncFolders( ) ;
void file();
void FromRemote( const Entry& entry ) ;
void FromChange( const Entry& entry ) ;
void UpdateChangeStamp( ) ;
2012-04-25 20:13:17 +04:00
private :
http::Agent *m_http ;
std::string m_resume_link ;
fs::path m_root ;
State m_state ;
Val m_options ;
2012-04-25 20:13:17 +04:00
} ;
} } // end of namespace