GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - wsjcpp/wsjcpp-validators: Classes for data validation

This repository was archived by the owner on Aug 16, 2026. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

36 Commits
36 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
.vscode
.vscode
 
 
.wsjcpp
.wsjcpp
 
 
src.wsjcpp
src.wsjcpp
 
 
src
src
 
 
.clang-format
.clang-format
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CMakeLists.txt
CMakeLists.txt
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build_simple.sh
build_simple.sh
 
 
wsjcpp.yml
wsjcpp.yml
 
 

Repository files navigation

wsjcpp-validators

Build Status Github Stars Github Stars Github Forks

Integrate to your project

Just include this files:

  • src.wsjcpp/wsjcpp_core/wsjcpp_core.cpp
  • src.wsjcpp/wsjcpp_core/wsjcpp_core.h
  • src/wsjcpp_validators.h
  • src/wsjcpp_validators.cpp

Integrate via wsjcpp

$ wsjcpp install "https://github.com/wsjcpp/wsjcpp-core:v0.2.3"
$ wsjcpp install "https://github.com/wsjcpp/wsjcpp-validators:master"

Example usage

validator_uuid *pValidatorUUID = new validator_uuid();
std::string sError = "";
if (!pValidatorUUID->is_valid("abcdef01-ABCD-EF23-1000-000000000001", sError)) {
    std::cout << sError << std::endl;
}

Classes for data validation

Completed classes

  • new WsjcppValidatorStringRegexpBase("testre", "^[a-zA-Z]+$") - validate value by regular expression
  • new WsjcppValidatorStringListBase("lang", {"en", "de", "ru"}) - validate value from a list
  • new WsjcppValidatorEmail() - validate format email
  • new validator_uuid() - validate format uuid
  • new validator_strlen(1,100) - validate min length and max length
  • new validator_jwt() - validate format of JWT
  • new WsjcppValidatorDate() - validate format date like 'YYYY-MM-DD'
  • new validator_time24() - validate format date like 'HH:mm:ss' (24 hours)
  • new WsjcppValidatorDateTime() - validate format date like 'YYYY-MM-DD\THH:mm:ss'
  • new WsjcppValidatorURL() - validate format of url
  • new validator_base64() - validate format of base64
  • new WsjcppValidatorNumber() - validate format of number
  • new WsjcppValidatorHex() - validate hex value
  • new WsjcppValidatorIntegerMinValue(1) - validate integer min value
  • new WsjcppValidatorIntegerMaxValue(100) - validate integer max value

Completed static functions

  • WsjcppValidators::is_validDate(const std::string &sValue, std::string &sError)
  • WsjcppValidators::is_validTimeH24(const std::string &sValue, std::string &sError)
  • WsjcppValidators::is_validDomainName(const std::string &sValue, std::string &sError)
  • WsjcppValidators::is_validBase64(const std::string &sValue, std::string &sError)
  • WsjcppValidators::is_validIPv4(const std::string &sValue, std::string &sError)
  • WsjcppValidators::is_validIPv6(const std::string &sValue, std::string &sError)

Example for your implementations

class validator_uuid : public WsjcppValidatorStringRegexpBase {
    public:
        validator_uuid() 
            : WsjcppValidatorStringRegexpBase(
                "uuid", // name
                "^[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}$"
            ) {
            TAG = "validator_uuid";
        }
};

About

Classes for data validation

Topics

base64-validatorcppdate-validatoremailhex-validatoripv4-validatoripv6-validatornumber-validatorregular-expressiontimeh24-validatorurl-validatoruuid-validatorvalidationvalidatorswsjcpp-package

Resources

Readme
MIT license
Activity
Custom properties

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.