forked from fhessel/esp32_https_server
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathHTTPMultipartBodyParser.hpp
More file actions
39 lines (33 loc) · 946 Bytes
/
HTTPMultipartBodyParser.hpp
File metadata and controls
39 lines (33 loc) · 946 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef SRC_HTTPMULTIPARTBODYPARSER_HPP_
#define SRC_HTTPMULTIPARTBODYPARSER_HPP_
#include <Arduino.h>
#include "HTTPBodyParser.hpp"
namespace httpsserver {
class HTTPMultipartBodyParser : public HTTPBodyParser {
public:
HTTPMultipartBodyParser(HTTPRequest * req);
~HTTPMultipartBodyParser();
virtual bool nextField();
virtual std::string getFieldName();
virtual std::string getFieldFilename();
virtual std::string getFieldMimeType();
virtual bool endOfField();
virtual size_t read(byte* buffer, size_t bufferSize);
private:
std::string readLine();
void fillBuffer(size_t maxLen);
void consumedBuffer(size_t consumed);
bool skipCRLF();
bool peekBoundary();
void discardBody();
bool endOfBody();
char *peekBuffer;
size_t peekBufferSize;
std::string boundary;
std::string lastBoundary;
std::string fieldName;
std::string fieldMimeType;
std::string fieldFilename;
};
} // namespace httpserver
#endif