cfe8526ec8
* Add Uri with support for staticUri, regexUri and globUri * Add newline to end of files * Update example * Suppress gcc warnings (unused params)
29 lines
604 B
C++
29 lines
604 B
C++
#ifndef URI_H
|
|
#define URI_H
|
|
|
|
#include <Arduino.h>
|
|
#include <vector>
|
|
|
|
class Uri {
|
|
|
|
protected:
|
|
const String _uri;
|
|
|
|
public:
|
|
Uri(const char *uri) : _uri(uri) {}
|
|
Uri(const String &uri) : _uri(uri) {}
|
|
virtual ~Uri() {}
|
|
|
|
virtual Uri* clone() const {
|
|
return new Uri(_uri);
|
|
};
|
|
|
|
virtual void initPathArgs(__attribute__((unused)) std::vector<String> &pathArgs) {}
|
|
|
|
virtual bool canHandle(const String &requestUri, __attribute__((unused)) std::vector<String> &pathArgs) {
|
|
return _uri == requestUri;
|
|
}
|
|
};
|
|
|
|
#endif
|