Added missing dependency to yaml-cpp and added count parameter to ConfigArray::removeAt().
This commit is contained in:
parent
20020318e1
commit
9d02d97af3
@ -13,5 +13,6 @@
|
|||||||
"SDL": {
|
"SDL": {
|
||||||
"min": [3,0,0]
|
"min": [3,0,0]
|
||||||
},
|
},
|
||||||
"stb": {}
|
"stb": {},
|
||||||
|
"yaml-cpp": {}
|
||||||
}
|
}
|
||||||
|
@ -137,9 +137,11 @@ void ConfigArray::setAt(std::size_t idx, ConfigValue value)
|
|||||||
mValues[idx] = std::move(value);
|
mValues[idx] = std::move(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigArray::removeAt(std::size_t idx)
|
void ConfigArray::removeAt(std::size_t idx, std::size_t count)
|
||||||
{
|
{
|
||||||
mValues.erase(mValues.begin() + static_cast<std::ptrdiff_t>(idx));
|
auto itStart = mValues.begin() + static_cast<std::ptrdiff_t>(idx);
|
||||||
|
auto itEnd = itStart + static_cast<std::ptrdiff_t>(count);
|
||||||
|
mValues.erase(itStart, itEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ public:
|
|||||||
|
|
||||||
void append(ConfigValue value);
|
void append(ConfigValue value);
|
||||||
void setAt(std::size_t idx, ConfigValue value);
|
void setAt(std::size_t idx, ConfigValue value);
|
||||||
void removeAt(std::size_t idx);
|
void removeAt(std::size_t idx, std::size_t count = 1);
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
bool isEmpty() const noexcept { return mValues.empty(); }
|
bool isEmpty() const noexcept { return mValues.empty(); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user