3#include <Optibits/Platform.hpp>
11 bool hasExtension(std::string_view filename, std::string_view ext);
13 std::vector<std::string> userLanguages();
15 std::u32string utf8ToComposedUtc4(std::string_view utf8);
18 std::wstring utf8ToUtf16(
const std::string& utf8);
19 std::string utf16ToUtf8(
const std::string& utf8);
41 int width = 0, height = 0;
43 int right()
const {
return x + width; }
44 int bottom()
const {
return y + height; }
46 bool empty()
const {
return width <= 0 || height <= 0; }
48 template <
typename T>
static Rect covering(
const T& obj)
50 return Rect { .x = 0, .y = 0, .width = obj.width(), .height = obj.height() };
53 bool overlaps(
const Rect& other)
const;
54 bool contains(
const Rect& other)
const;
56 void clipTo(
const Rect& boundingBox,
int* adjustX =
nullptr,
int* adjustY =
nullptr);
58 bool operator==(
const Rect& other)
const =
default;
Definition Utility.hpp:24
Definition Utility.hpp:39