font:字体更改。
This commit is contained in:
parent
b03401fd10
commit
55cf6eb471
@ -11,7 +11,7 @@ ReflowComments: true
|
||||
SpacesBeforeTrailingComments: 3
|
||||
TabWidth: 4
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||
ColumnLimit: 80
|
||||
ColumnLimit: 130
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
AllowShortEnumsOnASingleLine: false
|
||||
|
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -1,7 +1,8 @@
|
||||
{
|
||||
"files.autoSave": "onFocusChange",
|
||||
"editor.fontSize": 14,
|
||||
"editor.fontFamily": "'FiraCode Nerd Font Mono', 'FiraCode Nerd Font Mono', 'FiraCode Nerd Font Mono'",
|
||||
"editor.fontFamily": "'Monaspace Krypton Light', 'Monaspace Krypton Light', 'Monaspace Krypton Light'",
|
||||
"terminal.integrated.fontFamily": "Monaspace Krypton Light",
|
||||
"cmake.configureOnOpen": true,
|
||||
"cmake.debugConfig": {
|
||||
"console": "integratedTerminal",
|
||||
|
15
main.cpp
15
main.cpp
@ -1,8 +1,8 @@
|
||||
#include <algorithm>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
@ -22,14 +22,12 @@ namespace fs = std::filesystem;
|
||||
/// @brief
|
||||
/// @param source 原文件路径
|
||||
/// @param dest 目标目录,注意是目录,已存在则会被覆盖
|
||||
bool copy_file(const fs::path& source, const fs::path& dest,
|
||||
const std::string& spre = "", const std::string& safter = "")
|
||||
bool copy_file(const fs::path& source, const fs::path& dest, const std::string& spre = "", const std::string& safter = "")
|
||||
{
|
||||
try {
|
||||
if (spre.empty()) {
|
||||
std::string name = fs::path(source).filename().string();
|
||||
return fs::copy_file(source, fs::path(dest).append(name),
|
||||
fs::copy_options::overwrite_existing);
|
||||
return fs::copy_file(source, fs::path(dest).append(name), fs::copy_options::overwrite_existing);
|
||||
}
|
||||
// 读入文件
|
||||
std::ifstream file(source.string());
|
||||
@ -43,8 +41,7 @@ bool copy_file(const fs::path& source, const fs::path& dest,
|
||||
|
||||
// 替换
|
||||
std::size_t start_pos = 0;
|
||||
while ((start_pos = content.find(spre, start_pos)) !=
|
||||
std::string::npos) {
|
||||
while ((start_pos = content.find(spre, start_pos)) != std::string::npos) {
|
||||
content.replace(start_pos, spre.length(), safter);
|
||||
start_pos += safter.length();
|
||||
}
|
||||
@ -72,9 +69,7 @@ bool handle_work(const std::string& source_dir, const std::string& purpose)
|
||||
std::string project_name = fs::path(purpose).filename().string();
|
||||
std::cout << "工程名:" << project_name << std::endl;
|
||||
|
||||
auto cp = [&](const std::string& relative_path,
|
||||
const std::string& spre = "",
|
||||
const std::string& safter = "") -> bool {
|
||||
auto cp = [&](const std::string& relative_path, const std::string& spre = "", const std::string& safter = "") -> bool {
|
||||
fs::path fsource(source_dir);
|
||||
fsource.append(relative_path);
|
||||
return copy_file(fsource.string(), purpose, spre, safter);
|
||||
|
Loading…
x
Reference in New Issue
Block a user