-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileManager.h
More file actions
22 lines (21 loc) · 812 Bytes
/
Copy pathFileManager.h
File metadata and controls
22 lines (21 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef FILEMANAGER_H
#define FILEMANAGER_H
#include <QString>
#include "Computer_Classroom.h"
#include "loginmanager.h"
class FileManager {
public:
FileManager();
// 从 CSV 文件导入机房信息
void importDataFromCSV(ComputerClassroom& classroom, const QString& filePath);
// 将机房信息写入 CSV 文件
void exportDataToCSV(const ComputerClassroom& classroom, const QString& filePath);
// 从 CSV 文件导入账号信息
void importAccountsFromCSV(LoginManager* loginManager, const QString& filePath);
private:
// 辅助函数:将字符串转换为 Computer_type 枚举值
Computer_type stringToComputerType(const QString& str);
QString computerTypeToString(Computer_type type);
QString escapeCsvField(const QString& field);
};
#endif // FILEMANAGER_H