iceberg-cpp
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
iceberg::UrlEncoder Class Reference

Utilities for encoding and decoding URLs. More...

#include <url_encoder.h>

Static Public Member Functions

static std::string Encode (std::string_view str_to_encode)
 URL-encode a string.
 
static std::string Decode (std::string_view str_to_decode)
 URL-decode a string.
 

Detailed Description

Utilities for encoding and decoding URLs.

Member Function Documentation

◆ Decode()

std::string iceberg::UrlEncoder::Decode ( std::string_view  str_to_decode)
static

URL-decode a string.

Decodes percent-encoded characters (e.g., "%20" -> space).

Parameters
str_to_decodeThe encoded string to decode.
Returns
The decoded string.

◆ Encode()

std::string iceberg::UrlEncoder::Encode ( std::string_view  str_to_encode)
static

URL-encode a string.

This is a simple implementation of url-encode

  • Unreserved characters: [A-Z], [a-z], [0-9], "-", "_", ".", "~"
  • Space is encoded as "%20" (unlike Java's URLEncoder which uses "+").
  • All other characters are percent-encoded (XX).
    Parameters
    str_to_encodeThe string to encode.
    Returns
    The URL-encoded string.

The documentation for this class was generated from the following files: