Skip to content

Commit 45afdb5

Browse files
committedSep 10, 2020
Prepare version 0.0.1
1 parent 11db891 commit 45afdb5

18 files changed

+986
-6
lines changed
 

‎.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
.wsjcpp/*
22
tmp/*
3+
wsjcpp-obj-tree
4+
.logs/*
5+
.vscode/*
36

47
# Prerequisites
58
*.d

‎.travis.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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
23+

‎CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ set(EXECUTABLE_OUTPUT_PATH ${wsjcpp-obj-tree_SOURCE_DIR})
1010
# include header dirs
1111
list (APPEND WSJCPP_INCLUDE_DIRS "src")
1212

13+
list (APPEND WSJCPP_SOURCES "./src/wsjcpp_obj_tree.h")
14+
list (APPEND WSJCPP_SOURCES "./src/wsjcpp_obj_tree.cpp")
1315
list (APPEND WSJCPP_SOURCES "src/main.cpp")
1416

1517
#### BEGIN_WSJCPP_APPEND
@@ -28,3 +30,4 @@ install(
2830
/usr/bin
2931
)
3032

33+

‎README.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
# wsjcpp-obj-tree
2+
[![Build Status](https://api.travis-ci.com/wsjcpp/wsjcpp-obj-tree.svg?branch=master)](https://travis-ci.com/wsjcpp/wsjcpp-obj-tree)
3+
24
Multi Object Tree
5+

‎src.wsjcpp/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
cmake_minimum_required(VERSION 3.0)
33

44
add_definitions(-DWSJCPP_APP_VERSION="v0.0.1")
5-
add_definitions(-DWSJCPP_APP_NAME="wsjcpp-obj-tree.git")
5+
add_definitions(-DWSJCPP_APP_NAME="wsjcpp-obj-tree")
66

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

‎src/main.cpp

+32-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
#include <string.h>
1+
#include <string>
22
#include <iostream>
33
#include <algorithm>
44
#include <wsjcpp_core.h>
5+
#include <wsjcpp_obj_tree.h>
56

67
int main(int argc, const char* argv[]) {
78
std::string TAG = "MAIN";
@@ -12,7 +13,36 @@ int main(int argc, const char* argv[]) {
1213
}
1314
WsjcppLog::setPrefixLogFile("wsjcpp");
1415
WsjcppLog::setLogDirectory(".logs");
15-
// TODO your code here
16+
17+
WsjcppObjTree tree;
18+
tree.addSupportType<WsjcppObjTreeNodeString>();
19+
tree.addSupportType<WsjcppObjTreeNodeInteger>();
20+
tree.addSupportType<WsjcppObjTreeNodeFloat>();
21+
tree.addSupportType<WsjcppObjTreeNodeDouble>();
22+
23+
WsjcppObjTreeChainDeclare chain(&tree);
24+
25+
chain
26+
.add("Motherboard")
27+
.add("CPU_SOCKET")
28+
.add("count")
29+
.add(1).up()
30+
.up()
31+
.add("frequency")
32+
.add(3.2).up()
33+
.up()
34+
.add("GPU_SOCKET")
35+
.add(1).up()
36+
.add("USB-A")
37+
.add(4).up()
38+
.add("PCI")
39+
.add(3).up()
40+
.add("PCI_EXPRESS")
41+
.add(1).up()
42+
.up()
43+
.up()
44+
;
45+
1646
return 0;
1747
}
1848

0 commit comments

Comments
 (0)
Please sign in to comment.