(file) Return to CIMDateTime.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/CIMDateTime.h between version 1.48.10.1 and 1.52

version 1.48.10.1, 2006/02/10 16:09:33 version 1.52, 2006/11/10 18:14:57
Line 31 
Line 31 
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 #ifndef Pegasus_DateTime_h  #ifndef Pegasus_CIMDateTime_h
 #define Pegasus_DateTime_h  #define Pegasus_CIMDateTime_h
  
 #include <Pegasus/Common/Config.h> #include <Pegasus/Common/Config.h>
 #include <Pegasus/Common/Array.h> #include <Pegasus/Common/Array.h>
Line 121 
Line 121 
 { {
 public: 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.     /** Creates a new CIMDateTime object with a zero interval value.
     */     */
     CIMDateTime();     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     /** Creates a new CIMDateTime object from a string constant representing
         the CIM DateTime formatted datetime.         the CIM DateTime formatted datetime.
         See the class documentation for CIMDateTime for the definition of the         See the class documentation for CIMDateTime for the definition of the
Line 136 
Line 149 
     */     */
     CIMDateTime(const String & str);     CIMDateTime(const String & str);
  
     /** 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 CIMDateTime object from an integer.     /** Creates a CIMDateTime object from an integer.
         @param microSec For a time stamp, the number of microseconds since         @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         the epoch 0/0/0000 (12 am Jan 1, 1BCE); For an interval, the number
Line 153 
Line 161 
         @exception InvalidDateTimeFormatException If the CIMDateTime object is         @exception InvalidDateTimeFormatException If the CIMDateTime object is
         not formed correctly.         not formed correctly.
     */     */
     CIMDateTime(Uint64 microSec, Boolean interval);      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 destructor. */
     ~CIMDateTime();     ~CIMDateTime();
Line 167 
Line 225 
             CIMDateTime d2 = "00000000000000.000000:000";             CIMDateTime d2 = "00000000000000.000000:000";
             d1 = d2;             d1 = d2;
         </PRE>         </PRE>
         Therefore, d1 is assigned the same "00000000000000.000000:000" value as d2.          Therefore, d1 is assigned the same "00000000000000.000000:000" value
           as d2.
     */     */
     CIMDateTime& operator=(const CIMDateTime& x);     CIMDateTime& operator=(const CIMDateTime& x);
  
Line 193 
Line 252 
     */     */
     void set(const String & str);     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,
           Uint32 seconds,
           Uint32 microseconds,
           Uint32 numSignificantMicrosecondDigits,
           Sint32 utcOffset);
   
       /** Create datetime interval from components.
           @param days a number from 0 to 99999999
           @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.
       */
       void setInterval(
           Uint32 days,
           Uint32 hours,
           Uint32 minutes,
           Uint32 seconds,
           Uint32 microseconds,
           Uint32 numSignificantMicrosecondDigits);
   
   #endif /* PEGASUS_USE_EXPERIMENTAL_INTERFACES */
   
     /** Clears the datetime class object.  The date time is set to     /** Clears the datetime class object.  The date time is set to
         a zero interval value.         a zero interval value.
     */     */
Line 220 
Line 329 
     Boolean isInterval() const;     Boolean isInterval() const;
     Boolean isInterval();     Boolean isInterval();
  
   #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
   
       /** Checks whether the datetime is a timestamp.
           @return True if so.
       */
       Boolean isTimeStamp() const;
   
   #endif /* PEGASUS_USE_EXPERIMENTAL_INTERFACES */
   
     /** Compares the CIMDateTime object to another CIMDateTime object for     /** Compares the CIMDateTime object to another CIMDateTime object for
         equality.         equality.
         @param x  CIMDateTime object to be compared.         @param x  CIMDateTime object to be compared.
Line 238 
Line 356 
  
     /** Adds two CIMDateTime objects and returns a CIMDateTime object that     /** Adds two CIMDateTime objects and returns a CIMDateTime object that
         represents the sum.         represents the sum.
         @param cDT operand on the RHS of the operator          @param x operand on the RHS of the operator
         @return A CIMDateTime object that is the result of adding the calling         @return A CIMDateTime object that is the result of adding the calling
         object to the RHS operand         object to the RHS operand
         @exception DateTimeOutOfRangeException If the operation causes an         @exception DateTimeOutOfRangeException If the operation causes an
Line 246 
Line 364 
         @exception TypeMismatchException If the operands are not type         @exception TypeMismatchException If the operands are not type
         compatible (see table of operations).         compatible (see table of operations).
     */     */
     CIMDateTime operator+(const CIMDateTime& cDT) const;      CIMDateTime operator+(const CIMDateTime& x) const;
  
     /** Adds two CIMDateTime objects, returns the sum and changes     /** Adds two CIMDateTime objects, returns the sum and changes
         the value of the calling CIMDateTime object to match the return value.         the value of the calling CIMDateTime object to match the return value.
         @param cDT operand on the RHS of the operator          @param x operand on the RHS of the operator
         @return A CIMDateTime object that is the result of adding the calling         @return A CIMDateTime object that is the result of adding the calling
         object to the RHS operand         object to the RHS operand
         @exception DateTimeOutOfRangeException If the operation causes an         @exception DateTimeOutOfRangeException If the operation causes an
Line 258 
Line 376 
         @exception TypeMismatchException If the operands are not type         @exception TypeMismatchException If the operands are not type
         compatible (see table of operations).         compatible (see table of operations).
     */     */
     CIMDateTime & operator+=(const CIMDateTime& cDT);      CIMDateTime & operator+=(const CIMDateTime& x);
  
     /** Subtracts one CIMDateTime object from another and returns a     /** Subtracts one CIMDateTime object from another and returns a
         CIMDateTime object that represents the difference.         CIMDateTime object that represents the difference.
         @param cDT operand on the RHS of the operator          @param x operand on the RHS of the operator
         @return A CIMDateTime object that is the result of subtracting the         @return A CIMDateTime object that is the result of subtracting the
         the RHS object from the calling.         the RHS object from the calling.
         @exception DateTimeOutOfRangeException If the operation causes an         @exception DateTimeOutOfRangeException If the operation causes an
Line 271 
Line 389 
         @exception TypeMismatchException If the operands are not type         @exception TypeMismatchException If the operands are not type
         compatible (see table of operations).         compatible (see table of operations).
     */     */
     CIMDateTime operator-(const CIMDateTime& cDT) const;      CIMDateTime operator-(const CIMDateTime& x) const;
  
     /** Subtracts one CIMDateTime object from another, returns the difference     /** Subtracts one CIMDateTime object from another, returns the difference
         and changes the value of the calling CIMDateTime object to match the         and changes the value of the calling CIMDateTime object to match the
         return value.         return value.
         @param cDT operand on the RHS of the operator          @param x operand on the RHS of the operator
         @return A CIMDateTime object that is the result of subtracting the         @return A CIMDateTime object that is the result of subtracting the
         object on the RHS from the calling object.         object on the RHS from the calling object.
         @exception DateTimeOutOfRangeException If the operation causes an         @exception DateTimeOutOfRangeException If the operation causes an
Line 285 
Line 403 
         @exception TypeMismatchException If the operands are not type         @exception TypeMismatchException If the operands are not type
         compatible (see table of operations).         compatible (see table of operations).
     */     */
     CIMDateTime & operator-=(const CIMDateTime& cDT);      CIMDateTime & operator-=(const CIMDateTime& x);
  
     /** Multiplies a CIMDateTime object by an integer and returns a CIMDateTime     /** Multiplies a CIMDateTime object by an integer and returns a CIMDateTime
         object that represents the product.         object that represents the product.
Line 297 
Line 415 
         @exception TypeMismatchException If the operands are not type         @exception TypeMismatchException If the operands are not type
         compatible (see table of operations).         compatible (see table of operations).
     */     */
     CIMDateTime operator*(Uint64 num) const;      CIMDateTime operator*(Uint64 x) const;
  
     /** Multiplies a CIMDateTime object by an integer, returns the product     /** Multiplies a CIMDateTime object by an integer, returns the product
         and changes the value of the calling object to match the returned         and changes the value of the calling object to match the returned
Line 310 
Line 428 
         @exception TypeMismatchException If the operands are not type         @exception TypeMismatchException If the operands are not type
         compatible (see table of operations).         compatible (see table of operations).
     */     */
     CIMDateTime & operator*=(Uint64 num);      CIMDateTime & operator*=(Uint64 x);
  
     /** Divides a CIMDateTime object by an integer and returns a CIMDateTime     /** Divides a CIMDateTime object by an integer and returns a CIMDateTime
         object that represents the quotient.         object that represents the quotient.
Line 355 
Line 473 
  
     /** Compare two CIMDateTime objects and returns true if the LHS is     /** Compare two CIMDateTime objects and returns true if the LHS is
         less than the RHS.         less than the RHS.
         @param cDT operand on the RHS of the operator          @param x operand on the RHS of the operator
         @return true if the LHS is less than the RHS, false otherwise.         @return true if the LHS is less than the RHS, false otherwise.
         @exception DateTimeOutOfRangeException If conversion to UTC (an         @exception DateTimeOutOfRangeException If conversion to UTC (an
         internal operation) causes an overflow condition.         internal operation) causes an overflow condition.
         @exception TypeMismatchException if operands are not of the same         @exception TypeMismatchException if operands are not of the same
         type.         type.
      */      */
     Boolean operator<(const CIMDateTime& cDT) const;      Boolean operator<(const CIMDateTime& x) const;
  
     /** Compare two CIMDateTime objects and returns true if the LHS is     /** Compare two CIMDateTime objects and returns true if the LHS is
         less than or equal to the RHS.         less than or equal to the RHS.
         @param cDT operand on the RHS of the operator          @param x operand on the RHS of the operator
         @return true if the LHS is less than or equal to the RHS, false         @return true if the LHS is less than or equal to the RHS, false
         otherwise.         otherwise.
         @exception DateTimeOutOfRangeException If conversion to UTC (an         @exception DateTimeOutOfRangeException If conversion to UTC (an
Line 374 
Line 492 
         @exception TypeMismatchException if operands are not of the same         @exception TypeMismatchException if operands are not of the same
         type.         type.
     */     */
     Boolean operator<=(const CIMDateTime& cDT) const;      Boolean operator<=(const CIMDateTime& x) const;
  
     /** Compare two CIMDateTime objects and returns true if the LHS is     /** Compare two CIMDateTime objects and returns true if the LHS is
         greater than the RHS.         greater than the RHS.
         @param cDT operand on the RHS of the operator          @param x operand on the RHS of the operator
         @return true if the LHS is greater than the RHS, false otherwise.         @return true if the LHS is greater than the RHS, false otherwise.
         @exception DateTimeOutOfRangeException If conversion to UTC (an         @exception DateTimeOutOfRangeException If conversion to UTC (an
         internal operation) causes an overflow condition.         internal operation) causes an overflow condition.
         @exception TypeMismatchException if operands are not of the same         @exception TypeMismatchException if operands are not of the same
         type.         type.
     */     */
     Boolean operator>(const CIMDateTime & cDT) const;      Boolean operator>(const CIMDateTime & x) const;
  
     /** Compare two CIMDateTime objects and returns true if the LHS is     /** Compare two CIMDateTime objects and returns true if the LHS is
         greater than or equal to the RHS.         greater than or equal to the RHS.
         @param cDT operand on the RHS of the operator          @param x operand on the RHS of the operator
         @return true if the LHS is greater than or equal to the RHS, false         @return true if the LHS is greater than or equal to the RHS, false
         otherwise.         otherwise.
         @exception DateTimeOutOfRangeException If conversion to UTC (an         @exception DateTimeOutOfRangeException If conversion to UTC (an
Line 397 
Line 515 
         @exception TypeMismatchException if operands are not of the same         @exception TypeMismatchException if operands are not of the same
         type.         type.
     */     */
     Boolean operator>=(const CIMDateTime & cDT) const;      Boolean operator>=(const CIMDateTime & x) const;
  
     /** Compare two CIMDateTime objects and returns true if the LHS is     /** Compare two CIMDateTime objects and returns true if the LHS is
         not equal to the RHS.         not equal to the RHS.
         @param cDT operand on the RHS of the operator          @param x operand on the RHS of the operator
         @return true if the LHS is not equal to RHS, false otherwise.         @return true if the LHS is not equal to RHS, false otherwise.
         @exception DateTimeOutOfRangeException If conversion to UTC (an         @exception DateTimeOutOfRangeException If conversion to UTC (an
         internal operation) causes an overflow condition.         internal operation) causes an overflow condition.
         @exception TypeMismatchException if operands are not of the same         @exception TypeMismatchException if operands are not of the same
         type.         type.
     */     */
     Boolean operator!=(const CIMDateTime & cDT) const;      Boolean operator!=(const CIMDateTime & x) const;
  
 private: private:
   
     CIMDateTimeRep* _rep;     CIMDateTimeRep* _rep;
     Boolean _set(const String & dateTimeStr);      CIMDateTime(CIMDateTimeRep*);
     enum Field {ONLY_WILD_CARDS, SOME_WILD_CARDS, ONLY_DIGITS, ERR};  
   
     Field fieldcheck(const String & in_p, String & rep_field);  
   
     Boolean restOfFields(Uint32 start_position,const String & inStr);  
   
     Uint64 _toMicroSeconds();  
   
     void convertToUTC();  
   
     void setUtcOffSet(Sint32 utc);  
   
     void insert_WildCard(Uint32 index);  
   
     Uint32 getHighestWildCardPosition(const CIMDateTime & cDT_s);  
 }; };
  
 /** Compares two CIMDateTime objects and returns true if they represent the /** Compares two CIMDateTime objects and returns true if they represent the
Line 446 
Line 548 
 # include <Pegasus/Common/ArrayInter.h> # include <Pegasus/Common/ArrayInter.h>
 #undef PEGASUS_ARRAY_T #undef PEGASUS_ARRAY_T
  
   
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END
  
 #endif /* Pegasus_DateTime_h */  #endif /* Pegasus_CIMDateTime_h */


Legend:
Removed from v.1.48.10.1  
changed lines
  Added in v.1.52

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2