SavePersistent: Safely save through temp file.

Also change SavePersistent and LoadPersistent to take StringRef.
This commit is contained in:
Peter Johnson
2015-07-18 00:39:08 -07:00
parent d05656b716
commit c4a7f6ec9b
2 changed files with 29 additions and 6 deletions

View File

@@ -211,10 +211,9 @@ std::vector<ConnectionInfo> GetConnections();
* Persistent Functions
*/
/* return error string, or nullptr if successful */
const char* SavePersistent(const char* filename);
const char* SavePersistent(StringRef filename);
const char* LoadPersistent(
const char* filename,
std::function<void(size_t line, const char *msg)> warn);
StringRef filename, std::function<void(size_t line, const char* msg)> warn);
/*
* Utility Functions