This commit is contained in:
James 2020-03-07 13:43:39 +08:00
commit 2f5035a620
11 changed files with 187 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.bak

16
.vscode/c_cpp_properties.json vendored Normal file
View File

@ -0,0 +1,16 @@
{
"configurations": [
{
"name": "MinGW",
"intelliSenseMode": "gcc-x64",
"compilerPath": "${env:GCC_PATH}\\bin\\gcc.exe",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"cStandard": "c11",
"cppStandard": "c++17"
}
],
"version": 4
}

29
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,29 @@
{
// 使 IntelliSense
//
// 访: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Build and Debug",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "${env:GCC_PATH}/gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "Build"
}
]
}

26
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,26 @@
{
"files.associations": {
"*.tcc": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"exception": "cpp",
"initializer_list": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"new": "cpp",
"ostream": "cpp",
"streambuf": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp"
},
"terminal.integrated.automationShell.windows": "cmd.exe",
"files.encoding": "gb18030",
"files.autoGuessEncoding": false
}

52
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,52 @@
{
"tasks": [
{
"type": "shell",
"label": "Build",
"command": "${env:GCC_PATH}/g++.exe",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${env:GCC_PATH}"
},
"problemMatcher": {
"owner": "cpp",
"fileLocation": [
"relative",
"${workspaceRoot}"
],
//"fileLocation": "absolute",
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Build & run C++ project",
"type": "shell",
"group": {
"kind": "test",
"isDefault": true
},
"command": "${workspaceRoot}/run.bat",
"args": [
"${fileDirname}/${fileBasenameNoExtension}.exe"
],
"dependsOn":["Build"]
}
],
"version": "2.0.0"
}

3
Template/Readme.md Normal file
View File

@ -0,0 +1,3 @@
# 标题
* 内容

3
Template/doc/Readme.md Normal file
View File

@ -0,0 +1,3 @@
# 标题
* 内容

6
Template/main.cpp Normal file
View File

@ -0,0 +1,6 @@
#include <iostream>
int main()
{
std::cout << "Hello Easy C++ project!" << std::endl;
}

BIN
Template/main.exe Normal file

Binary file not shown.

0
Template/test/in.txt Normal file
View File

51
run.bat Normal file
View File

@ -0,0 +1,51 @@
@echo off
set t1=%time%
REM call:time_start
REM call:time_diff
call:Process %1
goto end
:Process
for %%a in ("%1") do (
set file_path=%%~dpa
)
echo %file_path%
cd . > %file_path%test\out.txt
for %%i in ( %file_path%test\in*.txt) do (
echo ## %%i >> %file_path%test\out.txt
echo %date% %time% >> %file_path%test\out.txt
call:time_start
%1 < %%i >> %file_path%test\out.txt
call:time_diff >> %file_path%test\out.txt
)
goto:eof
:time_start
set t1=%time%
goto:eof
:time_diff
set t2=%time%
set /a ms=1%t1:~9%*10 %% 1000
set /a sec=1%t1:~6,2% %% 100
set /a min=1%t1:~3,2% %% 100
set /a hour=%t1:~0,-9%
set /a time1 = %hour% * 3600000 + %min% * 60000 + %sec% * 1000 + %ms%
set /a ms=1%t2:~9%*10 %% 1000
set /a sec=1%t2:~6,2% %% 100
set /a min=1%t2:~3,2% %% 100
set /a hour=%t2:~0,-9%
set /a time2 = %hour% * 3600000 + %min% * 60000 + %sec% * 1000 + %ms%
set /a time_dif = %time2% - %time1%
echo;
echo -----------------------------------------------
echo Process exited after %time_dif% ms with return value %ErrorLevel%
goto:eof
:end
REM pause