~ubuntu-branches/debian/sid/kdesvn/sid

« back to all changes in this revision

Viewing changes to src/svnqt/datetime.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2006-10-27 12:52:15 UTC
  • mfrom: (1.2.1 upstream) (5.1.4 edgy)
  • Revision ID: james.westby@ubuntu.com-20061027125215-aifcjirifidnegx5
Tags: 0.11.0-1
* New upstream release.
* debian/patches/01-kompare_diff.patch
  + Removed. Fixed upstream.
* debian/control
  + Add a "Suggests: kdiff3" to kdesvn. kdiff3 can be used as an external
    merge program.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * ====================================================================
 
3
 * Copyright (c) 2002-2005 The RapidSvn Group.  All rights reserved.
 
4
 *
 
5
 * This library is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU Lesser General Public
 
7
 * License as published by the Free Software Foundation; either
 
8
 * version 2.1 of the License, or (at your option) any later version.
 
9
 *
 
10
 * This library 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 GNU
 
13
 * Lesser General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU Lesser General Public
 
16
 * License along with this library (in the file LGPL.txt); if not,
 
17
 * write to the Free Software Foundation, Inc., 51 Franklin St,
 
18
 * Fifth Floor, Boston, MA  02110-1301  USA
 
19
 *
 
20
 * This software consists of voluntary contributions made by many
 
21
 * individuals.  For exact contribution history, see the revision
 
22
 * history and logs, available at http://rapidsvn.tigris.org/.
 
23
 * ====================================================================
 
24
 */
 
25
 
 
26
#ifndef _SVNCPP_DATETIME_HPP_
 
27
#define _SVNCPP_DATETIME_HPP_
 
28
 
 
29
#include "svnqt/svnqt_defines.hpp"
 
30
 
 
31
#include <qdatetime.h>
 
32
 
 
33
// subversion api
 
34
#include "svn_types.h"
 
35
 
 
36
 
 
37
namespace svn
 
38
{
 
39
  /**
 
40
   * Class that encapsulates apr_time_t.
 
41
   *
 
42
   * @see apr_time_t
 
43
   */
 
44
  class SVNQT_EXPORT DateTime
 
45
  {
 
46
  private:
 
47
    apr_time_t m_time;
 
48
 
 
49
  public:
 
50
 
 
51
    /**
 
52
     * Default Constructor
 
53
     */
 
54
    DateTime ();
 
55
 
 
56
    /**
 
57
     * Constructor
 
58
     *
 
59
     * @param time number of microseconds since 00:00:00 january 1, 1970 UTC
 
60
     */
 
61
    DateTime (const apr_time_t time);
 
62
 
 
63
    /**
 
64
     * Constructor
 
65
     *
 
66
     * @param dt QDateTime class
 
67
     */
 
68
    DateTime(const QDateTime&dt);
 
69
 
 
70
    /**
 
71
     * Copy constructor
 
72
     *
 
73
     * @param dateTime Source
 
74
     */
 
75
    DateTime (const DateTime & dateTime);
 
76
 
 
77
    /**
 
78
     * @param dateTime Source
 
79
     */
 
80
    const DateTime &
 
81
    operator =(const DateTime & dateTime);
 
82
 
 
83
    /**
 
84
     * @param dateTime Comparator
 
85
     */
 
86
    const bool
 
87
    operator ==(const DateTime & dateTime);
 
88
    /**
 
89
     * @param dateTime Comparator
 
90
     */
 
91
    const bool
 
92
    operator !=(const DateTime & dateTime);
 
93
 
 
94
    const bool
 
95
    operator<(const DateTime&dateTime)const;
 
96
    const bool
 
97
    operator>(const DateTime&dateTime)const;
 
98
    const bool
 
99
    operator!=(const DateTime&dateTime)const;
 
100
    const bool
 
101
    operator==(const DateTime&dateTime)const;
 
102
 
 
103
 
 
104
    /**
 
105
     * @return Is a valid (non-zero) date
 
106
     */
 
107
    const bool
 
108
    IsValid () const;
 
109
 
 
110
    /**
 
111
     * @return APR apr_time_t
 
112
     */
 
113
    const apr_time_t
 
114
    GetAPRTimeT () const;
 
115
 
 
116
    /**
 
117
     * @return QDateTime object
 
118
     */
 
119
    operator QDateTime()const;
 
120
 
 
121
    /**
 
122
     * @param format format string
 
123
     * @return formatted string
 
124
     * @see QDateTime::toString
 
125
     */
 
126
    QString toString(const QString&format)const;
 
127
 
 
128
    /**
 
129
     * Set from date string of the form below, using apr_date_parse_rfc
 
130
     *
 
131
     * <PRE>
 
132
     *     Sun, 06 Nov 1994 08:49:37 GMT
 
133
     * </PRE>
 
134
     *
 
135
     * @see apr_date_parse_rfc
 
136
     * @return Successfully parsed
 
137
     */
 
138
    const bool
 
139
    SetRFC822Date (const char* date);
 
140
  };
 
141
}
 
142
 
 
143
#endif
 
144
/* -----------------------------------------------------------------
 
145
 * local variables:
 
146
 * eval: (load-file "../../rapidsvn-dev.el")
 
147
 * end:
 
148
 */