⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cimdatetime.h

📁 Pegasus is an open-source implementationof the DMTF CIM and WBEM standards. It is designed to be por
💻 H
📖 第 1 页 / 共 2 页
字号:
//%2006//////////////////////////////////////////////////////////////////////////// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;// IBM Corp.; EMC Corporation, The Open Group.// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;// EMC Corporation; VERITAS Software Corporation; The Open Group.// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;// EMC Corporation; Symantec Corporation; The Open Group.//// Permission is hereby granted, free of charge, to any person obtaining a copy// of this software and associated documentation files (the "Software"), to// deal in the Software without restriction, including without limitation the// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or// sell copies of the Software, and to permit persons to whom the Software is// furnished to do so, subject to the following conditions:// // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.////==============================================================================////%/////////////////////////////////////////////////////////////////////////////#ifndef Pegasus_CIMDateTime_h#define Pegasus_CIMDateTime_h#include <Pegasus/Common/Config.h>#include <Pegasus/Common/Array.h>#include <Pegasus/Common/Linkage.h>PEGASUS_NAMESPACE_BEGINclass CIMDateTimeRep;/**    The CIMDateTime class represents the CIM datetime data type as a C++ class    CIMDateTime.  A CIM datetime may contain a time stamp or an interval.    CIMDateTime is an intrinsic CIM data type that represents the time as a    string with a fixed length.    <PRE>    A time stamp has the following form:    yyyymmddhhmmss.mmmmmmsutc    Where    yyyy = year (1-9999)    mm = month (1-12)    dd = day (1-31)    hh = hour (0-23)    mm = minute (0-59)    ss = second (0-59)    mmmmmm = microseconds    s = '+' or '-' to represent the Coordinated Universal Time (UTC) sign    utc = offset from Coordinated Universal Time (UTC)        (same as Greenwich Mean Time(GMT) offset)    An interval has the following form:    ddddddddhhmmss.mmmmmm:000    Where    dddddddd = days    hh = hours (0-23)    mm = minutes (0-59)    ss = seconds (0-59)    mmmmmm = microseconds    </PRE>    Note:  Intervals always end in ":000".  This distinguishes intervals from    time stamps.    CIMDateTime objects are constructed from String objects or from    other CIMDateTime objects.  Character strings must be exactly    twenty-five characters in length and conform to either the time stamp    or interval format.    CIMDateTime objects that are not explicitly initialized will be    implicitly initialized with a zero time interval:    00000000000000.000000:000    The following table shows what arithmetic operations are allowed    between CIMDateTime types. The entries in the last four columns define    the type of the result when the operation, specified in the column header,    is performed on operands, of the types specified in the first two columns.    <PRE>    LHS - left hand side    TS - time stamp  int - integer    RHS - right hand side   IV - interval    X - operation not allowed between types    LHS     RHS    +       -       *        /    _____________________________________________    TS      TS     X       IV      X       X    TS      IV     TS      TS      X       X    TS      int    X       X       X       X    IV      IV     IV      IV      X       int    IV      TS     X       X       X       X    IV      int    X       X       IV      IV    int     TS     X       X       X       X    int     IV     X       X       X       X    </PRE>    The relational operators may only operate on two operands of the same type,    i.e. two time stamps or two intervals.*/class PEGASUS_COMMON_LINKAGE CIMDateTime{public:#ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES    /** Wildcard parameter for component-based initializer member functions.    */    static const Uint32 WILDCARD;#endif /* PEGASUS_USE_EXPERIMENTAL_INTERFACES */    /** Creates a new CIMDateTime object with a zero interval value.    */    CIMDateTime();    /** Creates a CIMDateTime object from another CIMDateTime object.        @param x  Specifies the name of the CIMDateTime object to copy.    */    CIMDateTime(const CIMDateTime& x);    /** Creates a new CIMDateTime object from a string constant representing        the CIM DateTime formatted datetime.        See the class documentation for CIMDateTime for the definition of the        input string for absolute and interval datetime.        @param str String object containing the CIMDateTime formatted string.        This must contain twenty-five characters.        @exception InvalidDateTimeFormatException If the input string is not        formatted correctly.    */    CIMDateTime(const String& str);    /** Creates a CIMDateTime object from an integer.        @param microSec For a time stamp, the number of microseconds since        the epoch 0/0/0000 (12 am Jan 1, 1BCE); For an interval, the number        of microseconds in the interval.        @param interval Specifies whether the CIMDateTime object is to be        created as an interval value (true) or a time stamp (false).        @exception DateTimeOutOfRangeException If the microSec value is too        large (greater than 317,455,200,000,000,000 for a time stamps or        8,640,000,000,000,000,000 for an interval).        @exception InvalidDateTimeFormatException If the CIMDateTime object is        not formed correctly.    */    CIMDateTime(Uint64 usec, Boolean isInterval);#ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES    /** Create datetime time stamp from components.        @param year zero-based year number (or CIMDateTime::WILDCARD)        @param month number from 1 to 12 (or CIMDateTime::WILDCARD)        @param day one-based day of the month (or CIMDateTime::WILDCARD)        @param hours a number from 0 to 23 (or CIMDateTime::WILDCARD)        @param minutes a number from 0 to 59 (or CIMDateTime::WILDCARD)        @param seconds a number from 0 to 59 (or CIMDateTime::WILDCARD)        @param microseconds a number from 0 to 999999        @param numSignificantMicrosecondDigits the number of decimal digits of            the microseconds parameter (from left to right) that are            significant (all others are wildcarded) or six if they are all            significant.        @param UTF offset in minutes (negative or positive).        @exception DateTimeOutOfRangeException.    */    CIMDateTime(        Uint32 year,        Uint32 month,        Uint32 day,        Uint32 hours,        Uint32 minutes,        Uint32 seconds,        Uint32 microseconds,        Uint32 numSignificantMicrosecondDigits,        Sint32 utcOffset);    /** Create datetime interval from components.        @param days a number from 0 to 99999999 (or CIMDateTime::WILDCARD)        @param hours a number from 0 to 23 (or CIMDateTime::WILDCARD)        @param minutes a number from 0 to 59 (or CIMDateTime::WILDCARD)        @param seconds a number from 0 to 59 (or CIMDateTime::WILDCARD)        @param microseconds a number from 0 to 999999        @param numSignificantMicrosecondDigits the number of decimal digits of            the microseconds parameter (from left to right) that are            significant (all others are wildcarded) or six if they are all            significant.        @exception DateTimeOutOfRangeException.    */    CIMDateTime(        Uint32 days,        Uint32 hours,        Uint32 minutes,        Uint32 seconds,        Uint32 microseconds,        Uint32 numSignificantMicrosecondDigits);#endif /* PEGASUS_USE_EXPERIMENTAL_INTERFACES */    /** CIMDateTime destructor. */    ~CIMDateTime();    /** Assigns one instance of the CIMDateTime object to another.        @param x  The CIMDateTime Object to assign to the CIMDateTime object.        For example, you can assign the d1 CIMDateTime instance to the d2        CIMDateTime instance.        <PRE>            CIMDateTime d1;            CIMDateTime d2 = "00000000000000.000000:000";            d1 = d2;        </PRE>        Therefore, d1 is assigned the same "00000000000000.000000:000" value        as d2.    */    CIMDateTime& operator=(const CIMDateTime& x);    /** Returns a string representing the DateTime value of the        CIMDateTime object.        @return String representing the DateTime value.    */    String toString() const;    /** Sets the datetime value from the input parameter.        @param str String containing the new value in the datetime format        (specified in the CIMDateTime class description).  For example, the        following sets the date to December 24, 1999 and time to 12:00 P.M.        EST.        <PRE>        CIMDateTime dt;        dt.set("19991224120000.000000-300");        </PRE>        @exception InvalidDateTimeFormatException If the datetime String is not        formatted correctly.    */    void set(const String & str);#ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES    /** Sets the datetime timestamp from individual components.        @param year zero-based year number (or CIMDateTime::WILDCARD)        @param month number from 1 to 12 (or CIMDateTime::WILDCARD)        @param day one-based day of the month (or CIMDateTime::WILDCARD)        @param hours a number from 0 to 23 (or CIMDateTime::WILDCARD)        @param minutes a number from 0 to 59 (or CIMDateTime::WILDCARD)        @param seconds a number from 0 to 59 (or CIMDateTime::WILDCARD)        @param microseconds a number from 0 to 999999        @param UTF offset in minutes (negative or positive).        @param numSignificantMicrosecondDigits the number of decimal digits of            the microseconds parameter (from left to right) that are            significant (all others are wildcarded) or six if they are all            significant.        @exception DateTimeOutOfRangeException.    */    void setTimeStamp(        Uint32 year,        Uint32 month,        Uint32 day,        Uint32 hours,        Uint32 minutes,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -