Example #1
0
void Beagle::WrapperT<T>::read(PACC::XML::ConstIterator inIter)
{
	Beagle_StackTraceBeginM();
	if(!inIter) mWrappedValue = T();
	else {
		if(inIter->getType() != PACC::XML::eString)
			throw Beagle_IOExceptionNodeM(*inIter, "value of wrapper not found");
		if(inIter->getValue().empty()) mWrappedValue = T();
		else {
			std::istringstream lISS(inIter->getValue());
			lISS >> mWrappedValue;
		}
	}
	Beagle_StackTraceEndM();
}
Example #2
0
void SCHNAPS::Core::ArrayT<T>::read(PACC::XML::ConstIterator inIter) {
	schnaps_StackTraceBeginM();
	if (inIter->getType() != PACC::XML::eString) {
		throw schnaps_IOExceptionNodeM(*inIter,"expected string to read array!");
	}
	std::vector<T>::clear();
	std::istringstream lISS(inIter->getValue());
	while (lISS.good()) {
		T lValue;
		lISS >> lValue;
		std::vector<T>::push_back(lValue);
		if (lISS.good() == false) {
			break;
		}
		int lDelim = lISS.get();
		if ((lISS.good() == false) || (lDelim == -1)) {
			break;
		}
	}
	schnaps_StackTraceEndM("void SCHNAPS::Core::ArrayT<T>::read(PACC::XML::ConstIterator)");
}