ICU 74.2: i18n/unicode/dtrule.h Source File

ICU 74.2 74.2

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
14#if U_SHOW_CPLUSPLUS_API
15
21#if !UCONFIG_NO_FORMATTING
22
23#include "unicode/uobject.h"
24
25U_NAMESPACE_BEGIN
33 class U_I18N_API DateTimeRule : public UObject {
34public:
35
40 enum DateRuleType {
41 DOM = 0,
43 DOW,
45 DOW_GEQ_DOM,
47 DOW_LEQ_DOM
49 };
50
55 enum TimeRuleType {
56 WALL_TIME = 0,
57 STANDARD_TIME,
58 UTC_TIME
59 };
60
73 DateTimeRule(int32_t month, int32_t dayOfMonth,
74 int32_t millisInDay, TimeRuleType timeType);
75
91 DateTimeRule(int32_t month, int32_t weekInMonth, int32_t dayOfWeek,
92 int32_t millisInDay, TimeRuleType timeType);
93
109 DateTimeRule(int32_t month, int32_t dayOfMonth, int32_t dayOfWeek, UBool after,
110 int32_t millisInDay, TimeRuleType timeType);
111
117 DateTimeRule(const DateTimeRule& source);
118
123 ~DateTimeRule();
124
131 DateTimeRule* clone() const;
132
138 DateTimeRule& operator=(const DateTimeRule& right);
139
147 bool operator==(const DateTimeRule& that) const;
148
156 bool operator!=(const DateTimeRule& that) const;
157
163 DateRuleType getDateRuleType(void) const;
164
171 TimeRuleType getTimeRuleType(void) const;
172
178 int32_t getRuleMonth(void) const;
179
186 int32_t getRuleDayOfMonth(void) const;
187
194 int32_t getRuleDayOfWeek(void) const;
195
203 int32_t getRuleWeekInMonth(void) const;
204
210 int32_t getRuleMillisInDay(void) const;
211
212private:
213 int32_t fMonth;
214 int32_t fDayOfMonth;
215 int32_t fDayOfWeek;
216 int32_t fWeekInMonth;
217 int32_t fMillisInDay;
218 DateRuleType fDateRuleType;
219 TimeRuleType fTimeRuleType;
220
221public:
233 static UClassID U_EXPORT2 getStaticClassID(void);
234
246 virtual UClassID getDynamicClassID(void) const override;
247};
248
249U_NAMESPACE_END
250
251#endif /* #if !UCONFIG_NO_FORMATTING */
252
253#endif /* U_SHOW_CPLUSPLUS_API */
254
255#endif // DTRULE_H
256//eof
icu::DateTimeRule
DateTimeRule is a class representing a time in a year by a rule specified by month,...
Definition dtrule.h:33
icu::DateTimeRule::clone
DateTimeRule * clone() const
Clone this DateTimeRule object polymorphically.
icu::DateTimeRule::getRuleDayOfWeek
int32_t getRuleDayOfWeek(void) const
Gets the rule day of week.
icu::DateTimeRule::getTimeRuleType
TimeRuleType getTimeRuleType(void) const
Gets the time rule type.
icu::DateTimeRule::DateRuleType
DateRuleType
Date rule type constants.
Definition dtrule.h:40
icu::DateTimeRule::operator==
bool operator==(const DateTimeRule &that) const
Return true if the given DateTimeRule objects are semantically equal.
icu::DateTimeRule::getRuleWeekInMonth
int32_t getRuleWeekInMonth(void) const
Gets the ordinal number of the occurrence of the day of week in the month.
icu::DateTimeRule::getStaticClassID
static UClassID getStaticClassID(void)
Return the class ID for this class.
icu::DateTimeRule::DateTimeRule
DateTimeRule(const DateTimeRule &source)
Copy constructor.
icu::DateTimeRule::operator=
DateTimeRule & operator=(const DateTimeRule &right)
Assignment operator.
icu::DateTimeRule::getRuleMonth
int32_t getRuleMonth(void) const
Gets the rule month.
icu::DateTimeRule::DateTimeRule
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 ordinal number and the time rule.
icu::DateTimeRule::TimeRuleType
TimeRuleType
Time rule type constants.
Definition dtrule.h:55
icu::DateTimeRule::STANDARD_TIME
@ STANDARD_TIME
The local standard time.
Definition dtrule.h:57
icu::DateTimeRule::getDynamicClassID
virtual UClassID getDynamicClassID(void) const override
Returns a unique class ID POLYMORPHICALLY.
icu::DateTimeRule::getDateRuleType
DateRuleType getDateRuleType(void) const
Gets the date rule type, such as DOM
icu::DateTimeRule::operator!=
bool operator!=(const DateTimeRule &that) const
Return true if the given DateTimeRule objects are semantically unequal.
icu::DateTimeRule::~DateTimeRule
~DateTimeRule()
Destructor.
icu::DateTimeRule::getRuleMillisInDay
int32_t getRuleMillisInDay(void) const
Gets the rule time in the rule day.
icu::DateTimeRule::DateTimeRule
DateTimeRule(int32_t month, int32_t dayOfMonth, int32_t millisInDay, TimeRuleType timeType)
Constructs a DateTimeRule by the day of month and the time rule.
icu::DateTimeRule::DateTimeRule
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...
icu::DateTimeRule::getRuleDayOfMonth
int32_t getRuleDayOfMonth(void) const
Gets the rule day of month.
icu::UObject
UObject is the common ICU "boilerplate" class.
Definition uobject.h:223
UBool
int8_t UBool
The ICU boolean type, a signed-byte integer.
Definition umachine.h:247
uobject.h
C++ API: Common ICU base class UObject.
UClassID
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition uobject.h:96
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
U_I18N_API
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.
Definition utypes.h:301