本文整理汇总了C++中VJSParms_callStaticFunction::ReturnString方法的典型用法代码示例。如果您正苦于以下问题:C++ VJSParms_callStaticFunction::ReturnString方法的具体用法?C++ VJSParms_callStaticFunction::ReturnString怎么用?C++ VJSParms_callStaticFunction::ReturnString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VJSParms_callStaticFunction
的用法示例。
在下文中一共展示了VJSParms_callStaticFunction::ReturnString方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _getCurrentPath
void VJSRequireClass::_getCurrentPath (VJSParms_callStaticFunction &ioParms, void *)
{
VJSGlobalObject *globalObject = ioParms.GetContext().GetGlobalObjectPrivateInstance();
xbox_assert(globalObject != NULL);
XBOX::VFilePath *path = (XBOX::VFilePath *) globalObject->GetSpecific(VJSContext::kURLSpecificKey);
xbox_assert(path != NULL);
XBOX::VFilePath parent;
if (!path->GetParent(parent)) {
ioParms.ReturnString("/");
} else {
XBOX::VString posixPath;
parent.GetPosixPath(posixPath);
ioParms.ReturnString(posixPath);
}
}
示例2: _Read
void VJSTextStream::_Read (VJSParms_callStaticFunction &ioParms, VJSTextStreamState *inStreamState)
{
if (inStreamState == NULL)
XBOX::vThrowError(XBOX::VE_JVSC_INVALID_STATE, L"TextStream.read()");
else if (ioParms.CountParams() == 1 && ioParms.IsStringParam(1)) {
XBOX::VString delimiter;
if (!ioParms.GetStringParam(1, delimiter) || delimiter.GetLength() > 1)
XBOX::vThrowError(XBOX::VE_JVSC_WRONG_PARAMETER_TYPE_STRING, "1");
else {
XBOX::VString result;
bool hasBeenFound;
hasBeenFound = inStreamState->_ReadUntilDelimiter(delimiter, &result);
inStreamState->fPosition += result.GetLength();
if (hasBeenFound)
inStreamState->fPosition++; // Delimiter is not included.
ioParms.ReturnString(result);
}
} else {
// numberCharacters is the number of actual characters to read, not the number of bytes.
sLONG numberCharacters;
numberCharacters = 0;
if (ioParms.CountParams() >= 1 && (!ioParms.GetLongParam(1, &numberCharacters) || numberCharacters < 0))
XBOX::vThrowError(XBOX::VE_JVSC_WRONG_PARAMETER_TYPE_NUMBER, "1");
else {
XBOX::VString result;
inStreamState->_ReadCharacters(numberCharacters, &result);
inStreamState->fPosition += result.GetLength();
ioParms.ReturnString(result);
}
}
}
示例3: _GetString
void VJSStream::_GetString(VJSParms_callStaticFunction& ioParms, VStream* inStream)
{
VString s;
VError err = s.ReadFromStream(inStream);
if (err == VE_OK)
ioParms.ReturnString(s);
}
示例4: _getLoginListener
void VJSDirectory::_getLoginListener(VJSParms_callStaticFunction& ioParms, CUAGDirectory* inDirectory)
{
VError err;
VString listenerRef;
inDirectory->GetLoginListener(listenerRef);
ioParms.ReturnString(listenerRef);
}
示例5: do_GenerateUUID
void VJSGlobalClass::do_GenerateUUID(VJSParms_callStaticFunction& ioParms, VJSGlobalObject*)
{
VUUID theUUID(true);
VString uuidStr;
theUUID.GetString(uuidStr);
ioParms.ReturnString(uuidStr);
}
示例6: _GetResult
void VJSLanguageSyntaxTesterResults::_GetResult( VJSParms_callStaticFunction &ioParams, IJSLanguageSyntaxTesterResults *inResults )
{
if (inResults) {
sLONG index;
if (ioParams.GetLongParam( 1, &index )) {
ioParams.ReturnString( inResults->GetResult( index ) );
}
}
}
示例7: do_dateToIso
void VJSGlobalClass::do_dateToIso(VJSParms_callStaticFunction& ioParms, VJSGlobalObject*)
{
VString s;
VJSValue jsval(ioParms.GetContextRef());
if (ioParms.CountParams() > 0)
{
VTime dd;
jsval = ioParms.GetParamValue(1);
jsval.GetTime(dd);
dd.GetJSONString(s);
}
ioParms.ReturnString(s);
}
示例8: do_XmlToJSON
void VJSGlobalClass::do_XmlToJSON(VJSParms_callStaticFunction& ioParms, VJSGlobalObject*)
{
VString xml;
VString json, root;
bool simpleJSON = false;
ioParms.GetStringParam( 1, xml);
if ( ioParms.CountParams() >= 2)
{
VString s;
if (ioParms.IsStringParam(2))
{
ioParms.GetStringParam(2, s);
if(s== "json-bag")
{
simpleJSON = true;
root="bag";
if(ioParms.CountParams() >= 3)
{
if (ioParms.IsStringParam(3))
ioParms.GetStringParam(3, root);
else
vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_STRING, "3");
}
}
}
else
vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_STRING, "2");
}
if (simpleJSON)
{
XBOX::VValueBag *bag = new XBOX::VValueBag;
VError err = LoadBagFromXML( xml, root, *bag);
if(err == VE_OK)
bag->GetJSONString(json);
ReleaseRefCountable( &bag);
}
else
{
VString errorMessage; sLONG lineNumber;
VError err = VXMLJsonUtility::XMLToJson(xml, json, errorMessage, lineNumber);
}
ioParms.ReturnString(json);
}
示例9: do_JSONToXml
void VJSGlobalClass::do_JSONToXml(VJSParms_callStaticFunction& ioParms, VJSGlobalObject*)
{
VString xml;
VString json, root;
bool simpleJSON = false;
ioParms.GetStringParam( 1, json);
if ( ioParms.CountParams() >= 2)
{
VString s;
if (ioParms.IsStringParam(2))
{
ioParms.GetStringParam(2, s);
if(s== "json-bag")
{
simpleJSON = true;
root="bag";
if(ioParms.CountParams() >= 3)
{
if (ioParms.IsStringParam(3))
ioParms.GetStringParam(3, root);
else
vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_STRING, "3");
}
}
}
else
vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_STRING, "2");
}
if (simpleJSON)
{
XBOX::VValueBag *bag = new XBOX::VValueBag;
bag->FromJSONString(json);
xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
bag->DumpXML( xml, root, false);
ReleaseRefCountable( &bag);
}
else
{
VError err = VXMLJsonUtility::JsonToXML(json, xml);
}
ioParms.ReturnString(xml);
}
示例10:
void VJSDirectory::_computeHA1(VJSParms_callStaticFunction& ioParms, CUAGDirectory* inDirectory)
{
VString userName, password, realm;
ioParms.GetStringParam(1, userName);
ioParms.GetStringParam(2, password);
ioParms.GetStringParam(3, realm);
if (realm.IsEmpty())
realm = "Wakanda";
CSecurityManager* securityManager = (CSecurityManager*)VComponentManager::RetainUniqueComponent(CSecurityManager::Component_Type);
if (securityManager != nil)
{
VString ha1 = securityManager->ComputeDigestHA1(userName, password, realm);
securityManager->Release();
ioParms.ReturnString(ha1);
}
}
示例11: do_LoadText
void VJSGlobalClass::do_LoadText(VJSParms_callStaticFunction& ioParms, VJSGlobalObject*)
{
bool okloaded = false;
VFile* file = ioParms.RetainFileParam(1);
if (file != nil)
{
if (file->Exists())
{
VFileStream inp(file);
VError err = inp.OpenReading();
if (err == VE_OK)
{
CharSet defaultCharSet = VTC_UTF_8;
sLONG xcharset = 0;
if (ioParms.GetLongParam(2, &xcharset) && xcharset != 0)
defaultCharSet = (CharSet)xcharset;
inp.GuessCharSetFromLeadingBytes(defaultCharSet );
inp.SetCarriageReturnMode( eCRM_NATIVE );
VString s;
err = inp.GetText(s);
if (err == VE_OK)
{
ioParms.ReturnString(s);
okloaded = true;
}
inp.CloseReading();
}
}
file->Release();
}
else
vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_FILE, "1");
if (!okloaded)
ioParms.ReturnNullValue();
}
示例12: _key
void VJSStorageClass::_key (VJSParms_callStaticFunction &ioParms, VJSStorageObject *inStorageObject)
{
xbox_assert(inStorageObject != NULL);
sLONG index;
if (ioParms.CountParams() && ioParms.IsNumberParam(1) && ioParms.GetLongParam(1, &index)) {
XBOX::VString key;
inStorageObject->GetKeyFromIndex(index, &key);
if (!key.IsEmpty())
ioParms.ReturnString(key);
else
ioParms.ReturnNullValue(); // Index is out of bound.
} else
ioParms.ReturnNullValue();
}