本文整理汇总了C++中Student::firstName方法的典型用法代码示例。如果您正苦于以下问题:C++ Student::firstName方法的具体用法?C++ Student::firstName怎么用?C++ Student::firstName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Student
的用法示例。
在下文中一共展示了Student::firstName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saveStudents
void XmlDataPersistance::saveStudents()
{
QFile file(studentsFilePath_);
if(!file.open(QIODevice::ReadWrite|QIODevice::Truncate))
{
//throw UTProfilerException("Failed to open " + fileName + " in UVManager::save.");
qDebug() << "Failed to open " << uvsFilePath_ << " in save";
return;
}
QDomDocument dom;
dom.setContent(&file);
QDomElement students = dom.createElement("etudiants");
dom.appendChild(students);
// Students
for(int i = 0; i < students_.size(); i++)
{
Student* student = students_.at(i);
QDomElement studentElement = dom.createElement("etudiant");
QDomElement login = dom.createElement("login");
login.appendChild(dom.createTextNode(student->login()));
studentElement.appendChild(login);
QDomElement prenom = dom.createElement("prenom");
prenom.appendChild(dom.createTextNode(student->firstName()));
studentElement.appendChild(prenom);
QDomElement nom = dom.createElement("nom");
nom.appendChild(dom.createTextNode(student->lastName()));
studentElement.appendChild(nom);
// Degrees
for (int i = 0; i < student->degrees().size(); i++)
{
QDomElement degree = dom.createElement("cursus");
degree.appendChild(dom.createTextNode(student->degrees()[i]->title()));
studentElement.appendChild(degree);
}
// Semesters
for (int i = 0; i < student->semesters().size(); i++)
{
QDomElement semester = dom.createElement("semestre");
QDomElement title = dom.createElement("titre");
title.appendChild(dom.createTextNode(student->semesters()[i]->title()));
semester.appendChild(title);
// Uvs
QMapIterator<QString, Grade> it(student->semesters()[i]->uvs());
while (it.hasNext()) {
it.next();
QDomElement uv = dom.createElement("uv");
QDomElement code = dom.createElement("code");
code.appendChild(dom.createTextNode(it.key()));
uv.appendChild(code);
QDomElement grade = dom.createElement("note");
grade.appendChild(dom.createTextNode(Uv::gradeToString(it.value())));
uv.appendChild(grade);
semester.appendChild(uv);
}
studentElement.appendChild(semester);
}
// Equivalences
QMapIterator<QString,unsigned int> it(student->equivalences());
while(it.hasNext())
{
it.next();
QDomElement eqElem = dom.createElement("equivalence");
eqElem.setAttribute("categorie",it.key());
eqElem.appendChild(dom.createTextNode(QString::number(it.value())));
studentElement.appendChild(eqElem);
}
// Previsions
for (int i = 0; i < student->exp().size(); i++)
{
QDomElement exp = dom.createElement("prevision");
QDomElement name = dom.createElement("nom");
name.appendChild(dom.createTextNode(student->exp().at(i)->name()));
exp.appendChild(name);
for (int j = 0; j < student->exp().at(i)->degrees().size(); j++)
{
QDomElement degree = dom.createElement("cursus");
degree.appendChild(dom.createTextNode(student->exp().at(i)->degrees().at(j)->title()));
exp.appendChild(degree);
}
for (int j = 0; j < student->exp().at(i)->rejectedUvs().size(); j++)
//.........这里部分代码省略.........