Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 33 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ In main() you need to init logger first.

int main(int argc, char* argv[]) {
std::string TAG = "MAIN";
if (!WsjcppCore::dirExists(".logs")) {
WsjcppCore::makeDir(".logs");
}
WsjcppLog::setLogDirectory(".logs");
WsjcppLog::setPrefixLogFile("app");

// disable log file
// WsjcppLog::setEnableLogFile(false);
// ...
return 0;
}
Expand Down Expand Up @@ -207,6 +205,14 @@ if (WsjcppCore::removeFile("./file.txt")) {
}
```

### copyFile

```
if (WsjcppCore::copyFile("./file.txt", "./file1.txt")) {
std::cout << "File copied!" << std::endl;
}
```

### createEmptyFile

Creating empty file. Will return true if file not exists and do created
Expand Down Expand Up @@ -391,4 +397,27 @@ std::cout << "Size: " << sResult << std::endl;
Example output:
```
Size: 12K
```

### recoursiveCopyFiles

Recoursive copy files
*If target folders does not exists then it will be created*

```
if (WsjcppCore::recoursiveCopyFiles("./folder1", "./folder2")) {
// everything ok
}
```


### recoursiveRemoveDir

Recoursive remove dir (+ subdirs) and files
*Please will be careful*

```
if (WsjcppCore::recoursiveRemoveDir("./folder2")) {
// everything removed
}
```
6 changes: 3 additions & 3 deletions src.wsjcpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Automaticly generated by wsjcpp@v0.0.1
# Automaticly generated by wsjcpp@v0.1.5
cmake_minimum_required(VERSION 3.0)

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

if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(MACOSX TRUE)
Expand Down
18 changes: 11 additions & 7 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@

int main(int argc, char* argv[]) {
const std::string TAG = "MAIN";
std::string appName = std::string(WSJCPP_NAME);
std::string appVersion = std::string(WSJCPP_VERSION);
std::string appName = std::string(WSJCPP_APP_NAME);
std::string appVersion = std::string(WSJCPP_APP_VERSION);

if (!WsjcppCore::dirExists(".logs")) {
WsjcppCore::makeDir(".logs");
}
// WsjcppLog::setEnableLogFile(false);
WsjcppLog::setLogDirectory(".logs");
WsjcppLog::setPrefixLogFile("wsjcpp_core");

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

WsjcppCore::init(
argc, argv,
std::string(WSJCPP_NAME),
std::string(WSJCPP_VERSION),
std::string(WSJCPP_APP_NAME),
std::string(WSJCPP_APP_VERSION),
"Evgenii Sopov",
""
);
if (WsjcppCore::dirExists("./tmp2")) {
WsjcppCore::recoursiveRemoveDir("./tmp2");
}
WsjcppCore::recoursiveCopyFiles("./tmp", "./tmp2");
WsjcppCore::recoursiveRemoveDir("./tmp2");

return 0;
}
Loading