Skip to content

Commit 32fe601

Browse files
committed
Init
1 parent 5fcac72 commit 32fe601

21 files changed

+1490
-0
lines changed

.travis.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
- cd unit-tests.wsjcpp
20+
- ./build_simple.sh
21+
- ./unit-tests

.wsjcpp/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
logs/*
2+
cache/*

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,40 @@
11
# wsjcpp-validators
22
Classes for data validation
3+
4+
## Integrate to your project
5+
6+
Just include this files:
7+
8+
- src/wsjcpp_validators.h
9+
- src/wsjcpp_validators.cpp
10+
11+
## Integrate via wsjcpp
12+
13+
```
14+
$ wsjcpp install https://github.com/wsjcpp/wsjcpp-validators:master
15+
```
16+
17+
## Example usage
18+
19+
``` cpp
20+
WJSCppValidatorUUID *pValidatorUUID = new WJSCppValidatorUUID();
21+
std::string sError = "";
22+
if (!pValidatorUUID->isValid("abcdef01-ABCD-EF23-1000-000000000001", sError)) {
23+
std::cout << sError << std::endl;
24+
}
25+
```
26+
27+
## Example for yuor implementations
28+
29+
```
30+
class WJSCppValidatorUUID : public WJSCppValidatorStringRegexpBase {
31+
public:
32+
WJSCppValidatorUUID()
33+
: WJSCppValidatorStringRegexpBase(
34+
"uuid", // name
35+
"^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$"
36+
) {
37+
TAG = "WJSCppValidatorUUID";
38+
}
39+
};
40+
```

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: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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-validators")
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+
# required-libraries
23+
list (APPEND WSJCPP_LIBRARIES "-lpthread")
24+
25+
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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: IpV4
54+
description: Check function isIPv4
55+
- name: IpV6
56+
description: Check function isIPv6
57+
- name: "ToUpper"
58+
description: "String to upper"
59+
- name: "CreateUuid"
60+
description: "Test generation uuids"

0 commit comments

Comments
 (0)