Skip to content

Commit e95597d

Browse files
committed
Init
1 parent fce27ec commit e95597d

22 files changed

+1429
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
wsjcpp-print-tree
2+
.wsjcpp/*
3+
tmp/*
4+
.logs/*
5+
16
# Prerequisites
27
*.d
38

.travis.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
language: cpp
2+
3+
branches:
4+
only:
5+
- master
6+
7+
dist: bionic
8+
9+
addons:
10+
apt:
11+
packages:
12+
- cmake
13+
- make
14+
- g++
15+
- pkg-config
16+
17+
# Build steps
18+
script:
19+
- ./build_simple.sh
20+
- cd unit-tests.wsjcpp
21+
- ./build_simple.sh
22+
- ./unit-tests

CMakeLists.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
cmake_minimum_required(VERSION 3.0)
2+
3+
project(wsjcpp-print-tree)
4+
5+
include(${CMAKE_CURRENT_SOURCE_DIR}/src.wsjcpp/CMakeLists.txt)
6+
7+
set(CMAKE_CXX_STANDARD 11)
8+
set(EXECUTABLE_OUTPUT_PATH ${wsjcpp-print-tree_SOURCE_DIR})
9+
10+
# Sources
11+
12+
# include header dirs
13+
list (APPEND WSJCPP_INCLUDE_DIRS "src")
14+
15+
list (APPEND WSJCPP_SOURCES "src/main.cpp")
16+
list (APPEND WSJCPP_SOURCES "src/wsjcpp_print_tree.h")
17+
list (APPEND WSJCPP_SOURCES "src/wsjcpp_print_tree.cpp")
18+
19+
include_directories(${WSJCPP_INCLUDE_DIRS})
20+
21+
add_executable (wsjcpp-print-tree ${WSJCPP_SOURCES})
22+
23+
target_link_libraries(wsjcpp-print-tree ${WSJCPP_LIBRARIES} )
24+
25+
install(
26+
TARGETS
27+
wsjcpp-print-tree
28+
RUNTIME DESTINATION
29+
/usr/bin
30+
)

README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,54 @@
11
# wsjcpp-print-tree
2+
3+
[![Build Status](https://api.travis-ci.org/wsjcpp/wsjcpp-print-tree.svg?branch=master)](https://travis-ci.org/wsjcpp/wsjcpp-print-tree) [![Github Stars](https://img.shields.io/github/stars/wsjcpp/wsjcpp-print-tree.svg?label=github%20%E2%98%85)](https://github.com/wsjcpp/wsjcpp-print-tree) [![Github Stars](https://img.shields.io/github/contributors/wsjcpp/wsjcpp-print-tree.svg)](https://github.com/wsjcpp/wsjcpp-print-tree) [![Github Forks](https://img.shields.io/github/forks/wsjcpp/wsjcpp-print-tree.svg?label=github%20forks)](https://github.com/wsjcpp/wsjcpp-print-tree/network/members)
4+
25
Helper class for print tree like a for filesystems
6+
7+
## How to integrate to your project
8+
9+
First way:
10+
11+
```
12+
wsjcpp install https://github.com/wsjcpp/wsjcpp-print-tree:master
13+
```
14+
15+
Second way integrate files:
16+
17+
* `src.wsjcpp/wsjcpp_core/wsjcpp_core.h`
18+
* `src.wsjcpp/wsjcpp_core/wsjcpp_core.cpp`
19+
* `wsjcpp_print_tree.h`
20+
* `wsjcpp_print_tree.cpp`
21+
22+
## Example of usage
23+
24+
```
25+
WSJCppPrintTree tree("Example Of Tree");
26+
tree
27+
.addChild("Hello1")
28+
.switchToLatestChild()
29+
.addChild("Hello2")
30+
.switchToLatestChild()
31+
.switchToParent()
32+
.addChild("Hello2")
33+
.switchToParent()
34+
.addChild("Hello3")
35+
.switchToLatestChild()
36+
.switchToParent()
37+
.addChild("Hello4") //
38+
.switchToLatestChild()
39+
.addChild("Hello123")
40+
.switchToParent()
41+
;
42+
std::cout << tree.printTree() << std::endl;
43+
```
44+
45+
Result will be like this:
46+
```
47+
Example Of Tree
48+
├─ Hello1
49+
│ ├─ Hello2
50+
│ └─ Hello2
51+
├─ Hello3
52+
└─ Hello4
53+
└─ Hello123
54+
```

build_simple.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
if [ ! -d tmp ]; then
4+
mkdir -p tmp
5+
fi
6+
7+
cd tmp
8+
cmake ..
9+
make

src.wsjcpp/.gitkeep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

src.wsjcpp/CMakeLists.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Automaticly generated by [email protected]
2+
cmake_minimum_required(VERSION 3.0)
3+
4+
add_definitions(-DWSJCPP_VERSION="v0.0.1")
5+
add_definitions(-DWSJCPP_NAME="wsjcpp-print-tree")
6+
7+
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
8+
set(MACOSX TRUE)
9+
endif()
10+
11+
set(CMAKE_CXX_STANDARD 11)
12+
13+
set (WSJCPP_LIBRARIES "")
14+
set (WSJCPP_INCLUDE_DIRS "")
15+
set (WSJCPP_SOURCES "")
16+
17+
# wsjcpp-core:v0.0.5
18+
list (APPEND WSJCPP_INCLUDE_DIRS "./src.wsjcpp/wsjcpp_core/")
19+
list (APPEND WSJCPP_SOURCES "./src.wsjcpp/wsjcpp_core/wsjcpp_core.cpp")
20+
list (APPEND WSJCPP_SOURCES "./src.wsjcpp/wsjcpp_core/wsjcpp_core.h")
21+
22+
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
wsjcpp_version: v0.0.1
2+
cmake_cxx_standard: 11
3+
cmake_minimum_required: 3.0
4+
5+
name: wsjcpp-core
6+
version: v0.0.5
7+
description: Basic Utils for wsjcpp
8+
issues: https://github.com/wsjcpp/wsjcpp-core/issues
9+
repositories:
10+
- type: main
11+
url: "https://github.com/wsjcpp/wsjcpp-core"
12+
keywords:
13+
- c++
14+
- wsjcpp
15+
16+
authors:
17+
- name: Evgenii Sopov
18+
19+
20+
required-libraries:
21+
- pthread
22+
23+
distribution:
24+
- source-file: src/wsjcpp_core.cpp
25+
target-file: wsjcpp_core.cpp
26+
sha1: "d892bfee196af88dcada57b39bc6bd65ce2ce075"
27+
type: "source-code"
28+
- source-file: src/wsjcpp_core.h
29+
target-file: wsjcpp_core.h
30+
sha1: "8f5e7b7ada06814ed123a08e49acffe2e12d398a"
31+
type: "source-code" # todo must be header-file
32+
- source-file: "src/wsjcpp_unit_tests.cpp"
33+
target-file: "wsjcpp_unit_tests.cpp"
34+
type: "unit-tests"
35+
sha1: "4208e039ec2923636655b3ada79ec223cca7bae2"
36+
- source-file: "src/wsjcpp_unit_tests.h"
37+
target-file: "wsjcpp_unit_tests.h"
38+
type: "unit-tests"
39+
sha1: "8d2ec886f23161a639bb2419bb5e4af48278f18b"
40+
- source-file: "src/wsjcpp_unit_tests_main.cpp"
41+
target-file: "wsjcpp_unit_tests_main.cpp"
42+
type: "unit-tests"
43+
sha1: "2c02fb58f51687eeac2076096b7df698cc246c9d"
44+
45+
unit-tests:
46+
cases:
47+
- name: CoreNormalizePath
48+
description: Check function normalizePath
49+
- name: CoreUuid
50+
description: Check test generate uuid function
51+
- name: CoreExtractFilename
52+
description: Check function extract filenane from path
53+
- name: "ToUpper"
54+
description: "String to upper"
55+
- name: "CreateUuid"
56+
description: "Test generation uuids"

0 commit comments

Comments
 (0)