Source-highlight Library
srchilite::LangDefManager Class Reference

Handles langdef language definition files. More...

#include <langdefmanager.h>

Collaboration diagram for srchilite::LangDefManager:

Public Member Functions

 LangDefManager (HighlightRuleFactory *ruleFactory)
 
HighlightStatePtr buildHighlightState (const std::string &path, const std::string &file)
 Builds the HighlightState corresponding to the language definition by the specified file, using the specified path. More...
 
HighlightStatePtr getHighlightState (const std::string &path, const std::string &file)
 Gets the HighlightState corresponding to the language definition file, using the specified path. More...
 
HighlightStatePtr getHighlightState (const std::string &file)
 Gets the HighlightState corresponding to the language definition by the specified file, using the default path for language definition files (either stored in the user home setting configuration file or the default hardcoded one). More...
 
LangElemsgetLangElems (const std::string &path, const std::string &file)
 Returns the language elements of the specified language definition file. More...
 
const HighlightRuleFactorygetRuleFactory () const
 

Private Attributes

HighlightRuleFactoryruleFactory
 the factory for creating highlight rules
 
HighlightStateCache highlightStateCache
 store already generated HighlightState specific to a given file name
 

Detailed Description

Handles langdef language definition files.

Constructor & Destructor Documentation

srchilite::LangDefManager::LangDefManager ( HighlightRuleFactory ruleFactory)
Parameters
ruleFactorythe factory for creating highlight rules

Member Function Documentation

HighlightStatePtr srchilite::LangDefManager::buildHighlightState ( const std::string &  path,
const std::string &  file 
)

Builds the HighlightState corresponding to the language definition by the specified file, using the specified path.

Parameters
paththe path that is used for searching for the file and included files
filethe name of the language definition file
Returns
the HighlightState built using the language definitions
HighlightStatePtr srchilite::LangDefManager::getHighlightState ( const std::string &  path,
const std::string &  file 
)

Gets the HighlightState corresponding to the language definition file, using the specified path.

If the language definition file was already inspected, then it won't rebuild the HighlightState, but it will reuse the previously built one.

Parameters
paththe path that is used for searching for the file and included files
filethe name of the language definition file
Returns
the HighlightState built using the language definitions
HighlightStatePtr srchilite::LangDefManager::getHighlightState ( const std::string &  file)

Gets the HighlightState corresponding to the language definition by the specified file, using the default path for language definition files (either stored in the user home setting configuration file or the default hardcoded one).

Parameters
filethe name of the language definition file
Returns
the HighlightState built using the language definitions
LangElems * srchilite::LangDefManager::getLangElems ( const std::string &  path,
const std::string &  file 
)

Returns the language elements of the specified language definition file.

Parameters
path
file
Returns
the language elements of the specified language definition file.

The documentation for this class was generated from the following files: