-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
Description
Is it possible to write an AbstractConfiguration to a String?
I use a Poco::Util::ServerApplication and load a configuration file on startup.
I then create some AbstractConfigurations via the createView(...) Function of the Config.
The Configuration is a XML File. What i now want to archive is to wrote a Subpart of the Configuration back to a String.
This is what i have done:
Poco::AutoPtr<Poco::Util::AbstractConfiguration> pSubConfig(app.config().createView("Sub.Config"));
Poco::Util::XMLConfiguration* xmlconfig = reinterpret_cast<Poco::Util::XMLConfiguration*>(pSubConfig.get());
std::stringstream ss;
xmlconfig->save(ss); // This crashesCalling save on the xmlconfig leads to an crash because the _pDocument member of the XMLConfiguration is not set.
Is there a way to store parts of an XML Config in an String?