//---------------------------------------- bool CUnit::HasDateRef(CDate* dateRef /*= NULL*/, CStringArray* array /*= NULL*/) const { if (!IsDate()) { return false; } CStringArray ar; ar.ExtractStrings(GetText().c_str(), ' '); size_t len = ar.size(); if (len <= 2) { return false; } int32_t index = ar.FindIndex("since"); if (index < 0) { return false; } CDate dateTmp; int32_t result = BRATHL_ERROR; std::string strDate; for (uint32_t i = index + 1 ; i < ar.size() ; i++) { strDate.append(ar.at(i)); strDate.append(" "); } strDate = CTools::StringTrim(strDate); result = dateTmp.SetDate(strDate.c_str()); if (result == BRATHL_SUCCESS) { if (dateRef != NULL) { *dateRef = dateTmp; } } if (array != NULL) { array->Insert(ar); } return (result == BRATHL_SUCCESS); }