mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-24 02:51:34 +01:00
add a load() overload to specify name pool size
This commit is contained in:
parent
a53464e784
commit
bae5b38df0
@ -134,6 +134,12 @@ public:
|
||||
/// Loads the XML document containing the configuration data
|
||||
/// 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);
|
||||
/// Loads the XML document containing the configuration data
|
||||
/// 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::XML::DOMParser parser;
|
||||
Poco::XML::DOMParser parser(namePoolSize);
|
||||
parser.setFeature(Poco::XML::XMLReader::FEATURE_NAMESPACES, false);
|
||||
parser.setFeature(Poco::XML::DOMParser::FEATURE_FILTER_WHITESPACE, true);
|
||||
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)
|
||||
{
|
||||
Poco::XML::InputSource src(istr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user