Jpp  19.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Static Protected Member Functions | Friends | List of all members
JDATABASE::JDateAndTimeUS_t Struct Reference

Date and time. More...

#include <JDate_t.hh>

Inheritance diagram for JDATABASE::JDateAndTimeUS_t:
JDATABASE::JDateAndTime_t JEEP::JDate< JSeparator_t > JEEP::JTime< JSeparator_t > JLANG::JMultiComparable< JClass_t, JTypelist_t > JLANG::JComparable< JFirst_t, JSecond_t > JLANG::JComparable< JFirst_t, JSecond_t >

Public Member Functions

 JDateAndTimeUS_t ()
 Default constructor;. More...
 
bool less (const JDate &date) const
 Less-than method. More...
 
bool less (const JTime &time) const
 Less-than method. More...
 

Static Public Member Functions

static JDate min ()
 Minimal date. More...
 
static JTime min ()
 Minimal time. More...
 
static JDate max ()
 Maximal date. More...
 
static JTime max ()
 Maximal time. More...
 

Public Attributes

int year
 year More...
 
int month
 month More...
 
int day
 day More...
 
int hour
 hour More...
 
int minute
 minute More...
 
int second
 second More...
 

Static Public Attributes

static const char SEPARATOR = '-'
 Separation character. More...
 

Static Protected Member Functions

template<class JHead_t , class JTail_t >
static bool lt (const JClass_t &first, const JClass_t &second, const JType< JTypeList< JHead_t, JTail_t > > &type)
 Less than method for composite data types. More...
 
template<class JHead_t >
static bool lt (const JClass_t &first, const JClass_t &second, const JType< JTypeList< JHead_t, JNullType > > &type)
 Less than method for composite data types. More...
 

Friends

std::istream & operator>> (std::istream &in, JDateAndTimeUS_t &object)
 Read date and time from input stream. More...
 

Detailed Description

Date and time.

Definition at line 89 of file JDate_t.hh.

Constructor & Destructor Documentation

JDATABASE::JDateAndTimeUS_t::JDateAndTimeUS_t ( )
inline

Default constructor;.

Definition at line 95 of file JDate_t.hh.

96  {}

Member Function Documentation

template<char JSeparator_t>
static JDate JEEP::JDate< JSeparator_t >::min ( )
inlinestaticinherited

Minimal date.

Definition at line 87 of file JDate.hh.

template<char JSeparator_t>
static JTime JEEP::JTime< JSeparator_t >::min ( )
inlinestaticinherited

Minimal time.

Definition at line 87 of file Jeep/JTime.hh.

template<char JSeparator_t>
static JDate JEEP::JDate< JSeparator_t >::max ( )
inlinestaticinherited

Maximal date.

Definition at line 88 of file JDate.hh.

template<char JSeparator_t>
static JTime JEEP::JTime< JSeparator_t >::max ( )
inlinestaticinherited

Maximal time.

Definition at line 88 of file Jeep/JTime.hh.

template<char JSeparator_t>
bool JEEP::JDate< JSeparator_t >::less ( const JDate< JSeparator_t > &  date) const
inlineinherited

Less-than method.

Parameters
datedate
Returns
true if this date earlier than given date; else false

Definition at line 97 of file JDate.hh.

98  {
99  if (this->year == date.year) {
100 
101  if (this->month == date.month)
102  return this->day < date.day;
103  else
104  return this->month < date.month;
105 
106  } else {
107 
108  return this->year < date.year;
109  }
110  }
int year
year
Definition: JDate.hh:154
int month
month
Definition: JDate.hh:155
int day
day
Definition: JDate.hh:156
template<char JSeparator_t>
bool JEEP::JTime< JSeparator_t >::less ( const JTime< JSeparator_t > &  time) const
inlineinherited

Less-than method.

Parameters
timetime
Returns
true if this time earlier than given time; else false

Definition at line 97 of file Jeep/JTime.hh.

98  {
99  if (this->hour == time.hour) {
100 
101  if (this->minute == time.minute)
102  return this->second < time.second;
103  else
104  return this->minute < time.minute;
105 
106  } else {
107 
108  return this->hour < time.hour;
109  }
110  }
int second
second
Definition: Jeep/JTime.hh:156
int minute
minute
Definition: Jeep/JTime.hh:155
int hour
hour
Definition: Jeep/JTime.hh:154
template<class JClass_t, class JTypelist_t>
template<class JHead_t , class JTail_t >
static bool JLANG::JMultiComparable< JClass_t, JTypelist_t >::lt ( const JClass_t &  first,
const JClass_t &  second,
const JType< JTypeList< JHead_t, JTail_t > > &  type 
)
inlinestaticprotectedinherited

Less than method for composite data types.

Parameters
firstfirst object
secondsecond object
typetype
Returns
true if first object is less than second object; else false

Definition at line 43 of file JMultiComparable.hh.

46  {
47  if (static_cast<const JHead_t&>(first) <
48  static_cast<const JHead_t&>(second))
49  return true;
50  else if (static_cast<const JHead_t&>(second) <
51  static_cast<const JHead_t&>(first))
52  return false;
53  else
54  return lt(first, second, JType<JTail_t>());
55  }
Auxiliary class for a type holder.
Definition: JType.hh:19
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
static bool lt(const JClass_t &first, const JClass_t &second, const JType< JTypeList< JHead_t, JTail_t > > &type)
Less than method for composite data types.
template<class JClass_t, class JTypelist_t>
template<class JHead_t >
static bool JLANG::JMultiComparable< JClass_t, JTypelist_t >::lt ( const JClass_t &  first,
const JClass_t &  second,
const JType< JTypeList< JHead_t, JNullType > > &  type 
)
inlinestaticprotectedinherited

Less than method for composite data types.

Parameters
firstfirst object
secondsecond object
typetype
Returns
true if first object is less than second object; else false

Definition at line 67 of file JMultiComparable.hh.

70  {
71  return (static_cast<const JHead_t&>(first) <
72  static_cast<const JHead_t&>(second));
73  }
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first

Friends And Related Function Documentation

std::istream& operator>> ( std::istream &  in,
JDateAndTimeUS_t object 
)
friend

Read date and time from input stream.

Parameters
ininput stream
objectdate and time
Returns
input stream

Definition at line 106 of file JDate_t.hh.

107  {
108  using namespace std;
109  using namespace JPP;
110 
111  object = JDateAndTimeUS_t();
112 
113  while (isspace(in.peek())) { in.ignore(); }
114 
115  const locale loc = in.imbue(locale(in.getloc(), new JWhiteSpacesFacet(in.getloc(), JDate_t::SEPARATOR)));
116 
117  in >> object.month >> object.day >> object.year;
118 
119  if (in.get() == (int) ' ') {
120 
121  in.imbue(locale(in.getloc(), new JWhiteSpacesFacet(in.getloc(), JTime_t::SEPARATOR)));
122 
123  in >> object.hour >> object.minute >> object.second;
124 
125  if (in.get() == (int) ' ') {
126 
127  string key;
128 
129  in >> key;
130 
131  if (key == "am" || key == "AM") {}
132  if (key == "pm" || key == "PM") { object.hour += 12; }
133  }
134  }
135 
136  in.imbue(loc);
137 
138  return in;
139  }
static const char SEPARATOR
Separation character.
Definition: JDate.hh:45
JDateAndTimeUS_t()
Default constructor;.
Definition: JDate_t.hh:95
static const char SEPARATOR
Separation character.
Definition: Jeep/JTime.hh:45
then fatal The output file must have the wildcard in the e g root fi eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:48
char * loc(char *orig)

Member Data Documentation

const char JDATABASE::JDateAndTime_t::SEPARATOR = '-'
staticinherited

Separation character.

Definition at line 39 of file JDate_t.hh.

template<char JSeparator_t>
int JEEP::JDate< JSeparator_t >::year
inherited

year

Definition at line 154 of file JDate.hh.

template<char JSeparator_t>
int JEEP::JDate< JSeparator_t >::month
inherited

month

Definition at line 155 of file JDate.hh.

template<char JSeparator_t>
int JEEP::JDate< JSeparator_t >::day
inherited

day

Definition at line 156 of file JDate.hh.

template<char JSeparator_t>
int JEEP::JTime< JSeparator_t >::hour
inherited

hour

Definition at line 154 of file Jeep/JTime.hh.

template<char JSeparator_t>
int JEEP::JTime< JSeparator_t >::minute
inherited

minute

Definition at line 155 of file Jeep/JTime.hh.

template<char JSeparator_t>
int JEEP::JTime< JSeparator_t >::second
inherited

second

Definition at line 156 of file Jeep/JTime.hh.


The documentation for this struct was generated from the following file: