grive2/libgrive/src/drive/Drive.hh

64 lines
1.3 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"
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 ;
}
2012-04-25 20:13:17 +04:00
class OAuth2 ;
2012-05-31 19:37:47 +04:00
class Json ;
2012-04-25 20:13:17 +04:00
class Drive
{
public :
2012-05-31 19:37:47 +04:00
Drive( OAuth2& auth, const Json& options ) ;
2012-04-25 20:13:17 +04:00
2012-05-13 21:07:23 +04:00
void Update() ;
void Sync() ;
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( http::Agent *http ) ;
void file();
2012-04-25 20:13:17 +04:00
private :
OAuth2& m_auth ;
http::Header m_http_hdr ;
std::string m_resume_link ;
State m_state ;
2012-04-25 20:13:17 +04:00
} ;
} // end of namespace