libtime++: Date and time calculation
base_constr.cc
Go to the documentation of this file.
1 /* this is <base_constr.cc>
2  * ----------------------------------------------------------------------------
3  *
4  * 09/08/2000 by Thomas Forbriger (IfG Stuttgart)
5  *
6  * TBaseClassTime constructor
7  *
8  * ----
9  * libtime is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22  * ----
23  *
24  * REVISIONS and CHANGES
25  * 09/08/2000 V1.0 Thomas Forbriger
26  * 06/09/2000 V1.1 added character array initializer
27  * 22/12/2000 V1.2 changed namespace time to libtime (resolved conflict
28  * with system time library)
29  * 22/12/2003 V1.3 added function now()
30  * correction: month in struct tm is in (0,11)
31  * 02/02/2004 V1.4 moved conversion code double2time()
32  * 17/12/2007 V1.5 replace long int by typedef timeint
33  * 11/11/2009 V1.6 header cstdlib is required for abort
34  * 20/02/2012 V1.7 use const char*
35  *
36  * ============================================================================
37  */
38 
39 #include "libtime++.h"
40 #include <cstring>
41 #include <ctime>
42 #include <cstdlib>
43 #include <iostream>
44 
45 namespace libtime {
46 
47 void TBaseClassTime::string_read(const std::string &timestring)
48 {
50  timestring.c_str())
51  !=EXIT_SUCCESS)
52  {
53  std::cerr << "TBaseClassTime could not initialize time structure "
54  << "from string:\n" << timestring << "\n";
55  std::abort();
56  }
57 }
58 
59 void TBaseClassTime::char_read(const char *timestring)
60 {
62 }
63 
64 }; // namespace libtime
65 
66 /* ----- END OF base_constr.cc ----- */
time_kernel::time_Ts Mtime_Ts
Definition: libtime++.h:140
std::string timestring() const
Definition: libtime++.h:267
void char_read(const char *timestring)
Definition: base_constr.cc:59
#define EXIT_SUCCESS
Definition: libtime.h:86
int time_read(time_Ts *Date, const char *String)
Definition: ctime_read.c:37
void string_read(const std::string &timestring)
Definition: base_constr.cc:47