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(); }
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(); }