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
15namespace OpenMS
16{
25 class OPENMS_DLLAPI Date
26 {
27public:
28
35
37 Date(const Date& date) = default;
38
40 Date(Date&&) noexcept = default;
41
43 ~Date() = default;
44
46 Date& operator=(const Date& source) = default;
47
49 Date& operator=(Date&&) & noexcept = default;
50
52 bool operator==(const Date& rhs) const;
53
55 bool operator!=(const Date& rhs) const;
56
58 bool operator<(const Date& rhs) const;
59
70 void set(const String& date);
71
77 void set(UInt month, UInt day, UInt year);
78
80 static Date today();
81
87 String get() const;
88
94 void get(UInt& month, UInt& day, UInt& year) const;
95
97 void clear();
98
100 bool isValid() const;
101
103 bool isNull() const;
104
106 int year() const;
107
109 int month() const;
110
112 int day() const;
113
114private:
115 struct Fields {
116 int year = 0, month = 0, day = 0;
117 bool valid = false;
118 } fields_;
119 };
120} // namespace OpenMS
Date Class.
Definition Date.h:26
Date(const Date &date)=default
Copy constructor.
Date(Date &&) noexcept=default
Move constructor.
Date()
Default constructor.
Definition Date.h:115
A more convenient string class.
Definition String.h:32
unsigned int UInt
Unsigned integer type.
Definition Types.h:64
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19