Source-highlight Library
langdefmanager.h
1 //
2 // Author: Lorenzo Bettini <http://www.lorenzobettini.it>, (C) 2004-2008
3 //
4 // Copyright: See COPYING file that comes with this distribution
5 //
6 
7 #ifndef LANGDEFMANAGER_H_
8 #define LANGDEFMANAGER_H_
9 
10 #include <map>
11 
12 #include "highlightstate.h"
13 
14 namespace srchilite {
15 
17 typedef std::map<std::string, HighlightStatePtr> HighlightStateCache;
18 
20 class LangElems;
21 
28 
30  HighlightStateCache highlightStateCache;
31 public:
36  ~LangDefManager();
37 
45  HighlightStatePtr buildHighlightState(const std::string &path,
46  const std::string &file);
47 
57  HighlightStatePtr getHighlightState(const std::string &path,
58  const std::string &file);
59 
68  HighlightStatePtr getHighlightState(const std::string &file);
69 
76  LangElems *getLangElems(const std::string &path, const std::string &file);
77 
78  const HighlightRuleFactory *getRuleFactory() const {
79  return ruleFactory;
80  }
81 };
82 
83 }
84 
85 #endif /*LANGDEFMANAGER_H_*/
LangDefManager(HighlightRuleFactory *ruleFactory)
Definition: langdefmanager.cpp:23
HighlightStateCache highlightStateCache
store already generated HighlightState specific to a given file name
Definition: langdefmanager.h:30
collection of LangElem objects
Definition: langelems.h:33
C++ class: doctemplate.h.
Definition: bufferedoutput.cpp:13
Abstract factory for highlighting rules.
Definition: highlightrulefactory.h:23
std::map< std::string, HighlightStatePtr > HighlightStateCache
store already generated HighlightState specific to a given file name
Definition: langdefmanager.h:17
Handles langdef language definition files.
Definition: langdefmanager.h:25
LangElems * getLangElems(const std::string &path, const std::string &file)
Returns the language elements of the specified language definition file.
Definition: langdefmanager.cpp:70
HighlightStatePtr getHighlightState(const std::string &path, const std::string &file)
Gets the HighlightState corresponding to the language definition file, using the specified path...
Definition: langdefmanager.cpp:47
HighlightRuleFactory * ruleFactory
the factory for creating highlight rules
Definition: langdefmanager.h:27
boost::shared_ptr< HighlightState > HighlightStatePtr
the reference to an HighlightState
Definition: highlightstate.h:38
HighlightStatePtr buildHighlightState(const std::string &path, const std::string &file)
Builds the HighlightState corresponding to the language definition by the specified file...
Definition: langdefmanager.cpp:30