Example #1
0
	void convert(DipData &dipData, VariablePtr DPEValue, const CharString & tagName) const{
		DynVar * vals = (DynVar *)(DPEValue);
		if (!vals){
			throw BadTypeConversionException(BadTypeConversionException::BADTYPE);
		}

		if (vals->isA() != DYNTEXT_VAR){
			throw BadTypeConversionException(BadTypeConversionException::BADTYPE);
		}
		unsigned int size = vals->getArrayLength();
		if (size == 0){
			return;
		}
		const char ** array = new const char*[size];
		for (unsigned int i = 0; i < size; i++){
			Variable * value =  vals->getAt(i);
			array[i] = ((TextVar *)(value))->getValue();
		}
		if (tagName.len() == 0){
			dipData.insert(array, size);
		} else {
			dipData.insert(array, size, tagName); 
		}

		delete []array;
	}
Example #2
0
	void convert(DipData &dipData, VariablePtr DPEValue, const CharString & tagName) const{
		TextVar * val = (TextVar *)DPEValue;
		if (!val){
			throw BadTypeConversionException(BadTypeConversionException::BADTYPE);
		}
		if (tagName.len() == 0){
			dipData.insert((char *)val->getValue());
		} else {
			dipData.insert((char *)val->getValue(), tagName); 
		}
	}
Example #3
0
	void convert(DipData &dipData, VariablePtr DPEValue, const CharString & tagName) const{
		CharVar * val = (CharVar *)DPEValue;
		if (!val){
			throw BadTypeConversionException(BadTypeConversionException::BADTYPE);
		}

		char stringifiedChar[2]={0,0};
		stringifiedChar[0] = val->getValue();
		if (tagName.len() == 0){
			dipData.insert(stringifiedChar);
		} else {
			dipData.insert(stringifiedChar, tagName); 
		}
	}