dtrule.h
Go to the documentation of this file.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
* Copyright (C) 2007-2008, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
#ifndef DTRULE_H
#define DTRULE_H
#include "unicode/utypes.h"
#if U_SHOW_CPLUSPLUS_API
#if !UCONFIG_NO_FORMATTING
#include "unicode/uobject.h"
U_NAMESPACE_BEGIN
class U_I18N_API DateTimeRule : public UObject {
public:
enum DateRuleType {
DOM = 0,
DOW,
DOW_GEQ_DOM,
DOW_LEQ_DOM
};
enum TimeRuleType {
WALL_TIME = 0,
STANDARD_TIME,
UTC_TIME
};
DateTimeRule(int32_t month, int32_t dayOfMonth,
int32_t millisInDay, TimeRuleType timeType);
DateTimeRule(int32_t month, int32_t weekInMonth, int32_t dayOfWeek,
int32_t millisInDay, TimeRuleType timeType);
DateTimeRule(int32_t month, int32_t dayOfMonth, int32_t dayOfWeek, UBool after,
int32_t millisInDay, TimeRuleType timeType);
DateTimeRule(const DateTimeRule& source);
~DateTimeRule();
DateTimeRule* clone() const;
DateTimeRule& operator=(const DateTimeRule& right);
bool operator==(const DateTimeRule& that) const;
bool operator!=(const DateTimeRule& that) const;
DateRuleType getDateRuleType() const;
TimeRuleType getTimeRuleType() const;
int32_t getRuleMonth() const;
int32_t getRuleDayOfMonth() const;
int32_t getRuleDayOfWeek() const;
int32_t getRuleWeekInMonth() const;
int32_t getRuleMillisInDay() const;
private:
int32_t fMonth;
int32_t fDayOfMonth;
int32_t fDayOfWeek;
int32_t fWeekInMonth;
int32_t fMillisInDay;
DateRuleType fDateRuleType;
TimeRuleType fTimeRuleType;
public:
static UClassID U_EXPORT2 getStaticClassID();
virtual UClassID getDynamicClassID() const override;
};
U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_FORMATTING */
#endif /* U_SHOW_CPLUSPLUS_API */
#endif // DTRULE_H
//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::getStaticClassID
static UClassID getStaticClassID()
Return the class ID for this class.
icu::DateTimeRule::getDateRuleType
DateRuleType getDateRuleType() const
Gets the date rule type, such as DOM
icu::DateTimeRule::getRuleDayOfMonth
int32_t getRuleDayOfMonth() const
Gets the rule day of month.
icu::DateTimeRule::DateRuleType
DateRuleType
Date rule type constants.
Definition dtrule.h:40
icu::DateTimeRule::getRuleWeekInMonth
int32_t getRuleWeekInMonth() const
Gets the ordinal number of the occurrence of the day of week in the month.
icu::DateTimeRule::operator==
bool operator==(const DateTimeRule &that) const
Return true if the given DateTimeRule objects are semantically equal.
icu::DateTimeRule::DateTimeRule
DateTimeRule(const DateTimeRule &source)
Copy constructor.
icu::DateTimeRule::getTimeRuleType
TimeRuleType getTimeRuleType() const
Gets the time rule type.
icu::DateTimeRule::operator=
DateTimeRule & operator=(const DateTimeRule &right)
Assignment operator.
icu::DateTimeRule::getDynamicClassID
virtual UClassID getDynamicClassID() const override
Returns a unique class ID POLYMORPHICALLY.
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::operator!=
bool operator!=(const DateTimeRule &that) const
Return true if the given DateTimeRule objects are semantically unequal.
icu::DateTimeRule::getRuleMillisInDay
int32_t getRuleMillisInDay() const
Gets the rule time in the rule day.
icu::DateTimeRule::~DateTimeRule
~DateTimeRule()
Destructor.
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::getRuleMonth
int32_t getRuleMonth() const
Gets the rule month.
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::getRuleDayOfWeek
int32_t getRuleDayOfWeek() const
Gets the rule day of week.
icu::LocalPointerBase
"Smart pointer" base class; do not use directly: use LocalPointer etc.
Definition localpointer.h:68
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:316