mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-27 19:10:20 +01:00
add a load() overload to specify name pool size
This commit is contained in:
@@ -134,6 +134,12 @@ public:
|
|||||||
/// Loads the XML document containing the configuration data
|
/// Loads the XML document containing the configuration data
|
||||||
/// from the given InputSource.
|
/// from the given InputSource.
|
||||||
|
|
||||||
|
void load(Poco::XML::InputSource* pInputSource, unsigned long namePoolSize);
|
||||||
|
/// Loads the XML document containing the configuration data
|
||||||
|
/// from the given InputSource. Uses the give namePoolSize (which
|
||||||
|
/// should be a suitable prime like 251, 509, 1021, 4093) for the
|
||||||
|
/// internal DOM Document's name pool.
|
||||||
|
|
||||||
void load(std::istream& istr);
|
void load(std::istream& istr);
|
||||||
/// Loads the XML document containing the configuration data
|
/// Loads the XML document containing the configuration data
|
||||||
/// from the given stream.
|
/// from the given stream.
|
||||||
|
|||||||
@@ -123,11 +123,11 @@ XMLConfiguration::~XMLConfiguration()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void XMLConfiguration::load(Poco::XML::InputSource* pInputSource)
|
void XMLConfiguration::load(Poco::XML::InputSource* pInputSource, unsigned long namePoolSize)
|
||||||
{
|
{
|
||||||
poco_check_ptr (pInputSource);
|
poco_check_ptr (pInputSource);
|
||||||
|
|
||||||
Poco::XML::DOMParser parser;
|
Poco::XML::DOMParser parser(namePoolSize);
|
||||||
parser.setFeature(Poco::XML::XMLReader::FEATURE_NAMESPACES, false);
|
parser.setFeature(Poco::XML::XMLReader::FEATURE_NAMESPACES, false);
|
||||||
parser.setFeature(Poco::XML::DOMParser::FEATURE_FILTER_WHITESPACE, true);
|
parser.setFeature(Poco::XML::DOMParser::FEATURE_FILTER_WHITESPACE, true);
|
||||||
Poco::XML::AutoPtr<Poco::XML::Document> pDoc = parser.parse(pInputSource);
|
Poco::XML::AutoPtr<Poco::XML::Document> pDoc = parser.parse(pInputSource);
|
||||||
@@ -135,6 +135,12 @@ void XMLConfiguration::load(Poco::XML::InputSource* pInputSource)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void XMLConfiguration::load(Poco::XML::InputSource* pInputSource)
|
||||||
|
{
|
||||||
|
load(pInputSource, POCO_XML_NAMEPOOL_DEFAULT_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void XMLConfiguration::load(std::istream& istr)
|
void XMLConfiguration::load(std::istream& istr)
|
||||||
{
|
{
|
||||||
Poco::XML::InputSource src(istr);
|
Poco::XML::InputSource src(istr);
|
||||||
|
|||||||
Reference in New Issue
Block a user