Ejemplo n.º 1
0
// Simple method that squares the result $method(5.0) = 25.0
void JsonFastWriter::methodWrite( tThreadData* pThreadData, qshort pParamCount )
{
	// Declare all EXTfldvals for the parameters
	EXTfldval fValRoot, fValReturn;  
	
	// Read all parameters
	if( getParamVar( pThreadData, 1, fValRoot ) == qfalse )
		return;
	
	// Read parameter into Omnis object
	JsonValue *jvRoot = getObjForEXTfldval<JsonValue>(pThreadData, fValRoot);
	
	// Write value object (If it exists)
	std::string output;
	if (jvRoot) {
		output = jsonWriter.write( jvRoot->getJsonValue() );
	} else {
		output = "";
	}
	
	// Return the output of the writer to the caller
	getEXTFldValFromString(fValReturn, output);
	ECOaddParam(pThreadData->mEci, &fValReturn);
	
}