Skip to content

Helper classes for create C++ Data Transfer Object

License

Notifications You must be signed in to change notification settings

wsjcpp/wsjcpp-dto

Repository files navigation

wsjcpp-dto

Build Status Total alerts Language grade: C/C++

Helper classes for create C++ Data Transfer Object

Integrate to your project

Use a wsjcpp:

$ wsjcpp install https://github.com/wsjcpp/wsjcpp-dto:master

Or include this files:

  • src.wsjcpp/nlohmann_json/json.hpp
  • src/wsjcpp_dto.h
  • src/wsjcpp_dto.cpp

How to use

class WsjcppDtoPerson : public WsjcppDto {
    public:
        WsjcppDtoPerson() : WsjcppDto("person", "Person") {
            requireField<WsjcppDtoString>("name", "Name of person");
            optionalField<WsjcppDtoInteger>("age", "Age of person");
        };
};