Repository navigation
Expand file tree
/
Copy pathdebughelper.cpp
More file actions
97 lines (82 loc) · 2.93 KB
/
Copy pathdebughelper.cpp
File metadata and controls
97 lines (82 loc) · 2.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// ============================================================
// debughelper.cpp
// دوال التصحيح (Debug) - تنسيق Terminal
// ============================================================
#include "debughelper.h"
#include <QFileInfo>
#include <QDebug>
// ============================================================
// دوال Debug الأساسية
// ============================================================
void debugFunctionStart(const QString &functionName)
{
qDebug() << "========================================";
qDebug() << "[START] " << functionName;
qDebug() << "========================================";
}
void debugFunctionEnd(const QString &functionName)
{
qDebug() << "========================================";
qDebug() << "[END] " << functionName;
qDebug() << "========================================";
}
void debugVariable(const QString &varName, const QString &value)
{
qDebug() << "[VAR] " << varName << " = " << value;
}
void debugFileList(const QString &label, const QStringList &files)
{
qDebug() << "[LIST] " << label << " (" << files.size() << " files):";
for (int i = 0; i < files.size(); ++i) {
qDebug() << " [" << i << "] " << files[i];
}
}
void debugError(const QString &errorMessage)
{
qDebug() << "[ERROR] " << errorMessage;
}
// ============================================================
// دوال معلومات الملف
// ============================================================
void debugFileInfo(const QString &filePath)
{
QFileInfo info(filePath);
qDebug() << "[FILE] Path: " << filePath;
qDebug() << "[FILE] Exists: " << (info.exists() ? "Yes" : "No");
qDebug() << "[FILE] Size: " << info.size() << " bytes";
qDebug() << "[FILE] Suffix: " << info.suffix();
qDebug() << "[FILE] Readable: " << (info.isReadable() ? "Yes" : "No");
}
// ============================================================
// دوال خاصة بـ QuaZIP
// ============================================================
void debugQuaZipResult(const QString &operation, bool success, const QString &details)
{
if (success) {
qDebug() << "[QUAZIP] " << operation << " SUCCESS"
<< (details.isEmpty() ? "" : " | " + details);
} else {
qDebug() << "[QUAZIP] " << operation << " FAILED"
<< (details.isEmpty() ? "" : " | " + details);
}
}
void debugExtractFile(const QString &fileName, bool success)
{
if (success) {
qDebug() << " [OK] " << fileName;
} else {
qDebug() << " [FAIL] " << fileName;
}
}
void debugQuaZipTestStart()
{
qDebug() << "========================================";
qDebug() << "[QUAZIP TEST] START";
qDebug() << "========================================";
}
void debugQuaZipTestEnd()
{
qDebug() << "========================================";
qDebug() << "[QUAZIP TEST] END";
qDebug() << "========================================";
}