Code Search for Developers
 
 
  

SConfigManager.h from osgDesigner at Krugle


Show SConfigManager.h syntax highlighted

#ifndef __CCONFIGMANAGER_H__
#define __CCONFIGMANAGER_H__ 1

#include <osgDesigner/core/CConfig.h>

#include <iostream>
#include <string>
#include <fstream>
#include <boost/filesystem/path.hpp>

namespace osgDesigner
{
    class SConfigManager
    {
        typedef CConfig::OptionIterator                         OptionIterator;
        
        public:
        	SConfigManager();
        	virtual ~SConfigManager();
        
        	static SConfigManager*	        instance();
        	void			                save();
        	void			                load();
        	
      		//get	CConfig members
            const std::string               getPluginDirectory() const;

            const std::string               getLastOpenDirectory() const;
            void                    		setLastOpenDirectory(std::string dir);
            
            const boost::filesystem::path	getLastRenderPlugin() const;
            void							setLastRenderPlugin(std::string plugin);
            bool                            getAutoStartRender();
            void                            setAutoStartRender(bool start);
            
            const std::list<std::string>&   getRecentFileList() const;
            void                            addRecentFile(const std::string& fileName);
            
            
            void                            addOption(std::string key, std::string value);
            std::string                     getOption(std::string key) const;
            
            std::list<std::string>&         recentFileList();
            const std::list<std::string>&   recentFileList() const;
    
            std::list<std::string>&         wrapperLoadedList();
            const std::list<std::string>&   wrapperLoadedList() const;
            
            std::list<std::string>&         renderLoadedList();
            const std::list<std::string>&   renderLoadedList() const;
            
            std::list<std::string>&         editorLoadedList();
            const std::list<std::string>&   editorLoadedList() const;        
            
        private:
            void                            serialize(std::string filename);
            void                            deSerialize(std::string filename);
            boost::filesystem::path			getHomeDirectory();

            CConfig                         _conf;
    };
    
    inline const std::string                SConfigManager::getPluginDirectory() const  
    { return (_conf.m_pluginDirectory); }

    inline const std::string                SConfigManager::getLastOpenDirectory() const
    { return (_conf.m_lastOpenDirectory); }
    
    inline const boost::filesystem::path    SConfigManager::getLastRenderPlugin() const  
    { return (boost::filesystem::path(_conf.m_lastRenderPlugin, boost::filesystem::native)); }
    
    inline  void			               	SConfigManager::setLastRenderPlugin(std::string plugin)
    { _conf.m_lastRenderPlugin = plugin; }
    
    inline void                             SConfigManager::setLastOpenDirectory(std::string    dir)    
    { _conf.m_lastOpenDirectory = dir; }

    inline  void                            SConfigManager::setAutoStartRender(bool start)
    { if (start) _conf.m_autoStartRender = "true"; else _conf.m_autoStartRender = "false"; }

    inline  bool                            SConfigManager::getAutoStartRender()
    { if (_conf.m_autoStartRender == "true") return (true); else return(false); }
    
    inline const std::list<std::string>&	SConfigManager::getRecentFileList() const  
    { return (_conf.m_recentFileList); }
    
    inline void                             SConfigManager::addOption(std::string key, std::string value)
    { _conf.m_optionMap[key] = value; }
    
    inline std::list<std::string>&          SConfigManager::wrapperLoadedList()
    { return (_conf.m_wrapperLoadedList); }
    inline const std::list<std::string>&    SConfigManager::wrapperLoadedList() const
    { return (_conf.m_wrapperLoadedList); }
    
    inline std::list<std::string>&          SConfigManager::renderLoadedList()
    { return (_conf.m_renderLoadedList); }
    inline const std::list<std::string>&    SConfigManager::renderLoadedList() const
    { return (_conf.m_renderLoadedList); }
    
    inline std::list<std::string>&          SConfigManager::editorLoadedList()
    { return (_conf.m_editorLoadedList); }
    inline const std::list<std::string>&    SConfigManager::editorLoadedList() const
    { return (_conf.m_editorLoadedList); }
}


#endif // ** __CCONFIGMANAGER_H__ ** //




See more files for this project here

osgDesigner

osgDesigner is a graphical tool used to modify an OpenSceneGraph (OSG) scene using the osgIntrospection framework. OpenSceneGraph developpers will be able to extend osgDesigner at need using (editor | render | osgIntrospection wrapper) plugin system.

Project homepage: http://sourceforge.net/projects/osgdesigner
Programming language(s): C++,Shell Script
License: other

  CConfig.h
  CFileMenu.h
  CMainWindow.h
  CPropertiesModel.h
  CPropertiesView.h
  CPropertiesWidget.h
  CPropertyInfoModel.h
  CSceneGraphEditMenu.h
  CSceneGraphModel.h
  CSceneGraphView.h
  CSceneGraphWidget.h
  CTypeModel.h
  CTypeWidget.h
  CValueMimeData.h
  CValueModel.h
  CValueView.h
  Export.h
  FlagsConstructorDialog.h
  FlowLayout.h
  IEditorWidgetABC.h
  IListModel.h
  ITreeModel.h
  MACRO.h
  PluginManagerDialog.h
  SConfigManager.h
  SWorkSpace.h