]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/options.hxx
apt.dat parser: clearer log and exception messages
[flightgear.git] / src / Main / options.hxx
index 7765ecffee7a7f5f2e98156abfbf0d53e21e87bd..4f618213b55c45afc80bca1df8171f012f261e9f 100644 (file)
@@ -35,6 +35,15 @@ class SGPath;
 namespace flightgear
 {
 
+    /**
+     * return the default platform dependant download directory.
+     * This must be a user-writeable location, the question is if it should
+     * be a user visible location. On Windows we default to a subdir of
+     * Documents (FlightGear), on Unixes we default to FG_HOME, which is
+     * typically invisible.
+     */
+    std::string defaultDownloadDir();
+
 /// option processing can have various result values
 /// depending on what the user requested. Note processOptions only
 /// returns a subset of these.
@@ -92,13 +101,25 @@ public:
     * This can be used to inject option values, eg based upon environment variables
     */
   int addOption(const std::string& key, const std::string& value);
-  
+
+  /**
+   * set an option, overwriting any existing value which might be set
+   */
+  int setOption(const std::string& key, const std::string& value);
+
+  void clearOption(const std::string& key);
+
   /**
    * apply option values to the simulation state
    * (set properties, etc). 
    */
   OptionResult processOptions();
-  
+
+    /**
+     * process command line options relating to scenery / aircraft / data paths
+     */
+    void initPaths();
+
   /**
    * init the aircraft options
    */
@@ -113,16 +134,30 @@ public:
    * the value of the option here.
    */
   bool shouldLoadDefaultConfig() const;
+
+  /**
+   * check if the arguments array contains a particular string (with a '--' or
+   * '-' prefix).
+   * Used by early startup code before Options object is created
+   */
+  static bool checkForArg(int argc, char* argv[], const char* arg);
+
+      std::string platformDefaultRoot() const;
 private:
   void showUsage() const;
   
   int parseOption(const std::string& s);
   
   void processArgResult(int result);
-  
-  void setupRoot();
-  
-  std::string platformDefaultRoot() const;
+
+    /**
+     * Setup the root base, and check it's valid. Bails out with exit(-1) if
+     * the root package was not found or is the incorrect version. Argv/argv
+     * are passed since we might potentially show a GUI dialog at this point
+     * to help the user our (finding a base package), and hence need to init Qt.
+     */
+  void setupRoot(int argc, char **argv);
+
   
   class OptionsPrivate;
   std::auto_ptr<OptionsPrivate> p;
@@ -130,4 +165,6 @@ private:
   
 } // of namespace flightgear
 
+void fgSetDefaults();
+
 #endif /* _OPTIONS_HXX */