本文整理汇总了C++中CDateTime::GetAsSaveString方法的典型用法代码示例。如果您正苦于以下问题:C++ CDateTime::GetAsSaveString方法的具体用法?C++ CDateTime::GetAsSaveString怎么用?C++ CDateTime::GetAsSaveString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDateTime
的用法示例。
在下文中一共展示了CDateTime::GetAsSaveString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: strDirectoryN
CPVRRecordingsPath::CPVRRecordingsPath(bool bDeleted, bool bRadio,
const std::string &strDirectory, const std::string &strTitle,
int iSeason, int iEpisode, int iYear,
const std::string &strSubtitle, const std::string &strChannelName,
const CDateTime &recordingTime, const std::string &strId)
: m_bValid(true),
m_bRoot(false),
m_bActive(!bDeleted),
m_bRadio(bRadio)
{
std::string strDirectoryN(TrimSlashes(strDirectory));
if (!strDirectoryN.empty())
strDirectoryN = StringUtils::Format("%s/", strDirectoryN.c_str());
std::string strTitleN(strTitle);
StringUtils::Replace(strTitleN, '/', ' ');
std::string strSeasonEpisodeN;
if ((iSeason > -1 && iEpisode > -1 && (iSeason > 0 || iEpisode > 0)))
strSeasonEpisodeN = StringUtils::Format("s%02de%02d", iSeason, iEpisode);
if (!strSeasonEpisodeN.empty())
strSeasonEpisodeN = StringUtils::Format(" %s", strSeasonEpisodeN.c_str());
std::string strYearN(iYear > 0 ? StringUtils::Format(" (%i)", iYear) : "");
std::string strSubtitleN;
if (!strSubtitle.empty())
{
strSubtitleN = StringUtils::Format(" %s", strSubtitle.c_str());
StringUtils::Replace(strSubtitleN, '/', ' ');
}
std::string strChannelNameN;
if (!strChannelName.empty())
{
strChannelNameN = StringUtils::Format(" (%s)", strChannelName.c_str());
StringUtils::Replace(strChannelNameN, '/', ' ');
}
m_directoryPath = StringUtils::Format("%s%s%s%s%s",
strDirectoryN.c_str(), strTitleN.c_str(), strSeasonEpisodeN.c_str(),
strYearN.c_str(), strSubtitleN.c_str());
m_params = StringUtils::Format(", TV%s, %s, %s.pvr", strChannelNameN.c_str(), recordingTime.GetAsSaveString().c_str(), strId.c_str());
m_path = StringUtils::Format("pvr://recordings/%s/%s/%s%s", bRadio ? "radio" : "tv", bDeleted ? "deleted" : "active", m_directoryPath.c_str(), m_params.c_str());
}