NCBI C++ ToolKit
Date_std.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: Date_std.hpp 57645 2013-04-01 18:37:02Z ucko $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Author: Aaron Ucko, NCBI
27  *
28  * File Description:
29  * Useful member functions for standard dates: comparison and formatting
30  *
31  * Remark:
32  * This code was originally generated by application DATATOOL
33  * using specifications from the ASN data definition file
34  * 'general.asn'.
35  */
36 
37 #ifndef OBJECTS_GENERAL_DATE_STD_HPP
38 #define OBJECTS_GENERAL_DATE_STD_HPP
39 
40 
41 // generated includes
43 
44 #include <objects/general/Date.hpp>
45 
46 // generated classes
47 
49 
50 BEGIN_objects_SCOPE // namespace ncbi::objects::
51 
53 {
55 public:
56  // constructors
57  CDate_std(void);
58  CDate_std(const CTime& time,
60  explicit CDate_std(time_t time,
62 
63  // destructor
64  ~CDate_std(void);
65 
66  // conversion to/from CTime
67  void SetToTime(const CTime& time,
69  CTime AsCTime (CTime::ETimeZone tz = CTime::eLocal) const;
70 
71  /// Indicate how *this relates to another date.
72  CDate::ECompare Compare(const CDate_std& date) const;
73 
74  /// Append a custom string representation of the date to the label.
75  ///
76  /// @sa CDate::GetDate
77  void GetDate(string* label, const string& format) const;
78 
79 private:
80  // Prohibit copy constructor and assignment operator
83 
84 };
85 
86 
87 
88 /////////////////// CDate_std inline methods
89 
90 // constructor
91 inline
93 {
94 }
95 
96 inline
98 {
99  SetToTime(time, prec);
100 }
101 
102 inline
104 {
105  SetToTime(CTime(time), prec);
106 }
107 
108 
109 /////////////////// end of CDate_std inline methods
110 
111 
112 END_objects_SCOPE // namespace ncbi::objects::
113 
115 
116 #endif // OBJECTS_GENERAL_DATE_STD_HPP
117 /* Original file checksum: lines: 90, chars: 2388, CRC32: 3888bc05 */
Data storage class.
NOTE: this is NOT a unix tm struct.
Definition: Date_std_.hpp:74
void SetToTime(const CTime &time, CDate::EPrecision prec=CDate::ePrecision_second)
Definition: Date_std.cpp:59
CDate_std(const CDate_std &value)
CDate_std & operator=(const CDate_std &value)
CDate_std(void)
Definition: Date_std.hpp:92
CDate_std_Base Tparent
Definition: Date_std.hpp:54
EPrecision
for conversion from CTime
Definition: Date.hpp:57
@ ePrecision_second
Definition: Date.hpp:59
ECompare
How *this relates to another date.
Definition: Date.hpp:73
CTime –.
Definition: ncbitime.hpp:296
sequence::ECompare Compare(const CSeq_loc &loc1, const CSeq_loc &loc2, CScope *scope)
Returns the sequence::ECompare containment relationship between CSeq_locs.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
ETimeZone
Which initial value to use for timezone.
Definition: ncbitime.hpp:305
@ eLocal
Local time.
Definition: ncbitime.hpp:306
#define NCBI_GENERAL_EXPORT
Definition: ncbi_export.h:512
static const char label[]
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
static Format format
Definition: njn_ioutil.cpp:53
Modified on Wed Apr 17 13:08:32 2024 by modify_doxy.py rev. 669887