CppRestApi Format type

Admin私のストア

The Format type holds the schema definition as a tuple type, which is specified by the Database class to convert the result of a SQL query in the implementation class into a list of C++ tuples.

Using the data formatted as a tuple, call the Format::Record constructor to create the data to be used in the project.

Format::Record record{record};

record.record;

The Format::Record constructor is also defined using the ::web::json::value type from cpprestsdk. This is used to create data to be used in the project using JSON data received by the Web API.

Format::Record record{json};

record.json;

The Format class also implements a validate method, which validates the data provided to it before handling it in the constructor.

Format::validate(...);

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.