New textbox::getline returning an optional<string>
This commit is contained in:
@@ -377,6 +377,27 @@ namespace drawerbase {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::optional<std::string> textbox::getline(std::size_t pos) const
|
||||
{
|
||||
auto result = std::string{};
|
||||
if ( getline(pos, result) )
|
||||
{
|
||||
return { std::move(result) };
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
std::optional<std::string> textbox::getline(std::size_t line_index, std::size_t offset) const
|
||||
{
|
||||
auto result = std::string{};
|
||||
if ( getline(line_index, offset, result) )
|
||||
{
|
||||
return { std::move(result) };
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
/// Gets the caret position
|
||||
bool textbox::caret_pos(point& pos, bool text_coordinate) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user