my log
[synfig.git] / synfig-studio / trunk / src / synfigapp / cvs.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file cvs.h
3 **      \brief Template Header
4 **
5 **      $Id: cvs.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
6 **
7 **      \legal
8 **      Copyright (c) 2002 Robert B. Quattlebaum Jr.
9 **
10 **      This software and associated documentation
11 **      are CONFIDENTIAL and PROPRIETARY property of
12 **      the above-mentioned copyright holder.
13 **
14 **      You may not copy, print, publish, or in any
15 **      other way distribute this software without
16 **      a prior written agreement with
17 **      the copyright holder.
18 **      \endlegal
19 */
20 /* ========================================================================= */
21
22 /* === S T A R T =========================================================== */
23
24 #ifndef __SYNFIG_CVS_H
25 #define __SYNFIG_CVS_H
26
27 /* === H E A D E R S ======================================================= */
28
29 #include <synfig/string.h>
30 #include <time.h>
31
32 /* === M A C R O S ========================================================= */
33
34 /* === T Y P E D E F S ===================================================== */
35
36 /* === C L A S S E S & S T R U C T S ======================================= */
37
38 namespace synfigapp {
39
40 class CVSInfo
41 {
42         synfig::String file_name_;
43
44         bool in_sandbox_;
45         bool in_repository_;
46         bool update_available_;
47         
48         synfig::String cvs_version_;
49         time_t original_timestamp_;
50         
51         
52 public:
53         void calc_repository_info();
54         
55         CVSInfo(const synfig::String& file_name);
56         CVSInfo();
57         ~CVSInfo();
58
59         void set_file_name(const synfig::String& file_name);
60
61 //      READ OPERATIONS --------------------------------------------------
62
63         //! Returns TRUE if \a file_name is in a sandbox
64         bool in_sandbox()const;
65         
66         //! Returns TRUE if \a file_name is in the repository
67         bool in_repository()const;
68
69         //! Returns TRUE if \a file_name has modifications not yet on the repository
70         bool is_modified()const;
71
72         //! Returns TRUE if there is a new version of \a file_name on the repository
73         bool is_updated()const;
74
75         //! Returns the CVS version string
76         const synfig::String& get_cvs_version()const;
77         
78         //! Returns the unix timestamp of the repository file
79         const time_t &get_original_timestamp()const;
80
81         //! Returns the unix timestamp of the checked out file
82         time_t get_current_timestamp()const;
83
84         //! Returns the Root
85         synfig::String get_cvs_root()const;
86
87         //! Returns the name of the module
88         synfig::String get_cvs_module()const;
89                         
90 //      WRITE OPERATIONS -------------------------------------------------
91         
92         void cvs_add(const synfig::String& message=synfig::String());
93         
94         void cvs_update();
95         
96         void cvs_commit(const synfig::String& message=synfig::String());
97 }; // END of class CVSInfo
98         
99 }; // END of namespace synfigapp
100
101 /* === E N D =============================================================== */
102
103 #endif