示例#1
0
pCourse oEvent::getCourseCreate(int Id)
{
  oCourseList::iterator it;
  for (it=Courses.begin(); it != Courses.end(); ++it) {
    if (it->Id==Id)
      return &*it;
  }
  if (Id>0) {
    oCourse c(this, Id);
    c.setName(getAutoCourseName());
    return addCourse(c);
  }
  else {
    return addCourse(getAutoCourseName());
  }
}
示例#2
0
void ValidMessage::checkForCourse(std::string course)
{
    std::string courseCmpr;
    std::string messageCmpr;

    std::transform(message.begin(), message.end(), std::back_inserter(messageCmpr), ::toupper);
    std::transform(course.begin(), course.end(), std::back_inserter(courseCmpr), ::toupper);
    std::size_t found = messageCmpr.find(courseCmpr);
    if (found != std::string::npos)
    {
        this->course = true;
        addCourse(course);
    }
    else
    {
        this->course = false;
    }
}