1 /*
2 	grive: an GPL program to sync a local directory with Google Drive
3 	Copyright (C) 2012  Wan Wai Ho
4 
5 	This program is free software; you can redistribute it and/or
6 	modify it under the terms of the GNU General Public License
7 	as published by the Free Software Foundation version 2
8 	of the License.
9 
10 	This program is distributed in the hope that it will be useful,
11 	but WITHOUT ANY WARRANTY; without even the implied warranty of
12 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 	GNU General Public License for more details.
14 
15 	You should have received a copy of the GNU General Public License
16 	along with this program; if not, write to the Free Software
17 	Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18 */
19 
20 #pragma once
21 
22 #include "util/Types.hh"
23 #include "util/DateTime.hh"
24 #include "util/FileSystem.hh"
25 
26 #include <iosfwd>
27 #include <string>
28 #include <vector>
29 
30 namespace gr {
31 
32 /*!	\brief	corresponds to an "entry" in the resource feed
33 
34 	This class is decodes an entry in the resource feed. It will stored the properties like
35 	title, filename and ETag etc in member variables. Normally entries are created by
36 	parsing the resource feed
37 */
38 class Entry
39 {
40 public :
41 	Entry( ) ;
42 
43 	std::string Title() const ;
44 	std::string Filename() const ;
45 	bool IsDir() const ;
46 	std::string MD5() const ;
47 	DateTime MTime() const ;
48 	u64_t Size() const ;
49 
50 	std::string Name() const ;
51 
52 	std::string ResourceID() const ;
53 	std::string ETag() const ;
54 
55 	std::string SelfHref() const ;
56 	std::string ParentHref() const ;
57 	std::string ContentSrc() const ;
58 	bool IsEditable() const ;
59 	long ChangeStamp() const ;
60 
61 	bool IsChange() const ;
62 	bool IsRemoved() const ;
63 
64 	const std::vector<std::string>& ParentHrefs() const ;
65 
66 protected :
67 	std::string		m_title ;
68 	std::string		m_filename ;
69 	bool			m_is_dir ;
70 	std::string		m_md5 ;
71 	std::string		m_etag ;
72 	std::string		m_resource_id ;
73 
74 	std::vector<std::string>	m_parent_hrefs ;
75 
76 	std::string		m_self_href ;
77 	std::string		m_content_src ;
78 
79 	bool			m_is_editable ;
80 
81 	long			m_change_stamp ;
82 
83 	DateTime		m_mtime ;
84 	bool			m_is_removed ;
85 	u64_t			m_size ;
86 } ;
87 
88 } // end of namespace gr
89