#include <XmlReader.hpp>
Public Member Functions | |
try_read (data_t &object) | |
Friends | |
class | XmlReader |
Assume that the user wants to read an object from an XML input stream but she is not sure if it can actually be found in the stream. Assume further that in case the object can not be read the user just wants the object to be the same as before without any further error handling. Then she can use a try_read to accomplish this task in a compact way.
The alternate way to handle this situation would be to try to read the object and to explicitly handle XmlNoTagException exceptions.
imaging::XmlReader::try_read< data_t >::try_read | ( | data_t & | object | ) | [inline] |
Passing this command to an XML input stream reads object from the stream if it is present at the current stream path. If not, it keeps object unchanged.