OpenMS
Date.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- 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 
11 #include <OpenMS/CONCEPT/Types.h>
13 #include <OpenMS/OpenMSConfig.h>
14 
15 #include <QtCore/QDate>
16 
17 namespace OpenMS
18 {
27  class OPENMS_DLLAPI Date :
28  public QDate
29  {
30 public:
31 
37  Date() = default;
39  Date(const Date& date) = default;
41  Date(const QDate& date);
43  Date(Date&&) = default;
44 
46  Date& operator=(const Date& source) = default;
48  Date& operator=(Date&&) & = default;
49 
60  void set(const String& date);
61 
67  void set(UInt month, UInt day, UInt year);
68 
70  static Date today();
71 
77  String get() const;
78 
84  void get(UInt& month, UInt& day, UInt& year) const;
85 
87  void clear();
88 
89 protected:
90  };
91 } // namespace OPENMS
92 
Date Class.
Definition: Date.h:29
Date & operator=(Date &&) &=default
Move assignment operator.
Date()=default
Default constructor.
Date(const QDate &date)
Copy constructor from Qt base class.
static Date today()
Returns the current date.
Date(const Date &date)=default
Copy constructor.
void get(UInt &month, UInt &day, UInt &year) const
Fills the arguments with the date.
void set(const String &date)
sets data from a string
Date & operator=(const Date &source)=default
Assignment operator.
String get() const
Returns a string representation of the date.
void clear()
Sets the undefined date: 00/00/0000.
Date(Date &&)=default
Move constructor.
void set(UInt month, UInt day, UInt year)
sets data from three integers
A more convenient string class.
Definition: String.h:34
unsigned int UInt
Unsigned integer type.
Definition: Types.h:68
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22