-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwin.cpp
More file actions
117 lines (108 loc) · 4.96 KB
/
win.cpp
File metadata and controls
117 lines (108 loc) · 4.96 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#include "stdafx.h"
namespace local {
Win::Win() {
}
Win::~Win() {
}
bool Win::PacketMade(const unsigned long long& cmd, const std::string& input, std::string& output) const {
return shared::Win::Packet::Made(cmd, input, output);
}
size_t Win::PacketUnMade(std::string& input, std::vector<std::string>& output_s, const bool& fixed_buffer /*= true*/) const {
return shared::Win::Packet::UnMade(input, output_s, fixed_buffer);
}
bool Win::IsX64(const std::string& pebuffer) const {
return shared::Win::PE::IsX64(pebuffer);
}
bool Win::IsPEDLL(const std::string& pebuffer) const {
return shared::Win::PE::IsDLL(pebuffer);
}
bool Win::IsPEEXE(const std::string& pebuffer) const {
return shared::Win::PE::IsEXE(pebuffer);
}
void Win::FindFileAssignPath(
const std::string& path,
const std::vector<std::string>& ffname_s,
tfEnumFolderNode& found_s) const {
return shared::Win::FindFileAssignPath(path, ffname_s, found_s);
}
void Win::FindFileAssignPathOnce(
const std::string& path,
const std::vector<std::string>& ffname_s,
tfEnumFolderNode& found_s) const {
return shared::Win::FindFileAssignPathOnce(path, ffname_s, found_s);
}
void Win::EnumFolder(const std::string& Path,
tfEnumFolderNode& Folders,
tfEnumFolderNode& Files,
const char* FileFilter /*= "*.*"*/,
bool bSleepDirect /*= false*/,
const tfEnumFolderCb& enumcb /*= nullptr*/) const {
return shared::Win::EnumFolder(Path, Folders, Files, FileFilter, bSleepDirect, enumcb);
}
void Win::ParseCommandLineParameters(const std::string& commandline, const std::function<void(const std::map<std::string, std::string>&)>& out_cb) const {
std::map<std::string, std::string> outs;
shared::Win::ParseCommandLineParameters(commandline, outs);
if (out_cb)
out_cb(outs);
}
bool Win::ProcessCreateA(const std::string& exePathname,
const std::string& commandline,
const std::function<void(const HANDLE&, const DWORD&)> create_process_cb,
const bool& Inheriting_parent_process /*= false*/,
const bool& isShow /*= false*/,
const DWORD& wait_time /*= 0*/) const {
return shared::Win::Process::CreateA(exePathname, commandline, create_process_cb, Inheriting_parent_process, isShow, wait_time);
}
bool Win::CreateDirectoryA(const std::string& path) const {
return shared::Win::CreateDirectoryA(path);
}
void Win::GetSpecialFolderLocationA(const tf_api_result_std_string_cb& rescb, const int& csidl) const {
const std::string res = shared::Win::GetSpecialFolderLocationA(csidl);
rescb(res);
}
void Win::GetModulePathnameA(const tf_api_result_std_string_cb& rescb, const HINSTANCE& hModule /*= nullptr*/) const {
const std::string res = shared::Win::GetModulePathnameA(hModule);
rescb(res);
}
void Win::GetModulePathA(const tf_api_result_std_string_cb& rescb, const HINSTANCE& hModule /*= nullptr*/) const {
const auto res = shared::Win::GetModulePathA(hModule);
rescb(res);
}
void Win::RealtimeSpeed(const tf_api_result_std_string_cb& rescb, const long long& speed_bype_size, const bool& divide /*= true*/) const {
const auto res = shared::Win::RealtimeSpeed(speed_bype_size, divide);
rescb(res);
}
void Win::TimePeriodUnMade(const tf_api_result_std_string_cb& rescb, const UINT& TimePeriod) const {
const auto res = shared::Win::Time::TimePeriodUnMade(TimePeriod);
rescb(res);
}
bool Win::AccessA(const std::string& path) const {
return shared::Win::AccessA(path);
}
bool Win::GetFileNameAndFormat(const std::string& pathname, std::string& out_name, std::string& out_format) const {
return shared::Win::GetFileNameAndFormat(pathname, out_name, out_format);
}
void Win::GetNameByPathnameA(const tf_api_result_std_string_cb& rescb, const std::string& pathname) const {
const auto res = shared::Win::GetNameByPathnameA(pathname);
rescb(res);
}
void Win::GetPathByPathnameA(const tf_api_result_std_string_cb& rescb, const std::string& pathname) const {
const auto res = shared::Win::GetPathByPathnameA(pathname);
rescb(res);
}
void Win::PathFixedA(const tf_api_result_std_string_cb& rescb, const std::string& PathOrPathname) const {
const auto res = shared::Win::PathFixedA(PathOrPathname);
rescb(res);
}
void Win::ReadFile(const tf_api_result_std_string_cb& rescb, const std::string& FilePathname, const int& OpenMode /*= std::ios::_Nocreate | std::ios::_Noreplace | std::ios::binary*/) const {
const auto res = shared::Win::File::Read(FilePathname, OpenMode);
rescb(res);
}
bool Win::WriteFile(const std::string& FilePathname, const std::string& WriteData, const int& OpenMode /*= std::ios::binary | std::ios::out | std::ios::trunc*/) const {
return shared::Win::File::Write(FilePathname, WriteData, OpenMode);
}
void Win::ReadAssignSize(const tf_api_result_std_string_cb& rescb, const std::string& FilePathname, const size_t& assign_size, const int& OpenMode /*= std::ios::_Nocreate | std::ios::_Noreplace | std::ios::binary*/) const {
const auto res = shared::Win::File::ReadAssignSize(FilePathname, assign_size, OpenMode);
rescb(res);
}
}///namespace lcoal