SHAPER
9.12.0
|
Class to process plugins.xml - definition of plugins (scripts, libraries). More...
Public Member Functions | |
CONFIG_EXPORT | Config_ModuleReader (const char *theEventGenerated=0) |
Constructor. More... | |
virtual CONFIG_EXPORT | ~Config_ModuleReader () |
Destructor. More... | |
CONFIG_EXPORT const std::map< std::string, std::string > & | featuresInFiles () const |
Returns map that describes which file contains a feature (the feature is key, the file is value) More... | |
CONFIG_EXPORT const std::map< std::string, std::string > & | proprietaryFeatures () const |
Returns map containing features, which have licensed. More... | |
CONFIG_EXPORT const std::set< std::string > & | proprietaryPlugins () const |
Returns proprietary plugins. More... | |
CONFIG_EXPORT const std::set< std::string > & | modulePluginFiles () const |
Returns list of module's xml files. More... | |
CONFIG_EXPORT std::string | getModuleName () |
Returns module name: an xml attribute from the root of the plugins.xml: e.g. More... | |
CONFIG_EXPORT void | readAll () |
CONFIG_EXPORT xmlNodePtr | findRoot (const std::string theDocumentPath="") |
CONFIG_EXPORT const char * | encoding () const |
Static Public Member Functions | |
static CONFIG_EXPORT void | loadPlugin (const std::string &thePluginName) |
Detects type of the given plugin and loads it using loadLibrary or loadScript. More... | |
static CONFIG_EXPORT void | loadLibrary (const std::string &theLibName) |
loads the library with specific name, appends "lib*.dll" or "*.so" depending on the platform More... | |
static CONFIG_EXPORT void | loadScript (const std::string &theFileName, bool theSendErr=true) |
loads the python module with specified name More... | |
static CONFIG_EXPORT void | addDependencyModule (const std::string &theModuleName) |
static CONFIG_EXPORT std::string | resourcesConfigFile () |
static CONFIG_EXPORT std::string | pluginConfigFile () |
static CONFIG_EXPORT std::string | findConfigFile (const std::string theFileName, const int theFindIndex=0) |
Checks all possible paths to configuration file given Uses theFindIndex if several solutions can be found (this is the number of solution to find) More... | |
Protected Member Functions | |
virtual void | processNode (xmlNodePtr aNode) |
Recursively process the given xmlNode. More... | |
virtual bool | processChildren (xmlNodePtr aNode) |
Defines if the reader should process children of the given node. More... | |
bool | hasRequiredModules (xmlNodePtr aNode) const |
check if dependencies of the given node are in the list of loaded modules More... | |
std::list< std::string > | importPlugin (const std::string &thePluginLibrary, const std::string &thePluginFile, const std::string &thePluginDocSection) |
reads info about plugin's features from plugin xml description More... | |
std::string | addPlugin (const std::string &aPluginLibrary, const std::string &aPluginScript, const std::string &aPluginConf) |
stores information about plugin in the internal cache More... | |
void | addFeature (const std::string &theFeatureName, const std::string &thePluginConfig) |
Save feature in myFeaturesInFiles. More... | |
void | addFeatureRequireLicense (const std::string &theFeatureName, const std::string &thePluginConfig) |
Save feature in myFeaturesRequireLicense. More... | |
virtual void | cleanup (xmlNodePtr aNode) |
void | readRecursively (xmlNodePtr theParent) |
xmlNodePtr | node (void *theNode) |
void* -> xmlNodePtr More... | |
std::string | getNodeName (xmlNodePtr theNode) |
Gets xml node name. More... | |
void | storeAttribute (xmlNodePtr theNode, const char *theNodeAttribute, bool doClean=false) |
Stores an attribute in internal map for later use. More... | |
std::string | restoreAttribute (xmlNodePtr theNode, const char *theNodeAttribute) |
Restores an attribute from internal map. More... | |
std::string | restoreAttribute (const char *theNodeName, const char *theNodeAttribute) |
Restores an attribute from internal map. More... | |
bool | cleanupAttribute (xmlNodePtr theNode, const char *theNodeAttribute) |
Cleanups attribute from cache. More... | |
bool | cleanupAttribute (const char *theNodeName, const char *theNodeAttribute) |
Cleanups attribute from cache. More... | |
Protected Attributes | |
std::string | myDocumentPath |
Path to the xml document. More... | |
xmlDocPtr | myXmlDoc |
Root of the xml document. More... | |
std::string | myRootFileName |
name of the root file More... | |
std::map< std::string, std::string > | myCachedAttributes |
A map to store all parent's attributes. More... | |
bool | isFromMemory |
Class to process plugins.xml - definition of plugins (scripts, libraries).
Config_ModuleReader::Config_ModuleReader | ( | const char * | theEventGenerated = 0 | ) |
Constructor.
|
virtual |
Destructor.
const std::map< std::string, std::string > & Config_ModuleReader::featuresInFiles | ( | ) | const |
Returns map that describes which file contains a feature (the feature is key, the file is value)
const std::map< std::string, std::string > & Config_ModuleReader::proprietaryFeatures | ( | ) | const |
Returns map containing features, which have licensed.
The valid license should be confirmed first (the feature is key, the file is value)
const std::set< std::string > & Config_ModuleReader::proprietaryPlugins | ( | ) | const |
Returns proprietary plugins.
const std::set< std::string > & Config_ModuleReader::modulePluginFiles | ( | ) | const |
Returns list of module's xml files.
std::string Config_ModuleReader::getModuleName | ( | ) |
Returns module name: an xml attribute from the root of the plugins.xml: e.g.
Get module name from plugins.xml (property "module")
|
static |
Detects type of the given plugin and loads it using loadLibrary or loadScript.
|
static |
loads the library with specific name, appends "lib*.dll" or "*.so" depending on the platform
|
static |
loads the python module with specified name
theFileName | name of the script |
theSendErr | send error message in case of faile |
|
static |
Extends set of modules, used for dependency checking (if there is no required module in the set, a plugin will not be loaded)
|
protectedvirtual |
Recursively process the given xmlNode.
Reimplemented from Config_XMLReader.
|
protectedvirtual |
Defines if the reader should process children of the given node.
Reimplemented from Config_XMLReader.
|
protected |
check if dependencies of the given node are in the list of loaded modules
|
protected |
reads info about plugin's features from plugin xml description
|
protected |
stores information about plugin in the internal cache
|
protected |
Save feature in myFeaturesInFiles.
Generates an error if the feature name is already registered.
|
protected |
Save feature in myFeaturesRequireLicense.
Generates an error if the feature name is already registered.
|
staticinherited |
Returns a path to resource files (created from ROOT_DIR environment variable)
|
staticinherited |
Returns a path to the plugins.xml file (created from ROOT_DIR environment variable)
|
inherited |
Read all nodes in associated xml file, recursively if processChildren(xmlNode) is true for the xmlNode. For each read node the processNode will be called.
|
inherited |
Returns xmlNodePtr to the root of reader's document or NULL if not found. If the path to the document to read is empty, uses myDocumentPath.
|
staticinherited |
Checks all possible paths to configuration file given Uses theFindIndex if several solutions can be found (this is the number of solution to find)
|
protectedvirtualinherited |
This method gives an ability to finalize processing of a node, when reader is about to leave the node (node and all it's children are processed)
Reimplemented in Config_ValidatorReader, and Config_FeatureReader.
|
protectedinherited |
Calls processNode() for each child (for some - recursively) of the given node.
|
protectedinherited |
void* -> xmlNodePtr
|
protectedinherited |
Gets xml node name.
|
protectedinherited |
Stores an attribute in internal map for later use.
Key is "Node_Name:Node_Attribute" and value is getProperty(theNodeAttribute)
|
protectedinherited |
Restores an attribute from internal map.
|
protectedinherited |
Restores an attribute from internal map.
|
protectedinherited |
Cleanups attribute from cache.
|
protectedinherited |
Cleanups attribute from cache.
|
protectedinherited |
Path to the xml document.
|
protectedinherited |
Root of the xml document.
|
protectedinherited |
name of the root file
|
protectedinherited |
A map to store all parent's attributes.
The key has from "Node_Name:Node_Attribute"