Exemplo n.º 1
0
bool
Profile::SaveFile(const FileTransaction &transaction)
{
  TextWriter writer(transaction.GetTemporaryPath());
  // ... on error -> return
  if (!writer.IsOpen())
    return false;

  KeyValueFileWriter kvwriter(writer);
  Export(kvwriter);

  return writer.Flush();
}
Exemplo n.º 2
0
inline bool
Profile::SaveFile(const ProfileMap &map,
                  const FileTransaction &transaction)
{
  TextWriter writer(transaction.GetTemporaryPath());
  // ... on error -> return
  if (!writer.IsOpen())
    return false;

  KeyValueFileWriter kvwriter(writer);
  for (const auto &i : map)
    kvwriter.Write(i.first.c_str(), i.second.c_str());

  return writer.Flush();
}