本文整理汇总了C++中poco::DateTime::makeUTC方法的典型用法代码示例。如果您正苦于以下问题:C++ DateTime::makeUTC方法的具体用法?C++ DateTime::makeUTC怎么用?C++ DateTime::makeUTC使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类poco::DateTime
的用法示例。
在下文中一共展示了DateTime::makeUTC方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: extractExifData
//.........这里部分代码省略.........
float decDegrees = getDecimalDegrees(tag_data);
char refValue[2];
if (it->first == EXIF_TAG_GPS_LATITUDE)
{
// Get the latitude reference value; used to determine if positive or negative decimal value
ExifEntry * latitudeRef = exif_data_get_entry(exifData, it->first);
exif_entry_get_value(latitudeRef, refValue,2);
if (strcmp(refValue, "S") == 0)
decDegrees *= -1;
}
else
{
// Get the longitude reference value; used to determine if positive or negative decimal value
ExifEntry * longitudeRef = exif_data_get_entry(exifData, it->first);
exif_entry_get_value(longitudeRef, refValue,2);
if (strcmp(refValue, "W") == 0)
decDegrees *= -1;
}
TskBlackboardAttribute attr(it->second, name(), "", decDegrees);
attrs.push_back(attr);
}
else if (it->first == EXIF_TAG_GPS_SPEED)
{
// Check for the EXIF_IFD_GPS image file directory to avoid interoperability value
ExifIfd ifd = exif_entry_get_ifd(exifEntry);
if (ifd != EXIF_IFD_GPS)
continue;
//Get the GPS speed value
exif_entry_get_value(exifEntry, tag_data, 256);
float speed = getGPSSpeed(tag_data);
char refValue[2];
//Get the GPS speed reference value
ExifEntry * speedRef = exif_data_get_entry(exifData, it->first);
exif_entry_get_value(speedRef, refValue,2);
//Convert Kilometers per hour to meters per second
if (strcmp(refValue, "K") == 0)
{
speed *= 0.277778;
}
//Convert Miles per hour to meters per second
if (strcmp(refValue, "M") == 0)
{
speed *= 0.44704;
}
//Convert Knots to meters per second
if (strcmp(refValue, "N") == 0)
{
speed *= 0.514444;
}
TskBlackboardAttribute attr(it->second, name(), "", speed);
attrs.push_back(attr);
}
else if (it->first == EXIF_TAG_DATE_TIME_ORIGINAL)
{
exif_entry_get_value(exifEntry, tag_data, 256);
datetime = std::string(tag_data);
}
else if(it->first == EXIF_TAG_TIME_ZONE_OFFSET){
exif_entry_get_value(exifEntry, tag_data, 256);
timezone = atoi(tag_data);
}
else
{
// Get the tag's data
exif_entry_get_value(exifEntry, tag_data, 256);
// Add tag data to blackboard
TskBlackboardAttribute attr(it->second, name(), "", tag_data);
attrs.push_back(attr);
}
}
if(!datetime.empty()){
Poco::DateTime parsedDT;
int tzd;
Poco::DateTimeParser::tryParse(datetime, parsedDT, tzd);
if(timezone)
parsedDT.makeUTC(timezone);
else
parsedDT.makeUTC(tzd);
TskBlackboardAttribute attr(TSK_DATETIME, name(), "", (uint64_t)parsedDT.utcTime());
attrs.push_back(attr);
}
if(attrs.size() > 0){
TskBlackboardArtifact art = pFile->createArtifact(TSK_METADATA_EXIF);
for(size_t i = 0; i < attrs.size(); i++){
art.addAttribute(attrs[i]);
}
}
}