Reqboost::InternalUtility namespace

Enums

enum class StringType { Bytes, Str }
Enum for string type.

Functions

auto ToNativeString(const std::string& str, const std::string& encoding) -> std::string
Convert a string to a native string.
auto UnicodeIsAscii(const std::string& u_string) -> bool
Check if a string contains only ASCII characters.
auto kValidHeaderNameReByte(R"(^[^:\s][^:\r\n]*$)") -> const std::regex
auto kValidHeaderNameReStr(R"(^[^:\s][^:\r\n]*$)") -> const std::regex
auto kValidHeaderValueReByte(R"(^\S[^\r\n]*$|^$)") -> const std::regex
auto kValidHeaderValueReStr(R"(^\S[^\r\n]*$|^$)") -> const std::regex
auto kHeaderValidatorsByte(kValidHeaderNameReByte, kValidHeaderValueReByte) -> const std::tuple<std::regex, std::regex>
Tuple of regular expressions for validating HTTP header names and values.
auto kHeaderValidatorsStr(kValidHeaderNameReStr, kValidHeaderValueReStr) -> const std::tuple<std::regex, std::regex>
Tuple of regular expressions for validating HTTP header names and values as bytes.

Function documentation

std::string Reqboost::InternalUtility::ToNativeString(const std::string& str, const std::string& encoding)

Convert a string to a native string.

Parameters
str
encoding
Returns std::string

bool Reqboost::InternalUtility::UnicodeIsAscii(const std::string& u_string)

Check if a string contains only ASCII characters.

Parameters
u_string
Returns true

const std::tuple<std::regex, std::regex> Reqboost::InternalUtility::kHeaderValidatorsByte(kValidHeaderNameReByte, kValidHeaderValueReByte)

Tuple of regular expressions for validating HTTP header names and values.

This tuple contains regular expressions for validating HTTP header names and values. The first element is a regular expression for validating header names, and the second element is a regular expression for validating header values.

const std::tuple<std::regex, std::regex> Reqboost::InternalUtility::kHeaderValidatorsStr(kValidHeaderNameReStr, kValidHeaderValueReStr)

Tuple of regular expressions for validating HTTP header names and values as bytes.

This tuple contains regular expressions for validating HTTP header names and values as bytes. The first element is a regular expression for validating header names, and the second element is a regular expression for validating header values.