Actualiser db.h
This commit is contained in:
22
db.h
22
db.h
@@ -3,30 +3,14 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "user.h"
|
|
||||||
|
|
||||||
struct Student {
|
struct Student {
|
||||||
int id;
|
|
||||||
std::string nom;
|
std::string nom;
|
||||||
int notes[3];
|
int notes[3];
|
||||||
};
|
};
|
||||||
|
|
||||||
// --- Connexion et fermeture ---
|
// Export / Import
|
||||||
bool openDB(const std::string& filename);
|
bool exportData(const std::string& filename, const std::vector<Student>& students);
|
||||||
void closeDB();
|
bool importData(const std::string& filename, std::vector<Student>& students);
|
||||||
|
|
||||||
// --- Authentification ---
|
|
||||||
int loginUser(const std::string& login, const std::string& password);
|
|
||||||
|
|
||||||
// --- Étudiants ---
|
|
||||||
std::vector<Student> getAllStudents(); // ADMIN/PROF
|
|
||||||
Student getStudentByLogin(const std::string& login); // STUDENT
|
|
||||||
|
|
||||||
// --- Notes ---
|
|
||||||
bool updateNote(int studentId, int noteIndex, int newNote);
|
|
||||||
|
|
||||||
// --- Export / Import ---
|
|
||||||
bool exportData(const std::string& filename, const std::string& role, const std::string& login);
|
|
||||||
bool importData(const std::string& filename, const std::string& role);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Reference in New Issue
Block a user