Skip to content

Commit 0927041

Browse files
committed
ref: 优化头文件导入顺序
1 parent c8729d6 commit 0927041

16 files changed

Lines changed: 19 additions & 22 deletions

common.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#pragma once
22

3-
#include "resource.h"
43

54
// 计划任务的任务路径
65
constexpr auto TASK_SCHED_ROOT = L"\\";

date.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "common.h"
1+
22
#include "date.h"
33

44
namespace Date {

date.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#pragma once
2-
#include "common.h"
3-
#include "chrono"
2+
#include <chrono>
43

54
namespace Date {
65
constexpr auto TIME_FORMAT = L"%H:%M:%S";

digital_font.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "common.h"
1+
22
#include <gdiplus.h>
33
#include <array>
44
#include "gdi_obj.h"

font.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#include "common.h"
2-
#include <tchar.h>
1+
32
#include "font.h"
43
#include "gdi_obj.h"
54

font.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#pragma once
22

3-
#include "common.h"
43

54
constexpr auto FONT_FAMILY = L"Arial";
65

gdi_obj.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#pragma once
2-
#include "common.h"
32

43
// 自动包装GDI对象,在对象生命周期结束时自动释放
54
namespace IGDI {

setting_window.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "common.h"
22
#include "setting_window.h"
3+
#include "resource.h"
34

45
static LRESULT CALLBACK settingWndProc(
56
_In_ HWND hWnd,

simple_xml.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
#include "simple_xml.h"
66

7+
#include <fstream>
8+
#include <sstream>
9+
10+
711
BOOL HasUtf8Bom(const std::string_view str)
812
{
913
return str.size() >= 3 &&
@@ -19,7 +23,7 @@ std::wstring UTF82UTF16(const std::string& str)
1923
return L"";
2024
}
2125

22-
auto size_needed = MultiByteToWideChar(CP_UTF8, 0, str.data(), str.size(), nullptr, 0);
26+
size_t size_needed = MultiByteToWideChar(CP_UTF8, 0, str.data(), str.size(), nullptr, 0);
2327

2428
if (size_needed <= 0)
2529
{

simple_xml.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// Created by kms on 2025/9/11.
33
//
44

5-
#include <fstream>
6-
#include <sstream>
7-
85
using std::wstring;
96

107
class CSimpleXML

0 commit comments

Comments
 (0)