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.
This commit is contained in:
parent
ba4dfec459
commit
20cf8b1fc2
32 changed files with 4213 additions and 0 deletions
|
|
@ -0,0 +1,49 @@
|
|||
{{>licenseInfo}}
|
||||
/*
|
||||
* MultipartFormData.h
|
||||
*
|
||||
* This class represents a container for building application/x-multipart-formdata requests.
|
||||
*/
|
||||
|
||||
#ifndef {{modelHeaderGuardPrefix}}_MultipartFormData_H_
|
||||
#define {{modelHeaderGuardPrefix}}_MultipartFormData_H_
|
||||
|
||||
{{{defaultInclude}}}
|
||||
#include "{{packageName}}/IHttpBody.h"
|
||||
#include "{{packageName}}/HttpContent.h"
|
||||
|
||||
#include <cpprest/details/basic_types.h>
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
|
||||
{{#modelNamespaceDeclarations}}
|
||||
namespace {{this}} {
|
||||
{{/modelNamespaceDeclarations}}
|
||||
|
||||
class {{declspec}} MultipartFormData
|
||||
: public IHttpBody
|
||||
{
|
||||
public:
|
||||
MultipartFormData();
|
||||
MultipartFormData(const utility::string_t& boundary);
|
||||
virtual ~MultipartFormData();
|
||||
|
||||
virtual void add( std::shared_ptr<HttpContent> content );
|
||||
virtual utility::string_t getBoundary();
|
||||
virtual std::shared_ptr<HttpContent> getContent(const utility::string_t& name) const;
|
||||
virtual bool hasContent(const utility::string_t& name) const;
|
||||
virtual void writeTo( std::ostream& target );
|
||||
|
||||
protected:
|
||||
std::vector<std::shared_ptr<HttpContent>> m_Contents;
|
||||
utility::string_t m_Boundary;
|
||||
std::map<utility::string_t, std::shared_ptr<HttpContent>> m_ContentLookup;
|
||||
};
|
||||
|
||||
{{#modelNamespaceDeclarations}}
|
||||
}
|
||||
{{/modelNamespaceDeclarations}}
|
||||
|
||||
#endif /* {{modelHeaderGuardPrefix}}_MultipartFormData_H_ */
|
||||
Loading…
Add table
Add a link
Reference in a new issue