Create one method per file

This commit is contained in:
Aaron Po
2026-04-09 17:19:04 -04:00
parent b31be494d7
commit d7a31b5264
23 changed files with 635 additions and 454 deletions

View File

@@ -0,0 +1,23 @@
/**
* @file web_client/curl_web_client_url_encode.cpp
* @brief CURLWebClient::UrlEncode() implementation.
*/
#include <curl/curl.h>
#include <stdexcept>
#include <string>
#include "web_client/curl_web_client.h"
std::string CURLWebClient::UrlEncode(const std::string& value) {
// A NULL handle is fine for UTF-8 encoding according to libcurl docs.
char* output = curl_easy_escape(nullptr, value.c_str(), 0);
if (output) {
std::string result(output);
curl_free(output);
return result;
}
throw std::runtime_error("[CURLWebClient] curl_easy_escape failed");
}