grive2/libgrive/src/base/Entry.hh

89 lines
2.1 KiB
C++
Raw Normal View History

/*
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.
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
#include "util/Types.hh"
#include "util/DateTime.hh"
2012-05-19 21:44:46 +04:00
#include "util/FileSystem.hh"
#include <iosfwd>
2012-05-13 21:07:23 +04:00
#include <string>
#include <vector>
namespace gr {
2012-05-10 20:06:05 +04:00
/*! \brief corresponds to an "entry" in the resource feed
This class is decodes an entry in the resource feed. It will stored the properties like
2012-05-20 10:57:25 +04:00
title, filename and ETag etc in member variables. Normally entries are created by
parsing the resource feed
2012-05-10 20:06:05 +04:00
*/
class Entry
{
public :
2012-05-20 10:57:25 +04:00
Entry( ) ;
2012-05-31 19:37:47 +04:00
std::string Title() const ;
std::string Filename() const ;
bool IsDir() const ;
2012-05-20 10:57:25 +04:00
std::string MD5() const ;
DateTime MTime() const ;
u64_t Size() const ;
std::string Name() const ;
2012-05-06 18:27:52 +04:00
std::string ResourceID() const ;
std::string ETag() const ;
2012-05-09 19:52:06 +04:00
std::string SelfHref() const ;
std::string ParentHref() const ;
2012-05-13 21:07:23 +04:00
std::string ContentSrc() const ;
bool IsEditable() const ;
long ChangeStamp() const ;
2012-06-10 17:03:32 +04:00
bool IsChange() const ;
bool IsRemoved() const ;
2012-05-12 08:27:35 +04:00
const std::vector<std::string>& ParentHrefs() const ;
protected :
std::string m_title ;
std::string m_filename ;
bool m_is_dir ;
2012-05-20 10:57:25 +04:00
std::string m_md5 ;
std::string m_etag ;
2012-05-06 18:27:52 +04:00
std::string m_resource_id ;
2012-05-12 07:47:51 +04:00
std::vector<std::string> m_parent_hrefs ;
2012-05-09 19:52:06 +04:00
std::string m_self_href ;
std::string m_content_src ;
bool m_is_editable ;
2012-06-03 19:58:28 +04:00
long m_change_stamp ;
2012-05-20 10:57:25 +04:00
DateTime m_mtime ;
bool m_is_removed ;
u64_t m_size ;
} ;
} // end of namespace gr