2020-02-07 11:24:35 -08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace vcpkg::Parse
|
|
|
|
{
|
|
|
|
struct TextRowCol
|
|
|
|
{
|
2020-02-19 16:51:09 -08:00
|
|
|
constexpr TextRowCol() noexcept = default;
|
2020-04-17 18:16:20 -07:00
|
|
|
constexpr TextRowCol(int row, int column) noexcept : row(row), column(column) { }
|
2020-02-07 11:24:35 -08:00
|
|
|
/// '0' indicates uninitialized; '1' is the first row.
|
|
|
|
int row = 0;
|
|
|
|
/// '0' indicates uninitialized; '1' is the first column.
|
|
|
|
int column = 0;
|
2020-04-17 18:16:20 -07:00
|
|
|
|
|
|
|
constexpr int row_or(int def) const noexcept { return row ? row : def; }
|
|
|
|
constexpr int column_or(int def) const noexcept { return column ? column : def; }
|
2020-02-07 11:24:35 -08:00
|
|
|
};
|
|
|
|
}
|