Skip to content

Commit b445f0c

Browse files
authored
Merge pull request #34 from wsjcpp/version-0.2.2
Version 0.2.2
2 parents 8cf7f98 + dd9b0a7 commit b445f0c

16 files changed

+398
-120
lines changed

.travis.yml

+2-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ branches:
44
only:
55
- master
66

7-
dist: bionic
7+
dist: focal
88

99
addons:
1010
apt:
@@ -16,10 +16,4 @@ addons:
1616

1717
# Build steps
1818
script:
19-
- mkdir -p tmp
20-
- cd tmp
21-
- cmake ..
22-
- make
23-
- cd ../unit-tests.wsjcpp
24-
- ./build_simple.sh
25-
- ./run_unit-tests.sh
19+
- ./ci/travis/run.sh

CHANGELOG.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Changelog
2+
3+
All notable changes to wsjcpp-core project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](http://keepachangelog.com/)
6+
and this project adheres to [Semantic Versioning](http://semver.org/).
7+
8+
## [v0.2.2] - 2021-09-04 (2021 Sept 4)
9+
10+
### Added
11+
12+
- Added test for normalize path
13+
- Added test case for replace all
14+
- Added build_simple.bat for windows
15+
- Added WsjcppCore::makeDirsPath
16+
- Added WsjcppCore::extractDirpath
17+
18+
### Changed
19+
20+
- Up c++ to version 17 (need for std::filesystem)
21+
- Redesign getListOfDisrs to using crossplatform std::filesystem
22+
23+
### Fixed
24+
25+
- Fixed setFilePermissions

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/src.wsjcpp/CMakeLists.txt)
77
#### BEGIN_WSJCPP_APPEND
88
#### END_WSJCPP_APPEND
99

10-
set(CMAKE_CXX_STANDARD 11)
10+
set(CMAKE_CXX_STANDARD 17)
1111
set(EXECUTABLE_OUTPUT_PATH ${wsjcpp-core_SOURCE_DIR})
1212

1313
# Sources

README.md

+23-1
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,21 @@ std::string sPath = WsjcppCore::doNormalizePath(".//../bin/some/../");
8484
Extract base filename from fullpath.
8585

8686
```
87-
std::string sFilename = WsjcppCore::doNormalizePath(".//../bin/some/../file.txt");
87+
std::string sFilename = WsjcppCore::extractFilename(".//../bin/some/../file.txt");
8888
```
8989

90+
Variable `sFilename` will has value `file.txt`
91+
92+
### extractDirpath
93+
94+
Extract base dir path from fullpath.
95+
96+
```
97+
std::string sDirpath = WsjcppCore::extractDirpath(".//../bin/some/../file.txt");
98+
```
99+
100+
Variable `sDirpath` will has value `.//../bin/some/..`
101+
90102
### getCurrentDirectory
91103

92104
```
@@ -181,6 +193,16 @@ if (WsjcppCore::makeDir(sDirname)) {
181193
}
182194
```
183195

196+
### makeDirsPath
197+
198+
Create a new directories full path
199+
```
200+
std::string sDirsPath = "./data/dir1/dir1/dir3";
201+
if (WsjcppCore::makeDirsPath(sDirname)) {
202+
std::cout << " Created '" << sDirsPath << "'" << std::endl;
203+
}
204+
```
205+
184206
### writeFile
185207

186208
```

build_simple.bat

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@echo off
2+
3+
endlocal
4+
setlocal
5+
6+
echo Prepare configuration
7+
cmake -H. -Btmp
8+
if %ERRORLEVEL% GEQ 1 (
9+
echo "cmake configure"
10+
EXIT /B 1
11+
)
12+
13+
cmake --build tmp
14+
if %ERRORLEVEL% GEQ 1 (
15+
echo "cmake build"
16+
EXIT /B 1
17+
)
18+
19+
endlocal

ci/travis/run.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
check_ret() {
4+
if [ $1 -ne 0 ]; then
5+
echo ""
6+
echo "!!! FAIL: $2"
7+
echo "********************************************************************************"
8+
echo ""
9+
exit $1
10+
else
11+
echo ""
12+
echo "*** SUCCESS: $2"
13+
echo "********************************************************************************"
14+
echo ""
15+
fi
16+
}
17+
18+
rm -rf tmp
19+
./build_simple.sh
20+
check_ret $? "build"
21+
22+
cd ./unit-tests.wsjcpp
23+
rm -rf tmp
24+
check_ret $? "cd tests"
25+
./build_simple.sh
26+
check_ret $? "build tests"
27+
./run_unit-tests.sh
28+
check_ret $? "run unit-tests"

src.wsjcpp/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
88
set(MACOSX TRUE)
99
endif()
1010

11-
set(CMAKE_CXX_STANDARD 11)
11+
set(CMAKE_CXX_STANDARD 17)
1212

1313
set (WSJCPP_LIBRARIES "")
1414
set (WSJCPP_INCLUDE_DIRS "")

0 commit comments

Comments
 (0)