本文整理汇总了C++中Course::getDepartment方法的典型用法代码示例。如果您正苦于以下问题:C++ Course::getDepartment方法的具体用法?C++ Course::getDepartment怎么用?C++ Course::getDepartment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Course
的用法示例。
在下文中一共展示了Course::getDepartment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: f
void UnitTests::TestID_3()
{
// OK Test
Course c;
QFile f("course/datastructures.csv");
if(f.open(QIODevice::ReadOnly)){
while(!f.atEnd()){
QString line = f.readLine();
//cout << line.toStdString() << endl;
c = LoadCourse(line);
}
}
f.close();
QVector<QString> prereqs = c.getPrerequisites();
QCOMPARE(c.getDepartment(),QString("CS"));
QCOMPARE(c.getNumber(),153);
QCOMPARE(c.getName(),QString("Data Structures"));
QCOMPARE(c.getHours(),3);
QCOMPARE(c.getSemester(),QString("FS"));
QCOMPARE(c.getIsRequired(),true);
QCOMPARE(prereqs.size(),1);
QCOMPARE(prereqs.at(0),QString("CS53"));
}
示例2: fill
bool CourseFiller::fill(CourseStore* store){
CourseStoreDB db("104.236.4.226", "/lookup/CS", "7819");
std::string* jsonString = db.getJson();
rapidjson::Document doc;
doc.Parse(jsonString->c_str());
for (rapidjson::SizeType i = 0; i < doc.Size(); i++){
Course* course = CourseFiller::buildCourse(doc[i]);
std::string name = course->getDepartment() + course->getCourseNumber();
course->getCombos();
store->insert(name, course);
}
delete jsonString;
return true;
}