]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/options.hxx
Crash-fix: mat-lib is now reference-counted.
[flightgear.git] / src / Main / options.hxx
index bd7e368480fc108c13407df60a8f9ed2ff4e70c7..d0715cda2e9efa33c52f3016e2e3fd22e20b7cee 100644 (file)
@@ -34,7 +34,22 @@ class SGPath;
 
 namespace flightgear
 {
-  
+
+/// option processing can have various result values
+/// depending on what the user requested. Note processOptions only
+/// returns a subset of these.
+enum OptionResult
+{
+    FG_OPTIONS_OK = 0,
+    FG_OPTIONS_HELP = 1,
+    FG_OPTIONS_ERROR = 2,
+    FG_OPTIONS_EXIT = 3,
+    FG_OPTIONS_VERBOSE_HELP = 4,
+    FG_OPTIONS_SHOW_AIRCRAFT = 5,
+    FG_OPTIONS_SHOW_SOUND_DEVICES = 6,
+    FG_OPTIONS_NO_DEFAULT_CONFIG = 7
+};
+    
 class Options
 {
 private:
@@ -48,7 +63,7 @@ public:
   /**
    * pass command line arguments, read default config files
    */
-  void init(int argc, char* argv[]);
+  void init(int argc, char* argv[], const SGPath& appDataPath);
   
   /**
     * parse a config file (eg, .fgfsrc) 
@@ -80,14 +95,24 @@ public:
   
   /**
    * apply option values to the simulation state
-   * (set properties, etc)
+   * (set properties, etc)
    */
-  void processOptions();
+  OptionResult processOptions();
   
   /**
    * init the aircraft options
    */
   void initAircraft();
+  
+  /**
+   * should defualt configuration files be loaded and processed or not?
+   * There's many configuration files we have historically read by default
+   * on startup - preferences.xml, fgfs.rc in various places and so on.
+   * --no-default-config allows this behaviour to be changed, so only
+   * expicitly listed files are read - this is useful for testing. Expose
+   * the value of the option here.
+   */
+  bool shouldLoadDefaultConfig() const;
 private:
   void showUsage() const;
   
@@ -105,4 +130,6 @@ private:
   
 } // of namespace flightgear
 
+void fgSetDefaults();
+
 #endif /* _OPTIONS_HXX */