version 1.52, 2005/03/09 00:55:23
|
version 1.53, 2005/03/24 20:03:49
|
|
|
#include <errno.h> | #include <errno.h> |
#include "CIMDateTime.h" | #include "CIMDateTime.h" |
#include "InternalException.h" | #include "InternalException.h" |
|
#include <Pegasus/Common/AutoPtr.h> |
#include <Pegasus/Common/Tracer.h> | #include <Pegasus/Common/Tracer.h> |
#include <Pegasus/Common/MessageLoader.h> //l10n | #include <Pegasus/Common/MessageLoader.h> //l10n |
#include <cassert> | #include <cassert> |
|
|
CIMDateTime::CIMDateTime() | CIMDateTime::CIMDateTime() |
{ | { |
_rep = new CIMDateTimeRep(); | _rep = new CIMDateTimeRep(); |
|
AutoPtr<CIMDateTimeRep> rep(_rep); |
|
|
clear(); | clear(); |
|
|
|
rep.release(); |
} | } |
| |
/*Takes properly formated string and creates a CIMDateTime out of it | /*Takes properly formated string and creates a CIMDateTime out of it |
|
|
CIMDateTime::CIMDateTime(const String & str) | CIMDateTime::CIMDateTime(const String & str) |
{ | { |
_rep = new CIMDateTimeRep(); | _rep = new CIMDateTimeRep(); |
|
AutoPtr<CIMDateTimeRep> rep(_rep); |
|
|
if (!_set(str)) | if (!_set(str)) |
{ | { |
delete _rep; |
|
throw InvalidDateTimeFormatException(); | throw InvalidDateTimeFormatException(); |
} | } |
| |
|
rep.release(); |
} | } |
| |
/*Copy constructor | /*Copy constructor |
|
|
CIMDateTime::CIMDateTime(const CIMDateTime& x) | CIMDateTime::CIMDateTime(const CIMDateTime& x) |
{ | { |
_rep = new CIMDateTimeRep(); | _rep = new CIMDateTimeRep(); |
|
AutoPtr<CIMDateTimeRep> rep(_rep); |
|
|
_rep->copy(x._rep); | _rep->copy(x._rep); |
|
|
|
rep.release(); |
} | } |
| |
/*constructs a CIMDateTime object from micro second value. | /*constructs a CIMDateTime object from micro second value. |
|
|
//cout << "when at the end of constructor that takes Uint64 created string is " << final << endl << endl; | //cout << "when at the end of constructor that takes Uint64 created string is " << final << endl << endl; |
| |
_rep = new CIMDateTimeRep(); | _rep = new CIMDateTimeRep(); |
|
AutoPtr<CIMDateTimeRep> rep(_rep); |
|
|
if (!_set(final)) { | if (!_set(final)) { |
delete _rep; |
|
Tracer::trace(__FILE__,__LINE__,TRC_CIM_DATA,Tracer::LEVEL2, | Tracer::trace(__FILE__,__LINE__,TRC_CIM_DATA,Tracer::LEVEL2, |
"CIMDateTime::CIMDateTime(Uint64 microSec, Boolean interval) failed"); | "CIMDateTime::CIMDateTime(Uint64 microSec, Boolean interval) failed"); |
throw InvalidDateTimeFormatException(); //can't pass message to this exceptions | throw InvalidDateTimeFormatException(); //can't pass message to this exceptions |
} | } |
| |
|
rep.release(); |
} | } |
| |
| |