Skip to content

Commit c168b40

Browse files
authored
Merge pull request #12 from wsjcpp/version-0.1.6
Version 0.1.6
2 parents d7dc252 + bb8faf7 commit c168b40

17 files changed

+293
-108
lines changed

README.md

+33-4
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,10 @@ In main() you need to init logger first.
3232
3333
int main(int argc, char* argv[]) {
3434
std::string TAG = "MAIN";
35-
if (!WsjcppCore::dirExists(".logs")) {
36-
WsjcppCore::makeDir(".logs");
37-
}
3835
WsjcppLog::setLogDirectory(".logs");
3936
WsjcppLog::setPrefixLogFile("app");
40-
37+
// disable log file
38+
// WsjcppLog::setEnableLogFile(false);
4139
// ...
4240
return 0;
4341
}
@@ -207,6 +205,14 @@ if (WsjcppCore::removeFile("./file.txt")) {
207205
}
208206
```
209207

208+
### copyFile
209+
210+
```
211+
if (WsjcppCore::copyFile("./file.txt", "./file1.txt")) {
212+
std::cout << "File copied!" << std::endl;
213+
}
214+
```
215+
210216
### createEmptyFile
211217

212218
Creating empty file. Will return true if file not exists and do created
@@ -391,4 +397,27 @@ std::cout << "Size: " << sResult << std::endl;
391397
Example output:
392398
```
393399
Size: 12K
400+
```
401+
402+
### recoursiveCopyFiles
403+
404+
Recoursive copy files
405+
*If target folders does not exists then it will be created*
406+
407+
```
408+
if (WsjcppCore::recoursiveCopyFiles("./folder1", "./folder2")) {
409+
// everything ok
410+
}
411+
```
412+
413+
414+
### recoursiveRemoveDir
415+
416+
Recoursive remove dir (+ subdirs) and files
417+
*Please will be careful*
418+
419+
```
420+
if (WsjcppCore::recoursiveRemoveDir("./folder2")) {
421+
// everything removed
422+
}
394423
```

src.wsjcpp/CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Automaticly generated by wsjcpp@v0.0.1
1+
# Automaticly generated by wsjcpp@v0.1.5
22
cmake_minimum_required(VERSION 3.0)
33

4-
add_definitions(-DWSJCPP_VERSION="v0.1.4")
5-
add_definitions(-DWSJCPP_NAME="wsjcpp-core")
4+
add_definitions(-DWSJCPP_APP_VERSION="v0.1.6")
5+
add_definitions(-DWSJCPP_APP_NAME="wsjcpp-core")
66

77
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
88
set(MACOSX TRUE)

src/main.cpp

+11-7
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@
55

66
int main(int argc, char* argv[]) {
77
const std::string TAG = "MAIN";
8-
std::string appName = std::string(WSJCPP_NAME);
9-
std::string appVersion = std::string(WSJCPP_VERSION);
8+
std::string appName = std::string(WSJCPP_APP_NAME);
9+
std::string appVersion = std::string(WSJCPP_APP_VERSION);
1010

11-
if (!WsjcppCore::dirExists(".logs")) {
12-
WsjcppCore::makeDir(".logs");
13-
}
11+
// WsjcppLog::setEnableLogFile(false);
1412
WsjcppLog::setLogDirectory(".logs");
1513
WsjcppLog::setPrefixLogFile("wsjcpp_core");
1614

@@ -21,10 +19,16 @@ int main(int argc, char* argv[]) {
2119

2220
WsjcppCore::init(
2321
argc, argv,
24-
std::string(WSJCPP_NAME),
25-
std::string(WSJCPP_VERSION),
22+
std::string(WSJCPP_APP_NAME),
23+
std::string(WSJCPP_APP_VERSION),
2624
"Evgenii Sopov",
2725
""
2826
);
27+
if (WsjcppCore::dirExists("./tmp2")) {
28+
WsjcppCore::recoursiveRemoveDir("./tmp2");
29+
}
30+
WsjcppCore::recoursiveCopyFiles("./tmp", "./tmp2");
31+
WsjcppCore::recoursiveRemoveDir("./tmp2");
32+
2933
return 0;
3034
}

0 commit comments

Comments
 (0)