version 1.61, 2005/05/04 21:38:32
|
version 1.62, 2005/05/24 20:57:58
|
|
|
return false; | return false; |
} | } |
| |
|
// the UTC must not have asterisks in it |
Uint32 spot = uOffSet.find("*"); | Uint32 spot = uOffSet.find("*"); |
if(spot != PEG_NOT_FOUND){ // the UTC must not have astricks in it |
if (spot != PEG_NOT_FOUND) |
|
{ |
Tracer::trace(__FILE__,__LINE__,TRC_CIM_DATA,Tracer::LEVEL2, | Tracer::trace(__FILE__,__LINE__,TRC_CIM_DATA,Tracer::LEVEL2, |
"'*' was found in the UTC offset this is not allowed"); | "'*' was found in the UTC offset this is not allowed"); |
return false; | return false; |
|
|
| |
| |
String uOff_num = uOffSet.subString(1,3); | String uOff_num = uOffSet.subString(1,3); |
for (int i=0; i < 3; i++) { |
for (int i=0; i < 3; i++) |
if (!isdigit(uOff_num[i])) { |
{ |
|
if (!isdigit(uOff_num[i])) |
|
{ |
Tracer::trace(__FILE__,__LINE__,TRC_CIM_DATA,Tracer::LEVEL2, | Tracer::trace(__FILE__,__LINE__,TRC_CIM_DATA,Tracer::LEVEL2, |
"Format is wrong - UTC off set contains non digit charichter."); |
"Format is wrong - UTC offset contains non digit character."); |
return false; | return false; |
} | } |
} | } |
| |
if (ch_one == (char)':' && !String::compare(uOff_num, "OOO")){ // intervals (:) must have 000 utc offset |
// intervals (:) must have 000 utc offset |
|
if ((ch_one == (char)':') && !String::equal(uOff_num, "000")) |
|
{ |
Tracer::trace(__FILE__,__LINE__,TRC_CIM_DATA,Tracer::LEVEL2, | Tracer::trace(__FILE__,__LINE__,TRC_CIM_DATA,Tracer::LEVEL2, |
"Trying to incorrectly set a intervals time zone"); | "Trying to incorrectly set a intervals time zone"); |
return false; | return false; |
|
|
set_data(uOffSet, 21, 4); // change _rep->data to reflect changes made | set_data(uOffSet, 21, 4); // change _rep->data to reflect changes made |
| |
return true; | return true; |
|
|
|
|
} | } |
| |
| |
|
|
// it must be one of ':' (interval), '+' (date), or '-' (date) | // it must be one of ':' (interval), '+' (date), or '-' (date) |
const Uint32 SIGN_OFFSET = 21; | const Uint32 SIGN_OFFSET = 21; |
const Uint32 DOT_OFFSET = 14; | const Uint32 DOT_OFFSET = 14; |
const String offS = dateTimeStr.subString(SIGN_OFFSET,4); |
Boolean isInterval = (dateTimeStr[SIGN_OFFSET] == ':'); |
Boolean isInterval = String::compare(offS, ":000") == 0; |
|
| |
if (!isInterval && dateTimeStr[SIGN_OFFSET] != '+' && dateTimeStr[SIGN_OFFSET] != '-'){ | if (!isInterval && dateTimeStr[SIGN_OFFSET] != '+' && dateTimeStr[SIGN_OFFSET] != '-'){ |
Tracer::trace(__FILE__,__LINE__,TRC_CIM_DATA,Tracer::LEVEL2, | Tracer::trace(__FILE__,__LINE__,TRC_CIM_DATA,Tracer::LEVEL2, |
|
|
// check to make sure UTC for Intervals it '000' | // check to make sure UTC for Intervals it '000' |
buffer = dateTimeStr.subString(21,4); | buffer = dateTimeStr.subString(21,4); |
_rep->utcOffSet = buffer; | _rep->utcOffSet = buffer; |
if ( !String::compare(_rep->utcOffSet, ":OOO")) { |
if (!String::equal(_rep->utcOffSet, ":000")) |
|
{ |
Tracer::trace(__FILE__,__LINE__,TRC_CIM_DATA,Tracer::LEVEL2, | Tracer::trace(__FILE__,__LINE__,TRC_CIM_DATA,Tracer::LEVEL2, |
"CIMDateTime - Format of the object is incorrect. Can not set the \ | "CIMDateTime - Format of the object is incorrect. Can not set the \ |
the UTC off set of an Interval"); | the UTC off set of an Interval"); |
|
|
Uint32 offSet = atol((utcOS).getCString()); | Uint32 offSet = atol((utcOS).getCString()); |
Uint64 offSet_hor = (offSet/60) * _ONE_HOUR; | Uint64 offSet_hor = (offSet/60) * _ONE_HOUR; |
Uint64 offSet_min = (offSet%60) * _ONE_MINUTE; | Uint64 offSet_min = (offSet%60) * _ONE_MINUTE; |
String mesO = "overflow has occured in nomalization"; |
String mesO = "overflow has occurred in normalization"; |
MessageLoaderParms parmsOv("Common.CIMDateTime.UTC_OVERFLOW", | MessageLoaderParms parmsOv("Common.CIMDateTime.UTC_OVERFLOW", |
"overflow has occured during conversion to UTC"); |
"overflow has occurred during conversion to UTC"); |
MessageLoaderParms parmsUn("Common.CIMDateTime.UTC_UNDERFLOW", | MessageLoaderParms parmsUn("Common.CIMDateTime.UTC_UNDERFLOW", |
"underflow has occured during conversion to UTC"); |
"underflow has occurred during conversion to UTC"); |
| |
char sign; // Get the sign and UTC offset. | char sign; // Get the sign and UTC offset. |
sign = _rep->data[21]; | sign = _rep->data[21]; |
|
|
} | } |
| |
MessageLoaderParms parmsOv("Common.CIMDateTime.UTC_OVERFLOW", | MessageLoaderParms parmsOv("Common.CIMDateTime.UTC_OVERFLOW", |
"overflow has occured durring convertion to UTC"); |
"overflow has occurred during conversion to UTC"); |
MessageLoaderParms parmsUn("Common.CIMDateTime.UTC_UNDERFLOW", | MessageLoaderParms parmsUn("Common.CIMDateTime.UTC_UNDERFLOW", |
"underflow has occured durring convertion to UTC"); |
"underflow has occurred during conversion to UTC"); |
| |
// convert CIMDateTime to microseconds. | // convert CIMDateTime to microseconds. |
Uint64 cdt_MicroSec = this->toMicroSeconds(); | Uint64 cdt_MicroSec = this->toMicroSeconds(); |