Haio 0.2.X
Homebrew Asset IO/CDN
Loading...
Searching...
No Matches
Haio::String Namespace Reference

Functions

int getInt (std::string_view value)
Size getSize (std::string_view value)
int getPercent (std::string_view value)
Rect getRect (std::string_view value)
bool tryGetSize (std::string_view value, Size &out)
bool tryGetRect (std::string_view value, Rect &out)
bool tryGetCropGeometry (std::string_view value, Rect &out)

Function Documentation

◆ getInt()

int Haio::String::getInt ( std::string_view value)

Definition at line 34 of file string.cpp.

Here is the call graph for this function:

◆ getPercent()

int Haio::String::getPercent ( std::string_view value)

a size written as a share of what came in: "30%", or "30pct" where a percent sign cannot go.

the url form exists because "%" opens an escape sequence: "?resize=30%" is not a request for thirty percent, it is a request the server has to reject as a broken escape. "pct" says the same thing and survives being a url.

it answers zero when the text is not a share at all, since zero percent of a picture is nothing and could never have been meant.

Definition at line 52 of file string.cpp.

Here is the call graph for this function:

◆ getRect()

Rect Haio::String::getRect ( std::string_view value)

Definition at line 88 of file string.cpp.

Here is the call graph for this function:

◆ getSize()

Size Haio::String::getSize ( std::string_view value)

Definition at line 67 of file string.cpp.

Here is the call graph for this function:

◆ tryGetCropGeometry()

bool Haio::String::tryGetCropGeometry ( std::string_view value,
Rect & out )

Definition at line 94 of file string.cpp.

Here is the call graph for this function:

◆ tryGetRect()

bool Haio::String::tryGetRect ( std::string_view value,
Rect & out )

Definition at line 73 of file string.cpp.

Here is the call graph for this function:

◆ tryGetSize()

bool Haio::String::tryGetSize ( std::string_view value,
Size & out )

Definition at line 40 of file string.cpp.

Here is the call graph for this function: