Source-highlight Library
|
00001 // 00002 // Author: Lorenzo Bettini <http://www.lorenzobettini.it>, (C) 2004-2008 00003 // 00004 // Copyright: See COPYING file that comes with this distribution 00005 // 00006 00007 #ifndef LANGDEFMANAGER_H_ 00008 #define LANGDEFMANAGER_H_ 00009 00010 #include <map> 00011 00012 #include "highlightstate.h" 00013 00014 namespace srchilite { 00015 00017 typedef std::map<std::string, HighlightStatePtr> HighlightStateCache; 00018 00019 class HighlightRuleFactory; 00020 class LangElems; 00021 00025 class LangDefManager { 00027 HighlightRuleFactory *ruleFactory; 00028 00030 HighlightStateCache highlightStateCache; 00031 public: 00035 LangDefManager(HighlightRuleFactory *ruleFactory); 00036 ~LangDefManager(); 00037 00045 HighlightStatePtr buildHighlightState(const std::string &path, 00046 const std::string &file); 00047 00057 HighlightStatePtr getHighlightState(const std::string &path, 00058 const std::string &file); 00059 00068 HighlightStatePtr getHighlightState(const std::string &file); 00069 00076 LangElems *getLangElems(const std::string &path, const std::string &file); 00077 00078 const HighlightRuleFactory *getRuleFactory() const { 00079 return ruleFactory; 00080 } 00081 }; 00082 00083 } 00084 00085 #endif /*LANGDEFMANAGER_H_*/