]> git.lyx.org Git - lyx.git/blobdiff - src/support/Package.h
CMake: fix merged build, seems GCC could not handle the namespaces correctly
[lyx.git] / src / support / Package.h
index e5989459f579aab3f164ece3069c24fa48bba0da..a8617632182174e1e3ae25111150e21246aad26e 100644 (file)
@@ -12,8 +12,9 @@
  * by LyX. These paths differ markedly from one OS to another,
  * following the local Windows, MacOS X or Posix conventions.
  */
-#ifndef LYX_PACHAGE_H
-#define LYX_PACHAGE_H
+
+#ifndef PACKAGE_H
+#define PACKAGE_H
 
 #include "support/FileName.h"
 
@@ -59,7 +60,7 @@ Package const & package();
 class Package {
 public:
        /// Default constructor does not lead to the paths being set.
-       Package();
+       Package() {}
 
        /** Called by init_package, above.
         *  All paths will be initialized.
@@ -71,7 +72,7 @@ public:
 
        /** The directory containing the LyX executable.
         */
-       FileName const & binary_dir() const;
+       FileName const & binary_dir() const { return binary_dir_; }
 
        /** The top of the LyX source code tree.
         */
@@ -80,42 +81,45 @@ public:
        /** The path to the system-level support files
         *  we're actually going to use.
         */
-       FileName const & system_support() const;
+       FileName const & system_support() const { return system_support_dir_; }
 
        /** The path to the autogenerated support files
         *  when running in-place.
         */
-       FileName const & build_support() const;
+       FileName const & build_support() const { return build_support_dir_; }
 
        /** The path to the user-level support files.
         */
-       FileName const & user_support() const;
+       FileName const & user_support() const { return user_support_dir_; }
 
        /** The user_support directory was set explicitly using either
         *  the -userdir command line switch or
-        *  the LYX_USERDIR_15x environment variable.
+        *  the LYX_USERDIR_${major}${minor}x environment variable.
         */
-       bool explicit_user_support() const;
+       bool explicit_user_support() const { return explicit_user_support_dir_; }
 
        /** The path to the locale directory.
         */
-       FileName const & locale_dir() const;
+       FileName const & locale_dir() const { return locale_dir_; }
 
        /** The default document directory.
         *  Can be reset by LyXRC.
         */
-       FileName & document_dir() const;
+       FileName & document_dir() const { return document_dir_; }
 
        /** The path to the system temporary directory.
         *  (Eg /tmp on *nix.)
         */
-       FileName const & system_temp_dir() const;
+       FileName const & system_temp_dir() const { return system_temp_dir_; }
 
-       /** The path to the temporary directory used by LyX.
+       //@{
+       /** The path to the temporary directory used by %LyX.
         *  (Eg /tmp/lyx_tmpdir800nBI1z9 on *nix.)
         *  Can be reset by LyXRC.
         */
-       FileName & temp_dir() const;
+       FileName const & temp_dir() const { return temp_dir_; }
+       void set_temp_dir(FileName const & temp_dir) const;
+       //@}
 
        /** Used when setting the user_support directory.
         *  Used also when expanding "~/" or contracting to "~/". (filetools.cpp)
@@ -123,13 +127,13 @@ public:
         *  for the dump.
         *  This may be empty (e. g. when run under a CGI environment)
         */
-       FileName const & home_dir() const;
+       FileName const & home_dir() const { return home_dir_; }
 
        /** Command to run the configure script.
         *  Caution: This is "ready-to-run", i.e. in the locale encoding, not
         *  utf8.
         */
-       std::string const & configure_command() const;
+       std::string const & configure_command() const { return configure_command_; }
 
 private:
        FileName binary_dir_;
@@ -145,77 +149,7 @@ private:
        bool explicit_user_support_dir_;
 };
 
-
-inline
-Package::Package() {}
-
-inline
-FileName const & Package::binary_dir() const
-{
-       return binary_dir_;
-}
-
-inline
-FileName const & Package::system_support() const
-{
-       return system_support_dir_;
-}
-
-inline
-FileName const & Package::build_support() const
-{
-       return build_support_dir_;
-}
-
-inline
-FileName const & Package::user_support() const
-{
-       return user_support_dir_;
-}
-
-inline
-bool Package::explicit_user_support() const
-{
-       return explicit_user_support_dir_;
-}
-
-inline
-FileName const & Package::locale_dir() const
-{
-       return locale_dir_;
-}
-
-inline
-FileName & Package::document_dir() const
-{
-       return document_dir_;
-}
-
-inline
-FileName & Package::temp_dir() const
-{
-       return temp_dir_;
-}
-
-inline
-FileName const & Package::system_temp_dir() const
-{
-       return system_temp_dir_;
-}
-
-inline
-FileName const & Package::home_dir() const
-{
-       return home_dir_;
-}
-
-inline
-std::string const & Package::configure_command() const
-{
-       return configure_command_;
-}
-
 } // namespace support
 } // namespace lyx
 
-#endif // LYX_PACHAGE_H
+#endif // PACKAGE_H