zamotivator

Untitled

Feb 3rd, 2012
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. config& save_index::save_summary(std::string save)
  2. {
  3. /*
  4. * All saves are .gz files now so make sure we use that name when opening
  5. * a file. If not some parts of the code use the name with and some parts
  6. * without the .gz suffix.
  7. */
  8. if(save.length() < 3 || save.substr(save.length() - 3) != ".gz") {
  9. save += ".gz";
  10. }
  11.  
  12. config& cfg = load();
  13. if (config &sv = cfg.find_child("save", "save", save))
  14. return sv;
  15.  
  16. config &res = cfg.add_child("save");
  17. res["save"] = save;
  18. return res;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment