language-extensions/R/test/src/RExtensionLibraryApiTests.cpp
//----------------------------------------------------------------------------------------------
// Name: RExtensionLibraryApiTests::ExecuteScriptAndGetResultAsString
//
// Description:
//  Executes and gets the result of the given script by invoking
//  the function provided by RExtension. Expects the results of the script to be
//  an Rcpp::CharacterVector of size > 0 and returns the first character string from it.
//
// Returns:
//  First character string from the result.
//
:ExecuteScriptAndGetResultAsString
Description:
Executes and gets the result of the given script by invoking
the function provided by RExtension. Expects the results of the script to be
an Rcpp::CharacterVector of size > 0 and returns the first character string from it.

First character string from the result.
: ExecuteScriptAndGetResultAsString Description : Executes and gets the result of the given script by invoking the function provided by RExtension . Expects the results of the script to be an Rcpp :: CharacterVector of size > 0 and returns the first character string from it . First character string from the result .
string RExtensionLibraryApiTests::ExecuteScriptAndGetResultAsString(string script)
	{
		Rcpp::CharacterVector resultVector(
			sm_executeScriptAndGetResultFuncPtr(script));
		string result = "";
		bool hasResults = resultVector.size() > 0;
		if (hasResults)
		{
			result = string(static_cast<char *>(resultVector[0]));
		}
		return result;
	}
string RExtensionLibraryApiTests :: ExecuteScriptAndGetResultAsString ( string script ) { Rcpp :: CharacterVector resultVector ( sm_executeScriptAndGetResultFuncPtr ( script ) ) ; string result = " " ; bool hasResults = resultVector . size ( ) > 0 ; if ( hasResults ) { result = string ( static_cast < char * > ( resultVector [ 0 ] ) ) ; } return result ; }
Name: RExtensionLibraryApiTests::ExecuteScriptAndGetResultAsString
Description:
Executes and gets the result of the given script by invoking
the function provided by RExtension.
Name : RExtensionLibraryApiTests :: ExecuteScriptAndGetResultAsString Description : Executes and gets the result of the given script by invoking the function provided by RExtension .