nyanimedb/api/_build/my-cpp-templates/cpp-restsdk/apiexception-source.mustache
Kirill 20cf8b1fc2 build(tgbot-gen): Changes and additions required to generate the API client with auth (cookie)
I use a standard set of templates, changes are made in api-header.mustache and api-source.mustache. Their _old versions contain the originals. Additions are necessary for the header argument in the generated functions so that you can authenticate using cookies.
2025-12-05 22:49:14 +03:00

41 lines
967 B
Text

{{>licenseInfo}}
#include "{{packageName}}/ApiException.h"
{{#apiNamespaceDeclarations}}
namespace {{this}} {
{{/apiNamespaceDeclarations}}
ApiException::ApiException( int errorCode
, const utility::string_t& message
, std::shared_ptr<std::istream> content /*= nullptr*/ )
: web::http::http_exception( errorCode, message )
, m_Content(content)
{
}
ApiException::ApiException( int errorCode
, const utility::string_t& message
, std::map<utility::string_t, utility::string_t>& headers
, std::shared_ptr<std::istream> content /*= nullptr*/ )
: web::http::http_exception( errorCode, message )
, m_Content(content)
, m_Headers(headers)
{
}
ApiException::~ApiException()
{
}
std::shared_ptr<std::istream> ApiException::getContent() const
{
return m_Content;
}
std::map<utility::string_t, utility::string_t>& ApiException::getHeaders()
{
return m_Headers;
}
{{#apiNamespaceDeclarations}}
}
{{/apiNamespaceDeclarations}}