diff options
author | Niklas Halle <niklas@niklashalle.net> | 2020-08-26 11:20:44 +0200 |
---|---|---|
committer | Niklas Halle <niklas@niklashalle.net> | 2020-08-26 11:20:44 +0200 |
commit | 2f8ff5fc79e394b95bafdb5931f2cdddb8a7ae1c (patch) | |
tree | bb40e187f4362333503c5cf0622575db3a46c0d4 /include/Response.hpp | |
parent | 38e20390ddf38edd74447ef7db2af660b8e0ff32 (diff) | |
download | n_core-2f8ff5fc79e394b95bafdb5931f2cdddb8a7ae1c.tar.gz n_core-2f8ff5fc79e394b95bafdb5931f2cdddb8a7ae1c.zip |
Extended extra field of annotations to be an list of text-annotation pairs as well
Fixed CMake Boost findings
Diffstat (limited to 'include/Response.hpp')
-rw-r--r-- | include/Response.hpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/Response.hpp b/include/Response.hpp index 53043c8..82edb53 100644 --- a/include/Response.hpp +++ b/include/Response.hpp @@ -8,13 +8,19 @@ namespace Response { using Reply::AnnotationType; typedef crow::json::wvalue json; + // create a full response of just plain text json simple_response(std::string const &text, std::string const &session = "null", bool success = true); + // "nested" annotations: the extra field is again an array of text-annotation pairs + json create_annotation(AnnotationType annotation, std::vector<json> &&extra); + // construct an extra field with no special annotations in the extra json create_annotation(AnnotationType annotation = AnnotationType::none, std::string const &extra = ""); + // text with no special annotation json create_text(std::string const &text); - + // text with annotations json create_text(std::string const &text, std::vector<json> &&annotations); + // create a response from multiple texts json create_response(std::vector<json> &&reply, std::string const &session = "null", bool success = true); }
\ No newline at end of file |