Difference between revisions of "ConfigFile::saveFile"

From King Arthur's Gold Wiki
Jump to: navigation, search
 
Line 1: Line 1:
 
<onlyinclude>
 
<onlyinclude>
Load the given .cfg file into the ConfigFile. Returns true if this was successful, otherwise false.
+
Save the given .cfg file into the ConfigFile. Returns true if this was successful, otherwise false.
 
</onlyinclude>
 
</onlyinclude>
  
If you pass it a path that does not end with .cfg then .cfg will be appended. If the .cfg file does not exist then nothing will be loaded and the method will return false.
+
If not passed any parameters, saves to the [[ConfigFile]]'s current internal path (as set by its constructor or [[ConfigFile::loadFile]]).
  
If the file is successfully loaded the new internal path of the [[ConfigFile]] will be updated to this file's path (and so calls to [[ConfigFile]]::[[saveFile]] will save to this new path).
+
If you pass it a path that does not end with .cfg then .cfg will be appended. If the .cfg file does not exist it will be created.
  
You should note that it will not clear any key/values that are currently in the [[ConfigFile]] - all valid keys will be loaded from the new file but they will exist there in addition to any previously loaded/added keys.
+
This method does not change the internal path of the [[ConfigFile]].
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
bool loadFile( string file )
+
bool saveFile()
 +
bool saveFile( string file )
 
</syntaxhighlight>
 
</syntaxhighlight>
 
   
 
   

Latest revision as of 16:58, 29 September 2012

Save the given .cfg file into the ConfigFile. Returns true if this was successful, otherwise false.


If not passed any parameters, saves to the ConfigFile's current internal path (as set by its constructor or ConfigFile::loadFile).

If you pass it a path that does not end with .cfg then .cfg will be appended. If the .cfg file does not exist it will be created.

This method does not change the internal path of the ConfigFile.

bool saveFile()
bool saveFile( string file )

Object method of: ConfigFile