Skip to content

Commit 235746c

Browse files
committed
wip
1 parent e87a9b6 commit 235746c

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

libraries/ESP8266WebServer/src/ESP8266WebServer.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,40 @@ class ESP8266WebServerTemplate
155155
// code - HTTP response code, can be 200 or 404
156156
// content_type - HTTP content type, like "text/plain" or "image/png"
157157
// content - actual content body
158+
159+
#if 0
160+
161+
void send(int code) { send(code, nullptr, nullptr); }
162+
163+
template <CT content_type, CD content>
164+
void send(int code, CT&& content_type, CD&& content)
165+
{
166+
String(std::forward<CT>(content_type)) content_type_forwarded;
167+
StreamConstPtr(std::forward<CD>(content)) content_forwarded;
168+
send(code, content_type_forwarded.c_str(), &content_forwarded);
169+
}
170+
171+
template <CT content_type, C content>
172+
void send(int code, CT&& content_type, C&& content, size_t content_length)
173+
{
174+
String(std::forward<CT>(content_type)) content_type_forwarded;
175+
StreamConstPtr(std::forward<CD>(content), content_length) content_forwarded;
176+
send(code, content_type_forwarded.c_str(), &content_forwarded);
177+
}
178+
179+
template <CT content_type>
180+
void send(int code, CT&& content_type, Stream* stream, size_t content_length = 0)
181+
{
182+
String(std::forward<CT>(content_type)) content_type_forwarded;
183+
send(code, content_type_forwarded.c_str(), stream, content_length);
184+
}
185+
186+
send_P
187+
188+
189+
#else
190+
191+
158192
void send(int code, const char* content_type = NULL, const String& content = emptyString) {
159193
return send(code, content_type, content.c_str(), content.length());
160194
}
@@ -185,6 +219,8 @@ class ESP8266WebServerTemplate
185219
return send(code, String(content_type).c_str(), &ref);
186220
}
187221

222+
#endif
223+
188224
void send(int code, const char* content_type, Stream* stream, size_t content_length = 0);
189225

190226
void setContentLength(const size_t contentLength);

0 commit comments

Comments
 (0)