Adding path arguments to WebServer (#1994)

This commit is contained in:
Bob
2018-11-19 17:00:52 +01:00
committed by Me No Dev
parent f9d1b24c01
commit 3902aa4019
5 changed files with 113 additions and 3 deletions

View File

@ -1,6 +1,9 @@
#ifndef REQUESTHANDLER_H
#define REQUESTHANDLER_H
#include <vector>
#include <assert.h>
class RequestHandler {
public:
virtual ~RequestHandler() { }
@ -14,6 +17,15 @@ public:
private:
RequestHandler* _next = nullptr;
protected:
std::vector<String> pathArgs;
public:
const String& pathArg(unsigned int i) {
assert(i < pathArgs.size());
return pathArgs[i];
}
};
#endif //REQUESTHANDLER_H