Difference between revisions of "ConfigFile::loadFile"

From King Arthur's Gold Wiki
Jump to: navigation, search
(Created page with "<onlyinclude> Load the given .cfg file into the ConfigFile. Returns true if this was successful, otherwise false. </onlyinclude> If you pass it a path that does not end with .cf...")
 
 
(One intermediate revision by the same user not shown)
Line 5: Line 5:
 
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 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 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 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]] without a parameter will save to this new path).
  
 
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.
 
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.

Latest revision as of 15:55, 29 September 2012

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


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 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 without a parameter will save to this new path).

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.

bool loadFile( string file )

Object method of: ConfigFile