本文整理汇总了C++中VJSParms_callStaticFunction::ReturnValue方法的典型用法代码示例。如果您正苦于以下问题:C++ VJSParms_callStaticFunction::ReturnValue方法的具体用法?C++ VJSParms_callStaticFunction::ReturnValue怎么用?C++ VJSParms_callStaticFunction::ReturnValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VJSParms_callStaticFunction
的用法示例。
在下文中一共展示了VJSParms_callStaticFunction::ReturnValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: do_ProgressIndicator
void VJSGlobalClass::do_ProgressIndicator(VJSParms_callStaticFunction& ioParms, VJSGlobalObject *inContext)
{
VString sessiontile;
VString windowtile, userinfo;
bool caninterrupt = false;
Real maxvalue = -1;
VError err = VE_OK;
if (ioParms.IsNumberParam(1))
ioParms.GetRealParam(1, &maxvalue);
else
err = vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_NUMBER, "1");
if (err == VE_OK )
{
if (ioParms.IsStringParam(2))
ioParms.GetStringParam(2, sessiontile);
else
err = vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_STRING, "2");
}
caninterrupt = ioParms.GetBoolParam( 3, L"Can Interrupt", "Cannot Interrupt");
//VProgressIndicator* progress = inContext->GetRuntimeDelegate()->CreateProgressIndicator( windowtile);
if (err == VE_OK)
{
VProgressIndicator* progress = new VProgressIndicator();
if (progress != NULL)
{
if (ioParms.CountParams() >= 4)
{
if (ioParms.IsStringParam(4))
{
ioParms.GetStringParam(4, windowtile);
progress->SetTitle(windowtile);
}
else
vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_STRING, "4");
}
if (ioParms.CountParams() >= 5)
{
if (ioParms.IsStringParam(5))
{
ioParms.GetStringParam(5, userinfo);
progress->SetUserInfo(userinfo);
}
else
vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_STRING, "5");
}
progress->BeginSession((sLONG8)maxvalue, sessiontile, caninterrupt);
}
ioParms.ReturnValue(VJSProgressIndicator::CreateInstance(ioParms.GetContextRef(), progress));
ReleaseRefCountable( &progress);
}
else
ioParms.ReturnNullValue();
}
示例2: do_BinaryStream
void VJSStream::do_BinaryStream(VJSParms_callStaticFunction& ioParms)
{
VFile* file = ioParms.RetainFileParam( 1);
bool forwrite = ioParms.GetBoolParam( 2, L"Write", L"Read");
if (file != NULL)
{
VError err = VE_OK;
if (forwrite)
{
if (!file->Exists())
err = file->Create();
}
VFileStream* stream = new VFileStream(file);
if (err == VE_OK)
{
if (forwrite)
err = stream->OpenWriting();
else
err = stream->OpenReading();
}
if (err == VE_OK)
{
ioParms.ReturnValue(VJSStream::CreateInstance(ioParms.GetContextRef(), stream));
}
else
{
delete stream;
}
}
else
vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_FILE, "1");
ReleaseRefCountable( &file);
}
示例3: _GetResult
void VJSLanguageSyntaxTesterDefinitionResults::_GetResult( VJSParms_callStaticFunction &ioParams, IJSLanguageSyntaxTesterDefinitionResults *inResults )
{
if (inResults) {
sLONG index;
if (ioParams.GetLongParam( 1, &index ))
{
IDefinition definition = inResults->GetResult( index );
VJSObject result(ioParams.GetContextRef());
VJSValue jsval(ioParams.GetContextRef());
result.MakeEmpty();
jsval.SetString( definition.GetName() );
result.SetProperty(L"name", jsval, JS4D::PropertyAttributeNone);
jsval.SetString( definition.GetFilePath() );
result.SetProperty(L"file", jsval, JS4D::PropertyAttributeNone);
jsval.SetNumber( definition.GetLineNumber() + 1 );
result.SetProperty(L"line", jsval, JS4D::PropertyAttributeNone);
ioParams.ReturnValue(result);
}
}
}
示例4: _filterGroups
void VJSDirectory::_filterGroups(VJSParms_callStaticFunction& ioParms, CUAGDirectory* inDirectory)
{
VString s;
bool isquery = false;
ioParms.GetStringParam(1, s);
isquery = ioParms.GetBoolParam(2, "query", "not query");
CUAGGroupVector groups;
VError err = inDirectory->FilterGroups(s, isquery, groups);
ioParms.ReturnValue(buildArrFromGroups(ioParms, groups, nil));
}
示例5: do_GetProgressIndicator
void VJSGlobalClass::do_GetProgressIndicator(VJSParms_callStaticFunction& ioParms, VJSGlobalObject *inContext)
{
if (ioParms.IsStringParam(1))
{
VString userinfo;
ioParms.GetStringParam(1, userinfo);
VProgressIndicator* progress = VProgressManager::RetainProgressIndicator(userinfo);
if (progress != nil)
ioParms.ReturnValue(VJSProgressIndicator::CreateInstance(ioParms.GetContextRef(), progress));
QuickReleaseRefCountable(progress);
}
}
示例6: do_Require
void VJSGlobalClass::do_Require(VJSParms_callStaticFunction& ioParms, VJSGlobalObject *inGlobalObject)
{
xbox_assert(inGlobalObject != NULL);
XBOX::VString className;
if (ioParms.CountParams() != 1 || !ioParms.IsStringParam(1) || !ioParms.GetStringParam(1, className))
vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_STRING, "1");
else
ioParms.ReturnValue(inGlobalObject->Require(ioParms.GetContext(), className));
}
示例7: _addGroup
void VJSDirectory::_addGroup(VJSParms_callStaticFunction& ioParms, CUAGDirectory* inDirectory)
{
VError err;
VString groupname, fullname;
ioParms.GetStringParam(1, groupname);
ioParms.GetStringParam(2, fullname);
CUAGGroup* group = inDirectory->AddOneGroup(groupname, fullname, err);
if (group == nil)
ioParms.ReturnNullValue();
else
{
ioParms.ReturnValue(VJSGroup::CreateInstance(ioParms.GetContext(), group));
group->Release();
}
}
示例8: do_testMe
void VJSGlobalClass::do_testMe( VJSParms_callStaticFunction& inParms, VJSGlobalObject*)
{
VJSObject globalObject( inParms.GetContext().GetGlobalObject());
VString functionName;
inParms.GetStringParam( 1, functionName);
std::vector<VJSValue> values;
size_t count = inParms.CountParams();
for( size_t i = 2 ; i <= count ; ++i)
values.push_back( inParms.GetParamValue( i));
VJSValue result( inParms.GetContextRef());
bool ok = globalObject.CallMemberFunction( functionName, &values, &result, inParms.GetExceptionRefPointer());
inParms.ReturnValue( result);
}
示例9: _addUser
void VJSDirectory::_addUser(VJSParms_callStaticFunction& ioParms, CUAGDirectory* inDirectory)
{
VError err;
VString username, password, fullname;
ioParms.GetStringParam(1, username);
ioParms.GetStringParam(2, password);
ioParms.GetStringParam(3, fullname);
CUAGUser* user = inDirectory->AddOneUser(username, password, fullname, err);
if (user == nil)
ioParms.ReturnNullValue();
else
{
ioParms.ReturnValue(VJSUser::CreateInstance(ioParms.GetContext(), user));
user->Release();
}
}
示例10: _getItem
void VJSStorageClass::_getItem (VJSParms_callStaticFunction &ioParms, VJSStorageObject *inStorageObject)
{
xbox_assert(inStorageObject != NULL);
XBOX::VString name;
if (ioParms.CountParams() && ioParms.IsStringParam(1) && ioParms.GetStringParam(1, name)) {
XBOX::VJSValue value(ioParms.GetContext());
inStorageObject->GetKeyValue(name, &value);
ioParms.ReturnValue(value);
} else
ioParms.ReturnNullValue();
}
示例11: _key
void VJSStorageClass::_key (VJSParms_callStaticFunction &ioParms, IJSStorageObject *inStorageObject)
{
xbox_assert(inStorageObject != NULL);
sLONG index;
if (ioParms.CountParams() && ioParms.IsNumberParam(1) && ioParms.GetLongParam(1, &index)) {
XBOX::VJSValue value(ioParms.GetContext());
inStorageObject->GetKeyValue(index, &value);
ioParms.ReturnValue(value);
} else
ioParms.ReturnNullValue();
}
示例12: _getUser
void VJSDirectory::_getUser(VJSParms_callStaticFunction& ioParms, CUAGDirectory* inDirectory)
{
StErrorContextInstaller errs(false, true);
VString s;
ioParms.GetStringParam(1, s);
CUAGUser* user = inDirectory->RetainUser(s);
if (user == nil)
{
VUUID id;
id.FromString(s);
user = inDirectory->RetainUser(id);
}
if (user == nil)
ioParms.ReturnNullValue();
else
{
ioParms.ReturnValue(VJSUser::CreateInstance(ioParms.GetContext(), user));
user->Release();
}
}
示例13: _getGroup
void VJSDirectory::_getGroup(VJSParms_callStaticFunction& ioParms, CUAGDirectory* inDirectory)
{
StErrorContextInstaller errs(false, true);
VString s;
ioParms.GetStringParam(1, s);
CUAGGroup* group = inDirectory->RetainGroup(s);
if (group == nil)
{
VUUID id;
id.FromString(s);
group = inDirectory->RetainGroup(id);
}
if (group == nil)
ioParms.ReturnNullValue();
else
{
ioParms.ReturnValue(VJSGroup::CreateInstance(ioParms.GetContext(), group));
group->Release();
}
}
示例14: do_SyncEvent
void VJSGlobalClass::do_SyncEvent(VJSParms_callStaticFunction& ioParms, VJSGlobalObject*)
{
VString s;
bool okresult = false;
if (ioParms.IsStringParam(1))
{ ioParms.GetStringParam(1, s);
if (!s.IsEmpty())
{
jsSyncEvent* sync = jsSyncEvent::RetainSyncEvent(s);
if (sync != nil)
{
okresult = true;
ioParms.ReturnValue(VJSSyncEvent::CreateInstance(ioParms.GetContextRef(), sync));
sync->Release();
}
}
}
else
vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_STRING, "1");
if (!okresult)
ioParms.ReturnNullValue();
}
示例15: do_GetURLPath
void VJSGlobalClass::do_GetURLPath(VJSParms_callStaticFunction& ioParms, VJSGlobalObject*)
{
VString s;
if (ioParms.IsStringParam(1))
{
if (ioParms.GetStringParam(1, s))
{
VFullURL url(s);
VJSArray result(ioParms.GetContextRef());
const VString* next = url.NextPart();
while (next != NULL)
{
VJSValue elem(ioParms.GetContextRef());
elem.SetString(*next);
result.PushValue(elem);
next = url.NextPart();
}
ioParms.ReturnValue(result);
}
}
else
vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_STRING, "1");
}