SystemPaths.hh
00001 /*
00002  * Copyright 2011 Nate Koenig & Andrew Howard
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  *
00016 */
00017 /* Desc: Gazebo configuration on this computer 
00018  * Date: 3 May 2008
00019  */
00020 
00021 #ifndef GAZEBOCONFIG_HH
00022 #define GAZEBOCONFIG_HH
00023 
00024 #include <string>
00025 #include <list>
00026 #include <stdio.h>
00027 
00028 #include "common/SingletonT.hh"
00029 
00030 #define LINUX
00031 #ifdef WINDOWS
00032  #include <direct.h>
00033  #define GetCurrentDir _getcwd
00034 #else
00035  #include <unistd.h>
00036  #define GetCurrentDir getcwd
00037 #endif
00038 
00039 namespace gazebo
00040 {
00041   namespace common
00042   {
00045 
00047     class SystemPaths : public SingletonT<SystemPaths>
00048     {
00049       private: SystemPaths();
00050 
00052       public: std::string GetLogPath() const;
00053 
00055       public: const std::list<std::string> &GetGazeboPaths(); 
00056 
00058       public: const std::list<std::string> &GetOgrePaths(); 
00059 
00061       public: const std::list<std::string> &GetPluginPaths(); 
00062 
00064       public: std::string GetModelPathExtension();
00065 
00067       public: std::string GetWorldPathExtension();
00068 
00069       public: std::string FindFileWithGazeboPaths(std::string filename);
00070 
00072       public: void AddGazeboPaths(std::string path);
00073 
00075       public: void AddOgrePaths(std::string path);
00076    
00078       public: void AddPluginPaths(std::string path);
00079 
00080       public: void ClearGazeboPaths();
00081       public: void ClearOgrePaths();
00082       public: void ClearPluginPaths();
00083  
00085       private: std::list<std::string> gazeboPaths;
00086       
00088       private: std::list<std::string> ogrePaths;
00089 
00091       private: std::list<std::string> pluginPaths;
00092 
00093       private: std::string logPath;
00094  
00095       private: friend class SingletonT<SystemPaths>;
00096     };
00098   }
00099 }
00100 #endif