void ApplyInsertions(Dump& result) const { if (0 == SizeAddon) { return; } Dump tmp(result.size() + SizeAddon); Dump::const_iterator src = result.begin(); const Dump::const_iterator srcEnd = result.end(); auto dst = tmp.begin(); std::size_t oldOffset = 0; for (const auto& ins : Insertions) { if (const std::size_t toCopy = ins.first - oldOffset) { const Dump::const_iterator nextEnd = src + toCopy; dst = std::copy(src, nextEnd, dst); src = nextEnd; oldOffset += toCopy; } dst = std::copy(ins.second.begin(), ins.second.end(), dst); } std::copy(src, srcEnd, dst); result.swap(tmp); }
void ApplyOverwrites(Dump& result) const { for (const auto& over : Overwrites) { std::copy(over.second.begin(), over.second.end(), result.begin() + over.first); } }
bool IsInfoEmpty(const Dump& info) { assert(info.size() == 53); //28 is fixed //25 is title const Dump::const_iterator titleStart = info.begin() + 28; return info.end() == std::find_if(titleStart, info.end(), std::bind2nd(std::greater<Char>(), Char(' '))); }
void AddData(const Dump& str) { std::copy(str.begin(), str.end(), std::back_inserter(Data)); }