sub:添加自动补全文件路径库。

This commit is contained in:
taynpg 2025-01-09 16:50:11 +08:00
parent 444db54ce8
commit de4437a7ca
7 changed files with 16 additions and 8 deletions

3
.gitmodules vendored
View File

@ -1,3 +1,6 @@
[submodule "ofen"]
path = ofen
url = https://www.sinxmiao.cn/taynpg/ofen
[submodule "filecomplete"]
path = filecomplete
url = https://www.sinxmiao.cn/taynpg/filecomplete

View File

@ -21,7 +21,7 @@
],
"visualizerFile": "${workspaceRoot}/.vscode/qt5.natvis",
"args": [
"-n", "0"
"-n", "2"
]
},
"cmake.environment": {
@ -145,5 +145,6 @@
"text_encoding": "cpp",
"*.in": "cpp"
},
"makefile.configureOnOpen": false
"makefile.configureOnOpen": false,
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools"
}

View File

@ -30,6 +30,7 @@ add_subdirectory(net)
add_subdirectory(util)
add_subdirectory(server)
add_subdirectory(client)
add_subdirectory(filecomplete)
string(TIMESTAMP VERSION_BUILD_DATE "%Y-%m-%d %H:%M")
execute_process(

View File

@ -8,7 +8,7 @@ if (MSVC)
endif()
add_executable(tsc main.cpp client.h client.cpp config.h config.cpp)
target_link_libraries(tsc PRIVATE trans_net trans_util)
target_link_libraries(tsc PRIVATE trans_net trans_util filecomplete)
if (UNIX)
target_link_libraries(tsc PRIVATE pthread)
endif()

View File

@ -67,16 +67,17 @@ void CClient::run(const std::string& ip, const std::string& port)
delete bf;
logger_->warn("SupportCmd:Get|Up|Down|Cancel|Update");
char line[512]{};
while (std::cin.getline(line, 512)) {
fc_append('|');
while (1) {
char* readline = fc_readline();
if (!th_run_) {
break;
}
std::string cmd_input(line);
std::string cmd_input(readline);
fc_free(readline);
std::cout << "" << std::endl;
cmd_input = ofen::COfStr::trim(cmd_input);
if (cmd_input == "end") {
th_run_ = false;
std::this_thread::sleep_for(std::chrono::milliseconds(10));

View File

@ -7,6 +7,7 @@
#include <string>
#include <util.h>
#include <vector>
#include <filecomplete.h>
using namespace ofen;
struct DownClientInfo {

1
filecomplete Submodule

@ -0,0 +1 @@
Subproject commit bbd0d6a2471443e7d019f65207a072c1294b6fd7