Skip to content

Commit 92f00f9

Browse files
committed
Updated wsjcpp-core
1 parent 425c208 commit 92f00f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+693
-422
lines changed

README.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
# wsjcpp-validators
22

3-
[![Build Status](https://api.travis-ci.org/wsjcpp/wsjcpp-validators.svg?branch=master)](https://travis-ci.org/wsjcpp/wsjcpp-validators) [![Github Stars](https://img.shields.io/github/stars/wsjcpp/wsjcpp-validators.svg?label=github%20%E2%98%85)](https://github.com/wsjcpp/wsjcpp-validators/stargazers) [![Github Stars](https://img.shields.io/github/contributors/wsjcpp/wsjcpp-validators.svg)](https://github.com/wsjcpp/wsjcpp-validators/) [![Github Forks](https://img.shields.io/github/forks/wsjcpp/wsjcpp-validators.svg?label=github%20forks)](https://github.com/wsjcpp/wsjcpp-validators/network/members)
3+
[![Build Status](https://api.travis-ci.com/wsjcpp/wsjcpp-validators.svg?branch=master)](https://travis-ci.com/wsjcpp/wsjcpp-validators) [![Github Stars](https://img.shields.io/github/stars/wsjcpp/wsjcpp-validators.svg?label=github%20%E2%98%85)](https://github.com/wsjcpp/wsjcpp-validators/stargazers) [![Github Stars](https://img.shields.io/github/contributors/wsjcpp/wsjcpp-validators.svg)](https://github.com/wsjcpp/wsjcpp-validators/) [![Github Forks](https://img.shields.io/github/forks/wsjcpp/wsjcpp-validators.svg?label=github%20forks)](https://github.com/wsjcpp/wsjcpp-validators/network/members)
44

55
Classes for data validation
66

77
## Completed classes
88

9-
- `new WSJCppValidatorStringRegexpBase("testre", "^[a-zA-Z]+$")` - validate value by regular expression
10-
- `new WSJCppValidatorStringListBase("lang", {"en", "de", "ru"})` - validate value from a list
11-
- `new WSJCppValidatorEmail()` - validate format email
12-
- `new WSJCppValidatorUUID()` - validate format uuid
13-
- `new WSJCppValidatorStringLength(1,100)` - validate min length and max length
14-
- `new WSJCppValidatorJWT()` - validate format of JWT
15-
- `new WSJCppValidatorDate()` - validate format date like 'YYYY-MM-DD'
16-
- `new WSJCppValidatorTimeH24()` - validate format date like 'HH:mm:ss' (24 hours)
17-
- `new WSJCppValidatorDateTime()` - validate format date like 'YYYY-MM-DD\THH:mm:ss'
18-
- `new WSJCppValidatorURL()` - validate format of url
19-
- `new WSJCppValidatorBase64()` - validate format of base64
20-
- `new WSJCppValidatorNumber()` - validate format of number
21-
- `new WSJCppValidatorHex()` - validate hex value
9+
- `new WsjcppValidatorStringRegexpBase("testre", "^[a-zA-Z]+$")` - validate value by regular expression
10+
- `new WsjcppValidatorStringListBase("lang", {"en", "de", "ru"})` - validate value from a list
11+
- `new WsjcppValidatorEmail()` - validate format email
12+
- `new WsjcppValidatorUUID()` - validate format uuid
13+
- `new WsjcppValidatorStringLength(1,100)` - validate min length and max length
14+
- `new WsjcppValidatorJWT()` - validate format of JWT
15+
- `new WsjcppValidatorDate()` - validate format date like 'YYYY-MM-DD'
16+
- `new WsjcppValidatorTimeH24()` - validate format date like 'HH:mm:ss' (24 hours)
17+
- `new WsjcppValidatorDateTime()` - validate format date like 'YYYY-MM-DD\THH:mm:ss'
18+
- `new WsjcppValidatorURL()` - validate format of url
19+
- `new WsjcppValidatorBase64()` - validate format of base64
20+
- `new WsjcppValidatorNumber()` - validate format of number
21+
- `new WsjcppValidatorHex()` - validate hex value
2222

2323
## Completed static functions
2424

25-
- `WSJCppValidators::isValidDate(const std::string &sValue, std::string &sError)`
26-
- `WSJCppValidators::isValidTimeH24(const std::string &sValue, std::string &sError)`
27-
- `WSJCppValidators::isValidDomainName(const std::string &sValue, std::string &sError)`
28-
- `WSJCppValidators::isValidBase64(const std::string &sValue, std::string &sError)`
29-
- `WSJCppValidators::isValidIPv4(const std::string &sValue, std::string &sError)`
30-
- `WSJCppValidators::isValidIPv6(const std::string &sValue, std::string &sError)`
25+
- `WsjcppValidators::isValidDate(const std::string &sValue, std::string &sError)`
26+
- `WsjcppValidators::isValidTimeH24(const std::string &sValue, std::string &sError)`
27+
- `WsjcppValidators::isValidDomainName(const std::string &sValue, std::string &sError)`
28+
- `WsjcppValidators::isValidBase64(const std::string &sValue, std::string &sError)`
29+
- `WsjcppValidators::isValidIPv4(const std::string &sValue, std::string &sError)`
30+
- `WsjcppValidators::isValidIPv6(const std::string &sValue, std::string &sError)`
3131

3232
## Integrate to your project
3333

@@ -46,7 +46,7 @@ $ wsjcpp install https://github.com/wsjcpp/wsjcpp-validators:master
4646

4747
``` cpp
4848

49-
WSJCppValidatorUUID *pValidatorUUID = new WSJCppValidatorUUID();
49+
WsjcppValidatorUUID *pValidatorUUID = new WsjcppValidatorUUID();
5050
std::string sError = "";
5151
if (!pValidatorUUID->isValid("abcdef01-ABCD-EF23-1000-000000000001", sError)) {
5252
std::cout << sError << std::endl;
@@ -56,14 +56,14 @@ if (!pValidatorUUID->isValid("abcdef01-ABCD-EF23-1000-000000000001", sError)) {
5656
## Example for your implementations
5757
5858
``` cpp
59-
class WSJCppValidatorUUID : public WSJCppValidatorStringRegexpBase {
59+
class WsjcppValidatorUUID : public WsjcppValidatorStringRegexpBase {
6060
public:
61-
WSJCppValidatorUUID()
62-
: WSJCppValidatorStringRegexpBase(
61+
WsjcppValidatorUUID()
62+
: WsjcppValidatorStringRegexpBase(
6363
"uuid", // name
6464
"^[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}$"
6565
) {
66-
TAG = "WSJCppValidatorUUID";
66+
TAG = "WsjcppValidatorUUID";
6767
}
6868
};
6969
```

src.wsjcpp/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Automaticly generated by [email protected]
22
cmake_minimum_required(VERSION 3.0)
33

4-
add_definitions(-DWSJCPP_VERSION="v0.0.3")
4+
add_definitions(-DWSJCPP_VERSION="v0.1.0")
55
add_definitions(-DWSJCPP_NAME="wsjcpp-validators")
66

77
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
@@ -14,7 +14,10 @@ set (WSJCPP_LIBRARIES "")
1414
set (WSJCPP_INCLUDE_DIRS "")
1515
set (WSJCPP_SOURCES "")
1616

17-
# wsjcpp-core:v0.0.5
17+
find_package(Threads REQUIRED)
18+
list (APPEND WSJCPP_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
19+
20+
# wsjcpp-core:v0.1.1
1821
list (APPEND WSJCPP_INCLUDE_DIRS "./src.wsjcpp/wsjcpp_core/")
1922
list (APPEND WSJCPP_SOURCES "./src.wsjcpp/wsjcpp_core/wsjcpp_core.cpp")
2023
list (APPEND WSJCPP_SOURCES "./src.wsjcpp/wsjcpp_core/wsjcpp_core.h")

src.wsjcpp/wsjcpp_core/wsjcpp.hold.yml

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ cmake_cxx_standard: 11
33
cmake_minimum_required: 3.0
44

55
name: wsjcpp-core
6-
version: v0.0.5
6+
version: v0.1.1
77
description: Basic Utils for wsjcpp
88
issues: https://github.com/wsjcpp/wsjcpp-core/issues
99
repositories:
@@ -17,30 +17,22 @@ authors:
1717
- name: Evgenii Sopov
1818
1919

20-
required-libraries:
21-
- pthread
22-
2320
distribution:
2421
- source-file: src/wsjcpp_core.cpp
2522
target-file: wsjcpp_core.cpp
26-
sha1: "d892bfee196af88dcada57b39bc6bd65ce2ce075"
2723
type: "source-code"
2824
- source-file: src/wsjcpp_core.h
2925
target-file: wsjcpp_core.h
30-
sha1: "8f5e7b7ada06814ed123a08e49acffe2e12d398a"
3126
type: "source-code" # todo must be header-file
3227
- source-file: "src/wsjcpp_unit_tests.cpp"
3328
target-file: "wsjcpp_unit_tests.cpp"
3429
type: "unit-tests"
35-
sha1: "4208e039ec2923636655b3ada79ec223cca7bae2"
3630
- source-file: "src/wsjcpp_unit_tests.h"
3731
target-file: "wsjcpp_unit_tests.h"
3832
type: "unit-tests"
39-
sha1: "8d2ec886f23161a639bb2419bb5e4af48278f18b"
4033
- source-file: "src/wsjcpp_unit_tests_main.cpp"
4134
target-file: "wsjcpp_unit_tests_main.cpp"
4235
type: "unit-tests"
43-
sha1: "2c02fb58f51687eeac2076096b7df698cc246c9d"
4436

4537
unit-tests:
4638
cases:
@@ -50,11 +42,29 @@ unit-tests:
5042
description: Check test generate uuid function
5143
- name: CoreExtractFilename
5244
description: Check function extract filenane from path
53-
- name: IpV4
54-
description: Check function isIPv4
55-
- name: IpV6
56-
description: Check function isIPv6
5745
- name: "ToUpper"
5846
description: "String to upper"
5947
- name: "CreateUuid"
6048
description: "Test generation uuids"
49+
- name: "GetEnv"
50+
description: "Test getEnv function"
51+
- name: "ToLower"
52+
description: "Test toLower"
53+
- name: "ReplaceAll"
54+
description: "Test replace all"
55+
- name: "DecodeUriComponent"
56+
description: "Check decoding"
57+
- name: "EncodeUriComponent"
58+
description: "Check encoding"
59+
- name: "Uint2HexString"
60+
description: "Test convert unsigned int to hex string"
61+
- name: "Split"
62+
description: "Test split function"
63+
- name: "CreateEmptyFile"
64+
description: "Test create empty file"
65+
- name: "ReadFileToBuffer"
66+
description: "test for readFileToBuffer"
67+
- name: "Join"
68+
description: "Test join function"
69+
- name: "getHumanSizeBytes"
70+
description: "Test function get human size in bytes"

0 commit comments

Comments
 (0)