1
0
mirror of https://github.com/esphome/esphome.git synced 2026-02-09 01:01:56 +00:00

Compare commits

...

1 Commits

Author SHA1 Message Date
J. Nick Koston
67fbd31e46 [web_server_idf] Use C++17 nested namespace style 2026-02-08 01:45:22 -06:00
5 changed files with 10 additions and 20 deletions

View File

@@ -6,8 +6,7 @@
#include <cstring>
#include "multipart_parser.h"
namespace esphome {
namespace web_server_idf {
namespace esphome::web_server_idf {
static const char *const TAG = "multipart";
@@ -249,6 +248,5 @@ std::string str_trim(const std::string &str) {
return str.substr(start, end - start + 1);
}
} // namespace web_server_idf
} // namespace esphome
} // namespace esphome::web_server_idf
#endif // defined(USE_ESP32) && defined(USE_WEBSERVER_OTA)

View File

@@ -10,8 +10,7 @@
#include <string>
#include <utility>
namespace esphome {
namespace web_server_idf {
namespace esphome::web_server_idf {
// Wrapper around zorxx/multipart-parser for ESP-IDF OTA uploads
class MultipartReader {
@@ -81,6 +80,5 @@ bool parse_multipart_boundary(const char *content_type, const char **boundary_st
// Trim whitespace from both ends of a string
std::string str_trim(const std::string &str);
} // namespace web_server_idf
} // namespace esphome
} // namespace esphome::web_server_idf
#endif // defined(USE_ESP32) && defined(USE_WEBSERVER_OTA)

View File

@@ -8,8 +8,7 @@
#include "utils.h"
namespace esphome {
namespace web_server_idf {
namespace esphome::web_server_idf {
static const char *const TAG = "web_server_idf_utils";
@@ -119,6 +118,5 @@ const char *stristr(const char *haystack, const char *needle) {
return nullptr;
}
} // namespace web_server_idf
} // namespace esphome
} // namespace esphome::web_server_idf
#endif // USE_ESP32

View File

@@ -5,8 +5,7 @@
#include <string>
#include "esphome/core/helpers.h"
namespace esphome {
namespace web_server_idf {
namespace esphome::web_server_idf {
/// Decode URL-encoded string in-place (e.g., %20 -> space, + -> space)
/// Returns the new length of the decoded string
@@ -29,6 +28,5 @@ bool str_ncmp_ci(const char *s1, const char *s2, size_t n);
// Case-insensitive string search (like strstr but case-insensitive)
const char *stristr(const char *haystack, const char *needle);
} // namespace web_server_idf
} // namespace esphome
} // namespace esphome::web_server_idf
#endif // USE_ESP32

View File

@@ -30,8 +30,7 @@
#include <cerrno>
#include <sys/socket.h>
namespace esphome {
namespace web_server_idf {
namespace esphome::web_server_idf {
#ifndef HTTPD_409
#define HTTPD_409 "409 Conflict"
@@ -897,7 +896,6 @@ esp_err_t AsyncWebServer::handle_multipart_upload_(httpd_req_t *r, const char *c
}
#endif // USE_WEBSERVER_OTA
} // namespace web_server_idf
} // namespace esphome
} // namespace esphome::web_server_idf
#endif // !defined(USE_ESP32)