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