mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
LibGUI: Move GTextPosition and GTextRange LogStream<< to their headers
This commit is contained in:
parent
bcf3a4457f
commit
1282b778e7
Notes:
sideshowbarker
2024-07-19 11:27:32 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/1282b778e7f
3 changed files with 18 additions and 14 deletions
|
@ -196,17 +196,3 @@ private:
|
|||
|
||||
NonnullOwnPtrVector<LineVisualData> m_line_visual_data;
|
||||
};
|
||||
|
||||
inline const LogStream& operator<<(const LogStream& stream, const GTextPosition& value)
|
||||
{
|
||||
if (!value.is_valid())
|
||||
return stream << "GTextPosition(Invalid)";
|
||||
return stream << String::format("(%d,%d)", value.line(), value.column());
|
||||
}
|
||||
|
||||
inline const LogStream& operator<<(const LogStream& stream, const GTextRange& value)
|
||||
{
|
||||
if (!value.is_valid())
|
||||
return stream << "GTextRange(Invalid)";
|
||||
return stream << value.start() << '-' << value.end();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/LogStream.h>
|
||||
#include <AK/String.h>
|
||||
|
||||
class GTextPosition {
|
||||
public:
|
||||
GTextPosition() {}
|
||||
|
@ -25,3 +28,10 @@ private:
|
|||
int m_line { -1 };
|
||||
int m_column { -1 };
|
||||
};
|
||||
|
||||
inline const LogStream& operator<<(const LogStream& stream, const GTextPosition& value)
|
||||
{
|
||||
if (!value.is_valid())
|
||||
return stream << "GTextPosition(Invalid)";
|
||||
return stream << String::format("(%d,%d)", value.line(), value.column());
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/LogStream.h>
|
||||
#include <LibGUI/GTextPosition.h>
|
||||
|
||||
class GTextRange {
|
||||
|
@ -55,3 +56,10 @@ private:
|
|||
GTextPosition m_start;
|
||||
GTextPosition m_end;
|
||||
};
|
||||
|
||||
inline const LogStream& operator<<(const LogStream& stream, const GTextRange& value)
|
||||
{
|
||||
if (!value.is_valid())
|
||||
return stream << "GTextRange(Invalid)";
|
||||
return stream << value.start() << '-' << value.end();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue