|
Agents 1.4.0
Edge AI Agents SDK
|
Utility class providing static helper functions. More...
#include <utils.h>
Static Public Member Functions | |
| static void | changeKey (JsonObject &object, const std::string &old_key, const std::string &new_key) |
| Change a key in a JSON object. | |
| static std::string | toLower (const std::string &s) |
| Convert a string to lowercase. | |
| static std::string | toUpper (const std::string &s) |
| Convert a string to uppercase. | |
| static std::vector< std::string > | splitByNewline (const std::string &text) |
| Split a string by newlines. | |
| static void | trim (std::string &s) |
| String trim helper. | |
| static std::string | getBaseUrl (const std::string &url) |
| Extract the path (including leading '/') from a full URL. | |
| static std::string | getPathFromUrl (const std::string &url) |
| Extract the path (including leading '/') from a full URL. | |
| static std::string | getHostFromUrl (const std::string &url) |
| Get the hostname From Url object. | |
| static int | getPortFromUrl (const std::string &url) |
| Get the port from a URL string. | |
Utility class providing static helper functions.
|
inlinestatic |
Change a key in a JSON object.
| object | The JSON object |
| old_key | The old key name |
| new_key | The new key name |
|
inlinestatic |
Extract the path (including leading '/') from a full URL.
Example: https://example.com/api/search?q=x -> /api/search?q=x
| url | Full URL |
|
inlinestatic |
Get the hostname From Url object.
(e.g., "127.0.0.1") stripping "http://" and ":8080"
| url | The URL string |
|
inlinestatic |
Extract the path (including leading '/') from a full URL.
Example: https://example.com/api/search?q=x -> /api/search?q=x
| url | Full URL |
|
inlinestatic |
Get the port from a URL string.
Returns the port as an integer (defaulting to 80 or 443 if not found)
| url | The URL string |
|
inlinestatic |
Split a string by newlines.
| text | The text to split |
|
inlinestatic |
Convert a string to lowercase.
| s | The input string |
|
inlinestatic |
Convert a string to uppercase.
| s | The input string |
|
inlinestatic |
String trim helper.
| s | the input string |