Haio
0.2.X
Homebrew Asset IO/CDN
Toggle main menu visibility
Loading...
Searching...
No Matches
haio_string.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
haio_object.hpp
"
4
5
#include <string_view>
6
7
namespace
Haio::String
{
8
9
int
getInt
(std::string_view value);
10
Size
getSize
(std::string_view value);
11
12
/**
13
* a size written as a share of what came in: "30%", or "30pct" where a percent sign
14
* cannot go.
15
*
16
* the url form exists because "%" opens an escape sequence: "?resize=30%" is not a
17
* request for thirty percent, it is a request the server has to reject as a broken
18
* escape. "pct" says the same thing and survives being a url.
19
*
20
* it answers zero when the text is not a share at all, since zero percent of a
21
* picture is nothing and could never have been meant.
22
*/
23
int
getPercent
(std::string_view value);
24
Rect
getRect
(std::string_view value);
25
bool
tryGetSize
(std::string_view value,
Size
& out);
26
bool
tryGetRect
(std::string_view value,
Rect
& out);
27
bool
tryGetCropGeometry
(std::string_view value,
Rect
& out);
28
29
}
haio_object.hpp
Haio::String
Definition
haio_string.hpp:7
Haio::String::tryGetRect
bool tryGetRect(std::string_view value, Rect &out)
Definition
string.cpp:73
Haio::String::getSize
Size getSize(std::string_view value)
Definition
string.cpp:67
Haio::String::tryGetSize
bool tryGetSize(std::string_view value, Size &out)
Definition
string.cpp:40
Haio::String::getPercent
int getPercent(std::string_view value)
Definition
string.cpp:52
Haio::String::getInt
int getInt(std::string_view value)
Definition
string.cpp:34
Haio::String::getRect
Rect getRect(std::string_view value)
Definition
string.cpp:88
Haio::String::tryGetCropGeometry
bool tryGetCropGeometry(std::string_view value, Rect &out)
Definition
string.cpp:94
Haio::Rect
Definition
haio_object.hpp:5
Haio::Size
Definition
haio_object.hpp:12
include
haio_string.hpp
Generated by
1.18.0