示例#1
0
string ICitationBase::GetParenthesizedYear(const CDate& date)
{
    if (date.IsStd()) {
        string year;
        date.GetDate(&year, "(%4Y)");
        return year;
    } else if (date.IsStr()  &&  HasText(date.GetStr())
               &&  date.GetStr() != "?") {
        return '(' + date.GetStr().substr(0, 4) + ')';
    } else {
        return kEmptyStr;
    }
}
示例#2
0
文件: Date.cpp 项目: swuecho/igblast
CDate::ECompare CDate::Compare(const CDate& date) const
{
    if (IsStd()  &&  date.IsStd() ) {
        return GetStd().Compare(date.GetStd());
    } else if (IsStr()  &&  date.IsStr()  &&  GetStr() == date.GetStr()) {
        return eCompare_same;
    } else {
        return eCompare_unknown;
    }
}