本文整理汇总了C++中Ztring::Date_From_Seconds_1970方法的典型用法代码示例。如果您正苦于以下问题:C++ Ztring::Date_From_Seconds_1970方法的具体用法?C++ Ztring::Date_From_Seconds_1970怎么用?C++ Ztring::Date_From_Seconds_1970使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ztring
的用法示例。
在下文中一共展示了Ztring::Date_From_Seconds_1970方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Modified_Get
//---------------------------------------------------------------------------
Ztring File::Modified_Get()
{
#ifdef ZENLIB_USEWX
if (File_Handle==NULL)
#else //ZENLIB_USEWX
#ifdef ZENLIB_STANDARD
if (File_Handle==NULL)
#elif defined WINDOWS
if (File_Handle==NULL)
#endif
#endif //ZENLIB_USEWX
return Ztring();
#ifdef ZENLIB_USEWX
return Ztring(); //Not implemented
#else //ZENLIB_USEWX
#ifdef ZENLIB_STANDARD
struct stat Stat;
int Result=stat(File_Name.To_Local().c_str(), &Stat);
if (Result<0)
return Ztring(); //Error
Ztring Time; Time.Date_From_Seconds_1970(Stat.st_mtime);
return Time;
#elif defined WINDOWS
FILETIME TimeFT;
if (GetFileTime(File_Handle, NULL, NULL, &TimeFT))
{
int64u Time64=0x100000000ULL*TimeFT.dwHighDateTime+TimeFT.dwLowDateTime;
Ztring Time; Time.Date_From_Milliseconds_1601(Time64/10000);
return Time;
}
else
return Ztring(); //There was a problem
#endif
#endif //ZENLIB_USEWX
}
示例2: Transform
//---------------------------------------------------------------------------
Ztring Export_PBCore::Transform(MediaInfo_Internal &MI)
{
//Current date/time is ISO format
time_t Time=time(NULL);
Ztring TimeS; TimeS.Date_From_Seconds_1970((int32u)Time);
TimeS.FindAndReplace(__T("UTC "), __T(""));
TimeS.FindAndReplace(__T(" "), __T("T"));
TimeS+=__T('Z');
Ztring ToReturn;
ToReturn+=__T("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
ToReturn+=__T("<PBCoreDescriptionDocument xsi:schemaLocation=\"http://www.pbcore.org/PBCore/PBCoreNamespace.html http://www.pbcore.org/PBCore/PBCoreXSD_Ver_1-2-1.xsd\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://www.pbcore.org/PBCore/PBCoreNamespace.html\">\n");
ToReturn+=__T("\t<!-- Generated at ")+TimeS+__T(" by ")+MediaInfoLib::Config.Info_Version_Get()+__T(" -->\n");
ToReturn+=__T("\t<!-- Warning: MediaInfo outputs only pbcoreInstantiation, other mandatory PBCore data is junk -->\n");
ToReturn+=__T("\t<pbcoreIdentifier>\n");
ToReturn+=__T("\t\t<identifier>***</identifier>\n");
ToReturn+=__T("\t\t<identifierSource>***</identifierSource>\n");
ToReturn+=__T("\t</pbcoreIdentifier>\n");
ToReturn+=__T("\t<pbcoreTitle>\n");
ToReturn+=__T("\t\t<title>***</title>\n");
ToReturn+=__T("\t</pbcoreTitle>\n");
ToReturn+=__T("\t<pbcoreDescription>\n");
ToReturn+=__T("\t\t<description>***</description>\n");
ToReturn+=__T("\t\t<descriptionType>***</descriptionType>\n");
ToReturn+=__T("\t</pbcoreDescription>\n");
ToReturn+=__T("\t<pbcoreInstantiation>\n");
//pbcoreFormatID
ToReturn+=__T("\t\t<pbcoreFormatID>\n");
//formatIdentifier
ToReturn+=__T("\t\t\t<formatIdentifier>")+MI.Get(Stream_General, 0, General_FileName)+__T("</formatIdentifier>\n");
//formatIdentifierSource
ToReturn+=__T("\t\t\t<formatIdentifierSource version=\"PBCoreXSD_Ver_1.2_D1\">File Name</formatIdentifierSource>\n");
ToReturn+=__T("\t\t</pbcoreFormatID>\n");
//formatDigital
if (!MI.Get(Stream_General, 0, General_InternetMediaType).empty())
{
ToReturn+=__T("\t\t<formatDigital>");
ToReturn+=MI.Get(Stream_General, 0, General_InternetMediaType);
ToReturn+=__T("</formatDigital>\n");
}
else
{
//TODO: how to implement formats without Media Type?
ToReturn+=__T("\t\t<formatDigital>");
if (MI.Count_Get(Stream_Video))
ToReturn+=__T("video/x-");
else if (MI.Count_Get(Stream_Image))
ToReturn+=__T("image/x-");
else if (MI.Count_Get(Stream_Audio))
ToReturn+=__T("audio/x-");
else
ToReturn+=__T("application/x-");
ToReturn+=Ztring(MI.Get(Stream_General, 0, __T("Format"))).MakeLowerCase();
ToReturn+=__T("</formatDigital>\n");
}
//formatLocation
ToReturn+=__T("\t\t<formatLocation>")+MI.Get(Stream_General, 0, General_CompleteName)+__T("</formatLocation>\n");
//dateCreated
if (!MI.Get(Stream_General, 0, General_Encoded_Date).empty())
{
Ztring dateCreated=MI.Get(Stream_General, 0, General_Recorded_Date);
dateCreated.FindAndReplace(__T("UTC"), __T("-"));
dateCreated.FindAndReplace(__T(" "), __T("T"));
dateCreated+=__T('Z');
ToReturn+=__T("\t\t<dateCreated>")+dateCreated+__T("</dateCreated>\n");
}
//dateIssued
if (!MI.Get(Stream_General, 0, General_Recorded_Date).empty())
{
Ztring dateIssued=MI.Get(Stream_General, 0, General_Recorded_Date);
dateIssued.FindAndReplace(__T("UTC"), __T("-"));
dateIssued.FindAndReplace(__T(" "), __T("T"));
dateIssued+=__T('Z');
ToReturn+=__T("\t\t<dateIssued>")+dateIssued+__T("</dateIssued>\n");
}
//formatMediaType
if (!PBCore_MediaType(MI).empty())
ToReturn+=__T("\t\t<formatMediaType version=\"PBCoreXSD_Ver_1.2_D1\">")+PBCore_MediaType(MI)+__T("</formatMediaType>\n");
else
ToReturn+=__T("\t\t<formatMediaType version=\"PBCoreXSD_Ver_1.2_D1\">application/octet-stream</formatMediaType>\n");
//formatGenerations
ToReturn+=__T("\t\t<formatGenerations version=\"PBCoreXSD_Ver_1.2_D1\" />\n");
//formatFileSize
if (!MI.Get(Stream_General, 0, General_FileSize).empty())
ToReturn+=__T("\t\t<formatFileSize>")+MI.Get(Stream_General, 0, General_FileSize)+__T("</formatFileSize>\n");
//formatTimeStart
if (!MI.Get(Stream_Video, 0, Video_Delay_Original_String3).empty())
ToReturn+=__T("\t\t<formatTimeStart>")+MI.Get(Stream_Video, 0, Video_Delay_Original_String3)+__T("</formatTimeStart>\n");
else if (!MI.Get(Stream_Video, 0, Video_Delay_String3).empty())
//.........这里部分代码省略.........