mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:47:44 +00:00
GVariant: Add to_string(GVariant::Type) helper.
This commit is contained in:
parent
0e18201b7e
commit
0af61e9123
2 changed files with 20 additions and 0 deletions
|
@ -1,5 +1,23 @@
|
||||||
#include <LibGUI/GVariant.h>
|
#include <LibGUI/GVariant.h>
|
||||||
|
|
||||||
|
const char* to_string(GVariant::Type type)
|
||||||
|
{
|
||||||
|
switch (type) {
|
||||||
|
case GVariant::Type::Invalid: return "Invalid";
|
||||||
|
case GVariant::Type::Bool: return "Bool";
|
||||||
|
case GVariant::Type::Int: return "Int";
|
||||||
|
case GVariant::Type::Float: return "Float";
|
||||||
|
case GVariant::Type::String: return "String";
|
||||||
|
case GVariant::Type::Bitmap: return "Bitmap";
|
||||||
|
case GVariant::Type::Color: return "Color";
|
||||||
|
case GVariant::Type::Icon: return "Icon";
|
||||||
|
case GVariant::Type::Point: return "Point";
|
||||||
|
case GVariant::Type::Size: return "Size";
|
||||||
|
case GVariant::Type::Rect: return "Rect";
|
||||||
|
}
|
||||||
|
ASSERT_NOT_REACHED();
|
||||||
|
}
|
||||||
|
|
||||||
GVariant::GVariant()
|
GVariant::GVariant()
|
||||||
{
|
{
|
||||||
m_value.as_string = nullptr;
|
m_value.as_string = nullptr;
|
||||||
|
|
|
@ -199,3 +199,5 @@ private:
|
||||||
|
|
||||||
Type m_type { Type::Invalid };
|
Type m_type { Type::Invalid };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const char* to_string(GVariant::Type);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue