#include <ConfigManager.hpp>
Inherited by pion::platform::PluginConfig< PluginType >, pion::platform::PluginConfig< pion::platform::Codec >, pion::platform::PluginConfig< pion::platform::Database >, pion::platform::PluginConfig< pion::platform::Protocol >, pion::platform::PluginConfig< pion::platform::Reactor >, pion::platform::PluginConfig< pion::server::PlatformService >, pion::platform::VocabularyConfig, pion::platform::VocabularyManager, pion::server::PlatformConfig, and pion::server::UserManager.
Definition at line 40 of file ConfigManager.hpp.
Public Member Functions | |
| virtual | ~ConfigManager () |
| virtual destructor | |
| virtual void | createConfigFile (void) |
| creates a new config file and adds a root Pion "config" element | |
| virtual void | openConfigFile (void) |
| opens an existing config file and finds the root Pion "config" element | |
| void | setConfigFile (const std::string &config_file) |
| sets the name of the config file to use | |
| const std::string & | getConfigFile (void) const |
| returns the name of the config file being used | |
| bool | configIsOpen (void) const |
| returns true if the config file is open and being used | |
| void | setLogger (PionLogger log_ptr) |
| sets the logger to be used | |
| PionLogger | getLogger (void) |
| returns the logger currently in use | |
| void | setDataDirectory (const std::string &dir) |
| sets the directory in which data files are stored | |
| const std::string & | getDataDirectory (void) const |
| returns the directory in which data files are stored | |
| void | resetDataDirectory (void) |
| resets the data file directory to the same path as the config file | |
| void | setDebugMode (bool b) |
| sets the "debug mode" flag | |
| bool | getDebugMode (void) const |
| returns true if pion is running in "debug mode" | |
| void | removeConfigFile (void) |
| removes the config file (after backing it up) | |
| virtual void | writeConfigXML (std::ostream &out) const |
| std::string | createUUID (void) |
| returns a string containing a new UUID value | |
| std::string | createFilename (void) |
| returns a unique XML filename based on a UUID | |
| std::string | createFilename (const std::string &file_path) |
| std::string | resolveRelativePath (const std::string &orig_path) const |
Static Public Member Functions | |
| static xmlDocPtr | getConfigFromFile (const std::string &config_file, const std::string &root_element_name, xmlNodePtr &config_ptr, PionLogger &logger) |
| static void | writeConfigXML (std::ostream &out, xmlNodePtr config_node, bool include_siblings=false) |
| static void | writeConfigXMLHeader (std::ostream &out) |
| static void | writeBeginPionConfigXML (std::ostream &out) |
| static void | writeEndPionConfigXML (std::ostream &out) |
| static void | writeBeginPionStatsXML (std::ostream &out) |
| static void | writeEndPionStatsXML (std::ostream &out) |
| static std::string | xml_encode (const std::string &str) |
| encodes strings so that they are safe for XML (this & that) | |
| static xmlNodePtr | createPluginConfig (const std::string &plugin_type) |
| static xmlNodePtr | createResourceConfig (const std::string &resource_name, const char *buf, std::size_t len) |
| static bool | getNodeId (xmlNodePtr config_node, std::string &node_id) |
| static xmlNodePtr | findConfigNodeByName (const std::string &element_name, xmlNodePtr starting_node) |
| static xmlNodePtr | findConfigNodeByContent (const std::string &element_name, const std::string &content_value, xmlNodePtr starting_node) |
| static xmlNodePtr | findConfigNodeByAttr (const std::string &element_name, const std::string &attr_name, const std::string &attr_value, xmlNodePtr starting_node) |
| static bool | getConfigOption (const std::string &option_name, std::string &option_value, const xmlNodePtr starting_node) |
| static bool | getConfigOptionEmptyOk (const std::string &option_name, std::string &option_value, const xmlNodePtr starting_node) |
| static std::string | getAttribute (const char *name, const xmlNodePtr ptr) |
| static std::string | getAttribute (const std::string &name, const xmlNodePtr ptr) |
| template<typename ValueType> | |
| static bool | getConfigOption (const std::string &option_name, ValueType &option_value, const xmlNodePtr starting_node) |
| template<typename ValueType> | |
| static bool | getConfigOption (const std::string &option_name, ValueType &option_value, const ValueType &default_value, const xmlNodePtr starting_node) |
| static bool | updateConfigOption (const std::string &option_name, const std::string &option_value, xmlNodePtr parent_node) |
| static std::string | resolveRelativePath (const std::string &base_path_to_file, const std::string &orig_path) |
Protected Member Functions | |
| ConfigManager (const std::string &default_config_file) | |
| void | closeConfigFile (void) |
| closes the config file | |
| void | saveConfigFile (void) |
| saves the config file (after backing up the existing copy) | |
| void | backupConfigFile (void) |
| creates a backup copy of the config file (if it exists) | |
| void | openPluginConfig (const std::string &plugin_name) |
| bool | setPluginConfig (xmlNodePtr plugin_node_ptr, xmlNodePtr config_ptr) |
| void | setPluginConfig (const std::string &plugin_name, const std::string &plugin_id, const xmlNodePtr config_ptr) |
| void | addPluginConfig (const std::string &plugin_name, const std::string &plugin_id, const std::string &plugin_type, const xmlNodePtr config_ptr=NULL) |
| void | removePluginConfig (const std::string &plugin_name, const std::string &plugin_id) |
| virtual void | addPluginNoLock (const std::string &plugin_id, const std::string &plugin_name, const xmlNodePtr config_ptr) |
Protected Attributes | |
| PionLogger | m_logger |
| primary logging interface used by this class | |
| PionIdGenerator | m_id_gen |
| UUID generator. | |
| std::string | m_config_file |
| name of the XML config file being used | |
| std::string | m_data_directory |
| directory in which data files are stored (from platform configuration) | |
| bool | m_debug_mode |
| true if pion is running in "debug mode" | |
| xmlDocPtr | m_config_doc_ptr |
| pointer to the root of the XML document tree (if libxml support is enabled) | |
| xmlNodePtr | m_config_node_ptr |
| pointer to the root configuration node ("config") in the XML document tree | |
Static Protected Attributes | |
| static const std::string | XML_FILE_EXTENSION = ".xml" |
| extension added to the name of XML files | |
| static const std::string | BACKUP_FILE_EXTENSION = ".bak" |
| extension added to the name of backup files | |
| static const std::string | CONFIG_NAMESPACE_URL = "http://purl.org/pion/config" |
| URL associated with the Pion "config" namespace. | |
| static const std::string | ROOT_ELEMENT_NAME = "PionConfig" |
| name of the root element for Pion XML config files | |
| static const std::string | STATS_ELEMENT_NAME = "PionStats" |
| name of the statistics element for Pion XML config files | |
| static const std::string | PLUGIN_ELEMENT_NAME = "Plugin" |
| name of the plug-in type element for Pion XML config files | |
| static const std::string | NAME_ELEMENT_NAME = "Name" |
| name of the descriptive name element for Pion XML config files | |
| static const std::string | COMMENT_ELEMENT_NAME = "Comment" |
| name of the comment element for Pion XML config files | |
| static const std::string | PION_VERSION_ATTRIBUTE_NAME = "pion_version" |
| name of the attribute for the Pion version number | |
| static const std::string | ID_ATTRIBUTE_NAME = "id" |
| name of the unique identifier attribute for Pion XML config files | |
Classes | |
| class | AddPluginConfigException |
| exception thrown if there is an error adding a plug-in to the config file More... | |
| class | BadXMLBufferException |
| exception thrown if the buffer is NULL or has length zero More... | |
| class | ConfigAlreadyOpenException |
| exception thrown if you try to open a config file when it is already open More... | |
| class | ConfigFileExistsException |
| exception thrown if you try to create a config file that already exists More... | |
| class | ConfigNotOpenException |
| exception thrown if you try modifying something before opening the config file More... | |
| class | EmptyPluginElementException |
| exception thrown if the plug-in config does not include a plug-in element More... | |
| class | EmptyPluginIdException |
| exception thrown if the config file contains a plug-in with a missing identifier More... | |
| class | InitializeRootConfigException |
| exception thrown if there is an error initializing a new config file's root element More... | |
| class | MissingConfigFileException |
| exception thrown if you try to open a config file that does not exist More... | |
| class | MissingResourceElementException |
| exception thrown if the requested resource element is not found More... | |
| class | MissingRootElementException |
| exception thrown if the root configuration element is not found More... | |
| class | ReadConfigException |
| exception thrown if there is an error reading a config file More... | |
| class | RemovePluginConfigException |
| exception thrown if there is an error removing a plug-in from the config file More... | |
| class | UpdateConfigException |
| exception thrown if there is an error updating the configuration in memory More... | |
| class | UpdatePluginConfigException |
| exception thrown if there is an error updating a plug-in in the config file More... | |
| class | WriteConfigException |
| exception thrown if there is an error writing a config file More... | |
| class | XMLBufferParsingException |
| exception thrown if there is an error parsing XML from memory More... | |
| pion::platform::ConfigManager::ConfigManager | ( | const std::string & | default_config_file | ) | [inline, protected] |
protected constructor: this should only be used by derived classes
| default_config_file | the default configuration file to use |
Definition at line 511 of file ConfigManager.hpp.
| void pion::platform::ConfigManager::addPluginConfig | ( | const std::string & | plugin_name, | |
| const std::string & | plugin_id, | |||
| const std::string & | plugin_type, | |||
| const xmlNodePtr | config_ptr = NULL | |||
| ) | [protected] |
adds a new plug-in object to the configuration file
| plugin_name | the name of the plug-in element node | |
| plugin_id | unique identifier associated with the plug-in | |
| plugin_type | the type of plug-in to load (searches plug-in directories and appends extensions) | |
| config_ptr | pointer to a list of XML nodes containing plug-in configuration parameters |
Definition at line 694 of file ConfigManager.cpp.
References ID_ATTRIBUTE_NAME, m_config_node_ptr, PLUGIN_ELEMENT_NAME, saveConfigFile(), and setPluginConfig().
Referenced by pion::platform::PluginConfig< PluginType >::addPlugin().
| virtual void pion::platform::ConfigManager::addPluginNoLock | ( | const std::string & | plugin_id, | |
| const std::string & | plugin_name, | |||
| const xmlNodePtr | config_ptr | |||
| ) | [inline, protected, virtual] |
adds a new plug-in object (without locking or config file updates). This function must be defined properly for any derived classes that wish to use openPluginConfig().
| plugin_id | unique identifier associated with the plug-in | |
| plugin_name | the name of the plug-in to load (searches plug-in directories and appends extensions) | |
| config_ptr | pointer to a list of XML nodes containing plug-in configuration parameters |
Reimplemented in pion::platform::CodecFactory, pion::platform::DatabaseManager, pion::platform::PluginConfig< PluginType >, pion::platform::ProtocolFactory, pion::server::ServiceManager, pion::platform::PluginConfig< pion::platform::Codec >, pion::platform::PluginConfig< pion::platform::Reactor >, pion::platform::PluginConfig< pion::platform::Database >, pion::platform::PluginConfig< pion::server::PlatformService >, and pion::platform::PluginConfig< pion::platform::Protocol >.
Definition at line 593 of file ConfigManager.hpp.
Referenced by openPluginConfig().
| std::string pion::platform::ConfigManager::createFilename | ( | const std::string & | file_path | ) |
creates a unique XML filename based on a UUID that is located in the given path
| file_path | path where the file will be located |
Definition at line 400 of file ConfigManager.cpp.
References createFilename().
| xmlNodePtr pion::platform::ConfigManager::createPluginConfig | ( | const std::string & | plugin_type | ) | [static] |
returns an XML configuration list for a new Plugin
| plugin_type | the type of new plugin that is being created |
Definition at line 354 of file ConfigManager.cpp.
References PLUGIN_ELEMENT_NAME.
| xmlNodePtr pion::platform::ConfigManager::createResourceConfig | ( | const std::string & | resource_name, | |
| const char * | buf, | |||
| std::size_t | len | |||
| ) | [static] |
uses a memory buffer to generate XML configuration data for a resource
| resource_name | the XML element name for the resource | |
| buf | pointer to a memory buffer containing configuration data | |
| len | number of bytes available in the memory buffer |
Definition at line 361 of file ConfigManager.cpp.
References findConfigNodeByName(), and ROOT_ELEMENT_NAME.
Referenced by pion::platform::ReactionEngine::addReactorConnection(), pion::platform::VocabularyManager::addVocabulary(), pion::platform::CodecFactory::createCodecConfig(), pion::platform::DatabaseManager::createDatabaseConfig(), pion::platform::ProtocolFactory::createProtocolConfig(), pion::platform::ReactionEngine::createReactorConfig(), pion::platform::VocabularyConfig::createTermConfig(), pion::platform::VocabularyConfig::createVocabularyConfig(), and PionPlatformUnitTest::makeReactorConfigFromString().
| xmlNodePtr pion::platform::ConfigManager::findConfigNodeByAttr | ( | const std::string & | element_name, | |
| const std::string & | attr_name, | |||
| const std::string & | attr_value, | |||
| xmlNodePtr | starting_node | |||
| ) | [static] |
searches for an element node within the XML document tree that has a particular attribute value defined
| element_name | the name of the element node to search for | |
| attr_name | the name of the attribute to search for | |
| attr_value | the value that should be assigned to the attribute | |
| starting_node | pointer to the node to start searching with; both it and any following sibling nodes will be checked |
Definition at line 483 of file ConfigManager.cpp.
Referenced by pion::platform::PluginConfig< PluginType >::getPluginConfig(), removePluginConfig(), pion::platform::VocabularyConfig::removeTerm(), pion::platform::VocabularyManager::removeVocabulary(), setPluginConfig(), pion::server::UserManager::setUserConfig(), pion::platform::VocabularyConfig::updateTerm(), pion::server::UserManager::writeConfigXML(), pion::platform::PluginConfig< PluginType >::writeConfigXML(), and pion::server::ServiceManager::writeServerXML().
| xmlNodePtr pion::platform::ConfigManager::findConfigNodeByContent | ( | const std::string & | element_name, | |
| const std::string & | content_value, | |||
| xmlNodePtr | starting_node | |||
| ) | [static] |
searches for an element node within the XML document tree that has a particular content value defined
| element_name | the name of the element node to search for | |
| content_value | the value that should match the element's content | |
| starting_node | pointer to the node to start searching with; both it and any following sibling nodes will be checked |
Definition at line 454 of file ConfigManager.cpp.
| xmlNodePtr pion::platform::ConfigManager::findConfigNodeByName | ( | const std::string & | element_name, | |
| xmlNodePtr | starting_node | |||
| ) | [static] |
searches for an element node within the XML document tree
| element_name | the name of the element node to search for | |
| starting_node | pointer to the node to start searching with; both it and any following sibling nodes will be checked |
Definition at line 433 of file ConfigManager.cpp.
Referenced by createResourceConfig(), pion::server::UserManager::createUserConfig(), getConfigOption(), getConfigOptionEmptyOk(), pion::platform::DatabaseManager::getDatabaseEngineConfig(), pion::platform::VocabularyManager::openConfigFile(), pion::platform::VocabularyConfig::openConfigFile(), pion::platform::ReactionEngine::openConfigFile(), openPluginConfig(), pion::platform::VocabularyConfig::parseTermConfig(), pion::platform::Database::readConfigDetails(), pion::platform::ReactionEngine::restartReactorsThatShouldBeRunning(), pion::platform::RuleChain::setConfig(), pion::platform::DatabaseInserter::setConfig(), setPluginConfig(), pion::platform::ReactionEngine::startReactor(), pion::platform::ReactionEngine::stopReactor(), pion::platform::TransformLookup::TransformLookup(), pion::platform::TransformRegex::TransformRegex(), pion::platform::TransformRules::TransformRules(), updateConfigOption(), pion::platform::VocabularyConfig::updateTerm(), and pion::platform::ReactionEngine::writeStatsXML().
| static std::string pion::platform::ConfigManager::getAttribute | ( | const std::string & | name, | |
| const xmlNodePtr | ptr | |||
| ) | [inline, static] |
get the value of an attribute in a pointed-to XML node
| name | Name, as std::string of the parameter | |
| ptr | xmlNodePtr of the node, to find the attribute in |
Definition at line 413 of file ConfigManager.hpp.
| std::string pion::platform::ConfigManager::getAttribute | ( | const char * | name, | |
| const xmlNodePtr | ptr | |||
| ) | [static] |
get the value of an attribute in a pointed-to XML node
| name | Name, as const char* of the parameter | |
| ptr | xmlNodePtr of the node, to find the attribute in |
Definition at line 550 of file ConfigManager.cpp.
Referenced by pion::platform::Database::readConfigDetails(), and pion::platform::DatabaseInserter::setConfig().
| static bool pion::platform::ConfigManager::getConfigOption | ( | const std::string & | option_name, | |
| ValueType & | option_value, | |||
| const ValueType & | default_value, | |||
| const xmlNodePtr | starting_node | |||
| ) | [inline, static] |
retrieves the value for a simple configuration option that is contained within an XML element node; assigns to default_value if option not found.
| option_name | the name of the option's element node | |
| option_value | will be assigned to the value of the option's element node | |
| default_value | the value assigned if the element node is not found | |
| starting_node | pointer to the node to start searching with; both it and any following sibling nodes will be checked |
Definition at line 455 of file ConfigManager.hpp.
| static bool pion::platform::ConfigManager::getConfigOption | ( | const std::string & | option_name, | |
| ValueType & | option_value, | |||
| const xmlNodePtr | starting_node | |||
| ) | [inline, static] |
retrieves the value for a simple configuration option that is contained within an XML element node.
| option_name | the name of the option's element node | |
| option_value | will be assigned to the value of the option's element node | |
| starting_node | pointer to the node to start searching with; both it and any following sibling nodes will be checked |
Definition at line 430 of file ConfigManager.hpp.
| bool pion::platform::ConfigManager::getConfigOption | ( | const std::string & | option_name, | |
| std::string & | option_value, | |||
| const xmlNodePtr | starting_node | |||
| ) | [static] |
retrieves the value for a simple configuration option that is contained within an XML element node.
| option_name | the name of the option's element node | |
| option_value | the value (text content) of the option's element node | |
| starting_node | pointer to the node to start searching with; both it and any following sibling nodes will be checked |
Definition at line 513 of file ConfigManager.cpp.
References findConfigNodeByName().
Referenced by pion::platform::PluginConfig< PluginType >::addPlugin(), pion::platform::ReactionEngine::addReactorConnection(), pion::platform::VocabularyManager::addVocabulary(), getConfigOptionEmptyOk(), pion::platform::DatabaseManager::getDatabaseEngineConfig(), pion::platform::VocabularyManager::openConfigFile(), pion::platform::VocabularyConfig::openConfigFile(), pion::platform::ReactionEngine::openConfigFile(), pion::server::ServiceManager::openConfigFile(), openPluginConfig(), pion::platform::VocabularyConfig::parseTermConfig(), pion::platform::Database::readConfig(), pion::platform::Database::readConfigDetails(), pion::platform::VocabularyConfig::setConfig(), pion::platform::RuleChain::setConfig(), pion::platform::Protocol::setConfig(), pion::platform::PlatformPlugin::setConfig(), pion::platform::DatabaseInserter::setConfig(), pion::platform::Codec::setConfig(), pion::platform::Reactor::startOutRunning(), pion::platform::TransformAssignTerm::TransformAssignTerm(), pion::platform::TransformLookup::TransformLookup(), pion::platform::TransformRegex::TransformRegex(), and pion::platform::TransformRules::TransformRules().
| bool pion::platform::ConfigManager::getConfigOptionEmptyOk | ( | const std::string & | option_name, | |
| std::string & | option_value, | |||
| const xmlNodePtr | starting_node | |||
| ) | [static] |
retrieves the value for a simple configuration option that is contained within an XML element node. Difference from getConfigOption; see return value
| option_name | the name of the option's element node | |
| option_value | the value (text content) of the option's element node | |
| starting_node | pointer to the node to start searching with; both it and any following sibling nodes will be checked |
Definition at line 538 of file ConfigManager.cpp.
References findConfigNodeByName(), and getConfigOption().
Referenced by pion::platform::RuleChain::setConfig(), pion::platform::TransformAssignValue::TransformAssignValue(), pion::platform::TransformLookup::TransformLookup(), and pion::platform::TransformRules::TransformRules().
| bool pion::platform::ConfigManager::getNodeId | ( | xmlNodePtr | config_node, | |
| std::string & | node_id | |||
| ) | [static] |
retrieves the unique identifier for an XML document node
| config_node | the node to get the identifier for | |
| node_id | will be assigned to the unique identifier for the node |
Definition at line 422 of file ConfigManager.cpp.
References ID_ATTRIBUTE_NAME.
Referenced by pion::server::UserManager::createUserConfig(), pion::platform::VocabularyManager::openConfigFile(), pion::platform::VocabularyConfig::openConfigFile(), pion::platform::ReactionEngine::openConfigFile(), pion::server::UserManager::openConfigFile(), pion::server::ServiceManager::openConfigFile(), openPluginConfig(), pion::platform::ReactionEngine::restartReactorsThatShouldBeRunning(), pion::platform::ReactionEngine::startReactor(), pion::platform::ReactionEngine::stopReactor(), and pion::platform::ReactionEngine::writeStatsXML().
| void pion::platform::ConfigManager::openPluginConfig | ( | const std::string & | plugin_name | ) | [protected] |
opens a plug-in configuration file and loads all of the plug-ins that it contains by calling addPluginNoLock()
| plugin_name | the name of the plug-in element node |
Definition at line 592 of file ConfigManager.cpp.
References addPluginNoLock(), findConfigNodeByName(), getConfigFile(), getConfigOption(), getNodeId(), m_config_node_ptr, openConfigFile(), and PLUGIN_ELEMENT_NAME.
Referenced by pion::platform::ReactionEngine::openConfigFile(), and pion::platform::PluginConfig< pion::platform::Protocol >::openConfigFile().
| void pion::platform::ConfigManager::removePluginConfig | ( | const std::string & | plugin_name, | |
| const std::string & | plugin_id | |||
| ) | [protected] |
removes a plug-in object from the configuration file
| plugin_name | the name of the plug-in element node | |
| plugin_id | unique identifier associated with the plug-in |
Definition at line 729 of file ConfigManager.cpp.
References findConfigNodeByAttr(), ID_ATTRIBUTE_NAME, m_config_node_ptr, and saveConfigFile().
Referenced by pion::platform::PluginConfig< PluginType >::removePlugin(), and pion::server::UserManager::removeUser().
| std::string pion::platform::ConfigManager::resolveRelativePath | ( | const std::string & | orig_path | ) | const [inline] |
resolves paths relative to the location of the config file
| orig_path | the original path (may be relative or absolute) |
Definition at line 499 of file ConfigManager.hpp.
| std::string pion::platform::ConfigManager::resolveRelativePath | ( | const std::string & | base_path_to_file, | |
| const std::string & | orig_path | |||
| ) | [static] |
resolves paths relative to the location of another file
| base_path_to_file | path to a file that will be used if orig_path is relative | |
| orig_path | the original path (may be relative or absolute) |
Definition at line 407 of file ConfigManager.cpp.
Referenced by pion::platform::VocabularyManager::createConfigFile(), pion::platform::DatabaseManager::getDatabaseEngineConfig(), pion::plugins::PythonReactor::getSourceCodeFromFile(), pion::platform::VocabularyManager::openConfigFile(), pion::plugins::LogOutputReactor::setConfig(), pion::plugins::LogInputReactor::setConfig(), pion::platform::VocabularyManager::setVocabularyPath(), and pion::platform::DatabaseManager::writeDatabaseEnginesXML().
| void pion::platform::ConfigManager::setPluginConfig | ( | const std::string & | plugin_name, | |
| const std::string & | plugin_id, | |||
| const xmlNodePtr | config_ptr | |||
| ) | [protected] |
updates the configuration parameters for a plug-in
| plugin_name | the name of the plug-in element node | |
| plugin_id | unique identifier associated with the plug-in | |
| config_ptr | pointer to a list of XML nodes containing plug-in configuration parameters |
Definition at line 657 of file ConfigManager.cpp.
References findConfigNodeByAttr(), ID_ATTRIBUTE_NAME, m_config_node_ptr, PLUGIN_ELEMENT_NAME, saveConfigFile(), and setPluginConfig().
| bool pion::platform::ConfigManager::setPluginConfig | ( | xmlNodePtr | plugin_node_ptr, | |
| xmlNodePtr | config_ptr | |||
| ) | [protected] |
add configuration parameters for a plug-in to the configuration file
| plugin_node_ptr | pointer to the existing plugin element node | |
| config_ptr | pointer to the new configuration parameters |
Definition at line 618 of file ConfigManager.cpp.
References findConfigNodeByName(), and PLUGIN_ELEMENT_NAME.
Referenced by addPluginConfig(), pion::platform::PluginConfig< PluginType >::setLocationConfig(), setPluginConfig(), and pion::platform::PluginConfig< PluginType >::setPluginConfig().
| bool pion::platform::ConfigManager::updateConfigOption | ( | const std::string & | option_name, | |
| const std::string & | option_value, | |||
| xmlNodePtr | parent_node | |||
| ) | [static] |
updates a simple configuration option that is contained within an XML element node. If the option value is empty, the node is removed. Adds a new element node if necessary.
| option_name | the name of the option's element node | |
| option_value | the value that should be assigned to the option | |
| parent_node | pointer to the option's parent node |
Definition at line 562 of file ConfigManager.cpp.
References findConfigNodeByName(), and xml_encode().
Referenced by pion::platform::VocabularyManager::createConfigFile(), pion::platform::VocabularyConfig::setComment(), pion::platform::VocabularyConfig::setLocked(), pion::platform::VocabularyConfig::setName(), pion::platform::VocabularyManager::setVocabularyPath(), pion::platform::ReactionEngine::startReactor(), and pion::platform::ReactionEngine::stopReactor().
| void pion::platform::ConfigManager::writeBeginPionConfigXML | ( | std::ostream & | out | ) | [static] |
write out the beginning <PionConfig> block for XML config information
| out | the ostream to write the configuration info into |
Definition at line 239 of file ConfigManager.cpp.
References CONFIG_NAMESPACE_URL, PION_VERSION_ATTRIBUTE_NAME, ROOT_ELEMENT_NAME, and writeConfigXMLHeader().
Referenced by pion::platform::PluginConfig< PluginType >::writeConfigXML(), pion::platform::ReactionEngine::writeConnectionsXML(), and pion::platform::VocabularyManager::writeTermConfigXML().
| void pion::platform::ConfigManager::writeBeginPionStatsXML | ( | std::ostream & | out | ) | [static] |
write out the beginning <PionStats> block for XML statistic information
| out | the ostream to write the statistic info into |
Definition at line 251 of file ConfigManager.cpp.
References CONFIG_NAMESPACE_URL, STATS_ELEMENT_NAME, and writeConfigXMLHeader().
Referenced by pion::platform::ReactionEngine::writeStatsXML().
| void pion::platform::ConfigManager::writeConfigXML | ( | std::ostream & | out, | |
| xmlNodePtr | config_node, | |||
| bool | include_siblings = false | |||
| ) | [static] |
writes configuration data to an output stream (as XML)
| out | the ostream to write the configuration tree into | |
| config_node | xmlNodePtr to start writing data from | |
| include_siblings | if true, siblings of config_node will be written |
Definition at line 177 of file ConfigManager.cpp.
References writeConfigXML(), and xml_encode().
| virtual void pion::platform::ConfigManager::writeConfigXML | ( | std::ostream & | out | ) | const [inline, virtual] |
writes the entire configuration tree to an output stream (as XML)
| out | the ostream to write the configuration tree into |
Reimplemented in pion::platform::PluginConfig< PluginType >, pion::platform::VocabularyManager, pion::server::PlatformConfig, pion::server::UserManager, pion::platform::PluginConfig< pion::platform::Codec >, pion::platform::PluginConfig< pion::platform::Reactor >, pion::platform::PluginConfig< pion::platform::Database >, pion::platform::PluginConfig< pion::server::PlatformService >, and pion::platform::PluginConfig< pion::platform::Protocol >.
Definition at line 222 of file ConfigManager.hpp.
Referenced by writeConfigXML(), pion::platform::VocabularyManager::writeConfigXML(), pion::platform::PluginConfig< PluginType >::writeConfigXML(), pion::platform::PluginConfig< pion::platform::Protocol >::writeConfigXML(), and pion::platform::DatabaseManager::writeDatabaseEnginesXML().
| void pion::platform::ConfigManager::writeConfigXMLHeader | ( | std::ostream & | out | ) | [static] |
write the XML header <?xml ... ?> to an ouput stream
| out | the ostream to write the configuration info into |
Definition at line 234 of file ConfigManager.cpp.
Referenced by writeBeginPionConfigXML(), writeBeginPionStatsXML(), pion::platform::VocabularyManager::writeConfigXML(), and pion::platform::PluginConfig< pion::platform::Protocol >::writeConfigXML().
| void pion::platform::ConfigManager::writeEndPionConfigXML | ( | std::ostream & | out | ) | [static] |
write out the end </PionConfig> block for XML config information
| out | the ostream to write the configuration info into |
Definition at line 246 of file ConfigManager.cpp.
Referenced by pion::platform::PluginConfig< PluginType >::writeConfigXML(), pion::platform::ReactionEngine::writeConnectionsXML(), and pion::platform::VocabularyManager::writeTermConfigXML().
| void pion::platform::ConfigManager::writeEndPionStatsXML | ( | std::ostream & | out | ) | [static] |
write out the end </PionStats> block for XML statistic information
| out | the ostream to write the statistic info into |
Definition at line 258 of file ConfigManager.cpp.
Referenced by pion::platform::ReactionEngine::writeStatsXML().
1.4.7