1 /* === S Y N F I G ========================================================= */
2 /*!	\file cvs.h
3 **	\brief Template Header
4 **
5 **	$Id$
6 **
7 **	\legal
8 **	Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 **
10 **	This package is free software; you can redistribute it and/or
11 **	modify it under the terms of the GNU General Public License as
12 **	published by the Free Software Foundation; either version 2 of
13 **	the License, or (at your option) any later version.
14 **
15 **	This package is distributed in the hope that it will be useful,
16 **	but WITHOUT ANY WARRANTY; without even the implied warranty of
17 **	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 **	General Public License for more details.
19 **	\endlegal
20 */
21 /* ========================================================================= */
22 
23 /* === S T A R T =========================================================== */
24 
25 #ifndef __SYNFIG_CVS_H
26 #define __SYNFIG_CVS_H
27 
28 /* === H E A D E R S ======================================================= */
29 
30 #include <synfig/string.h>
31 #include <time.h>
32 
33 /* === M A C R O S ========================================================= */
34 
35 /* === T Y P E D E F S ===================================================== */
36 
37 /* === C L A S S E S & S T R U C T S ======================================= */
38 
39 namespace synfigapp {
40 
41 class CVSInfo
42 {
43 	synfig::String file_name_;
44 
45 	bool in_sandbox_;
46 	bool in_repository_;
47 	bool update_available_;
48 
49 	synfig::String cvs_version_;
50 	time_t original_timestamp_;
51 
52 
53 public:
54 	void calc_repository_info();
55 
56 	CVSInfo(const synfig::String& file_name);
57 	CVSInfo();
58 	~CVSInfo();
59 
60 	void set_file_name(const synfig::String& file_name);
61 
62 //	READ OPERATIONS --------------------------------------------------
63 
64 	//! Returns TRUE if \a file_name is in a sandbox
65 	bool in_sandbox()const;
66 
67 	//! Returns TRUE if \a file_name is in the repository
68 	bool in_repository()const;
69 
70 	//! Returns TRUE if \a file_name has modifications not yet on the repository
71 	bool is_modified()const;
72 
73 	//! Returns TRUE if there is a new version of \a file_name on the repository
74 	bool is_updated()const;
75 
76 	//! Returns the CVS version string
77 	const synfig::String& get_cvs_version()const;
78 
79 	//! Returns the unix timestamp of the repository file
80 	const time_t &get_original_timestamp()const;
81 
82 	//! Returns the unix timestamp of the checked out file
83 	time_t get_current_timestamp()const;
84 
85 	//! Returns the Root
86 	synfig::String get_cvs_root()const;
87 
88 	//! Returns the name of the module
89 	synfig::String get_cvs_module()const;
90 
91 //	WRITE OPERATIONS -------------------------------------------------
92 
93 	void cvs_add(const synfig::String& message=synfig::String());
94 
95 	void cvs_update();
96 
97 	void cvs_commit(const synfig::String& message=synfig::String());
98 }; // END of class CVSInfo
99 
100 }; // END of namespace synfigapp
101 
102 /* === E N D =============================================================== */
103 
104 #endif
105