Beispiel #1
0
 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);
 }
Beispiel #2
0
 void ApplyOverwrites(Dump& result) const
 {
   for (const auto& over : Overwrites)
   {
     std::copy(over.second.begin(), over.second.end(), result.begin() + over.first);
   }
 }
Beispiel #3
0
 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(' ')));
 }
Beispiel #4
0
 void AddData(const Dump& str)
 {
   std::copy(str.begin(), str.end(), std::back_inserter(Data));
 }