OpenMS
Loading...
Searching...
No Matches
Date.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Timo Sachsenberg$
6// $Authors: Marc Sturm $
7// --------------------------------------------------------------------------
8
9#pragma once
10
13#include <OpenMS/OpenMSConfig.h>
14
15#include <memory>
16
17// forward declaration
18class QDate;
19
20namespace OpenMS
21{
30 class OPENMS_DLLAPI Date
31 {
32public:
33
40
42 Date(const Date& date);
43
45 Date(const QDate& date);
46
48 Date(Date&&) noexcept;
49
51 ~Date();
52
54 Date& operator=(const Date& source);
55
57 Date& operator=(Date&&) & noexcept;
58
60 bool operator==(const Date& rhs) const;
61
63 bool operator!=(const Date& rhs) const;
64
66 bool operator<(const Date& rhs) const;
67
78 void set(const String& date);
79
85 void set(UInt month, UInt day, UInt year);
86
88 static Date today();
89
95 String get() const;
96
102 void get(UInt& month, UInt& day, UInt& year) const;
103
105 void clear();
106
108 bool isValid() const;
109
111 bool isNull() const;
112
114 int year() const;
115
117 int month() const;
118
120 int day() const;
121
122private:
123 std::unique_ptr<QDate> date_;
124 };
125} // namespace OPENMS
126
Date Class.
Definition Date.h:31
Date(const Date &date)
Copy constructor.
Date(Date &&) noexcept
Move constructor.
Date(const QDate &date)
Copy constructor from Qt base class.
Date()
Default constructor.
A more convenient string class.
Definition String.h:34
unsigned int UInt
Unsigned integer type.
Definition Types.h:64
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
STL namespace.