ICU 62.1 62.1
dtrule.h
Go to the documentation of this file.
1// © 2016 and later: Unicode, Inc. and others.
2// License & terms of use: http://www.unicode.org/copyright.html
3/*
4*******************************************************************************
5* Copyright (C) 2007-2008, International Business Machines Corporation and *
6* others. All Rights Reserved. *
7*******************************************************************************
8*/
9#ifndef DTRULE_H
10#define DTRULE_H
11
12#include "unicode/utypes.h"
13
19#if !UCONFIG_NO_FORMATTING
20
21#include "unicode/uobject.h"
22
32public:
33
39 DOM = 0,
41 DOW,
43 DOW_GEQ_DOM,
45 DOW_LEQ_DOM
47 };
48
54 WALL_TIME = 0,
56 UTC_TIME
57 };
58
71 DateTimeRule(int32_t month, int32_t dayOfMonth,
73
89 DateTimeRule(int32_t month, int32_t weekInMonth, int32_t dayOfWeek,
91
107 DateTimeRule(int32_t month, int32_t dayOfMonth, int32_t dayOfWeek, UBool after,
109
116
122
129 DateTimeRule* clone(void) const;
130
137
146
155
162
170
176 int32_t getRuleMonth(void) const;
177
184 int32_t getRuleDayOfMonth(void) const;
185
192 int32_t getRuleDayOfWeek(void) const;
193
201 int32_t getRuleWeekInMonth(void) const;
202
208 int32_t getRuleMillisInDay(void) const;
209
210private:
211 int32_t fMonth;
212 int32_t fDayOfMonth;
213 int32_t fDayOfWeek;
214 int32_t fWeekInMonth;
215 int32_t fMillisInDay;
216 DateRuleType fDateRuleType;
217 TimeRuleType fTimeRuleType;
218
219public:
232
244 virtual UClassID getDynamicClassID(void) const;
245};
246
248
249#endif /* #if !UCONFIG_NO_FORMATTING */
250
251#endif // DTRULE_H
252//eof
DateTimeRule is a class representing a time in a year by a rule specified by month,...
Definition dtrule.h:31
UBool operator!=(const DateTimeRule &that) const
Return true if the given DateTimeRule objects are semantically unequal.
int32_t getRuleDayOfWeek(void) const
Gets the rule day of week.
TimeRuleType getTimeRuleType(void) const
Gets the time rule type.
DateRuleType
Date rule type constants.
Definition dtrule.h:38
int32_t getRuleWeekInMonth(void) const
Gets the ordinal number of the occurence of the day of week in the month.
static UClassID getStaticClassID(void)
Return the class ID for this class.
DateTimeRule(const DateTimeRule &source)
Copy constructor.
DateTimeRule & operator=(const DateTimeRule &right)
Assignment operator.
int32_t getRuleMonth(void) const
Gets the rule month.
DateTimeRule(int32_t month, int32_t weekInMonth, int32_t dayOfWeek, int32_t millisInDay, TimeRuleType timeType)
Constructs a DateTimeRule by the day of week and its oridinal number and the time rule.
DateTimeRule * clone(void) const
Clone this DateTimeRule object polymorphically.
TimeRuleType
Time rule type constants.
Definition dtrule.h:53
@ STANDARD_TIME
The local standard time.
Definition dtrule.h:55
DateRuleType getDateRuleType(void) const
Gets the date rule type, such as DOM
~DateTimeRule()
Destructor.
UBool operator==(const DateTimeRule &that) const
Return true if the given DateTimeRule objects are semantically equal.
virtual UClassID getDynamicClassID(void) const
Returns a unique class ID POLYMORPHICALLY.
int32_t getRuleMillisInDay(void) const
Gets the rule time in the rule day.
DateTimeRule(int32_t month, int32_t dayOfMonth, int32_t millisInDay, TimeRuleType timeType)
Constructs a DateTimeRule by the day of month and the time rule.
DateTimeRule(int32_t month, int32_t dayOfMonth, int32_t dayOfWeek, UBool after, int32_t millisInDay, TimeRuleType timeType)
Constructs a DateTimeRule by the first/last day of week on or after/before the day of month and the t...
int32_t getRuleDayOfMonth(void) const
Gets the rule day of month.
"Smart pointer" base class; do not use directly: use LocalPointer etc.
UObject is the common ICU "boilerplate" class.
Definition uobject.h:223
int8_t UBool
The ICU boolean type.
Definition umachine.h:236
C++ API: Common ICU base class UObject.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition uobject.h:93
Basic definitions for ICU, for both C and C++ APIs.
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.
Definition utypes.h:360
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition uversion.h:138
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition uversion.h:137