本文整理汇总了C++中xbox::VJSParms_callStaticFunction::RetainFileParam方法的典型用法代码示例。如果您正苦于以下问题:C++ VJSParms_callStaticFunction::RetainFileParam方法的具体用法?C++ VJSParms_callStaticFunction::RetainFileParam怎么用?C++ VJSParms_callStaticFunction::RetainFileParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xbox::VJSParms_callStaticFunction
的用法示例。
在下文中一共展示了VJSParms_callStaticFunction::RetainFileParam方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _save
void VJSImage::_save(XBOX::VJSParms_callStaticFunction& ioParms, VJSPictureContainer* inPict)
{
VPictureCodecFactoryRef fact;
const VPictureCodec* encoder = nil;
bool ok = false;
VPicture* pic = inPict->GetPict();
if (pic != nil)
{
VFile* file = ioParms.RetainFileParam(1);
if (file != nil)
{
VString mimetype;
ioParms.GetStringParam(2, mimetype);
if (mimetype.IsEmpty())
{
VString extension;
file->GetExtension(extension);
if (extension.IsEmpty())
extension = L"pic";
encoder = fact->RetainEncoderForExtension(extension);
}
else
encoder = fact->RetainEncoderByIdentifier(mimetype);
if (encoder != nil)
{
VError err = VE_OK;
if (file->Exists())
err = file->Delete();
if (err == VE_OK)
{
VValueBag *pictureSettings = nil;
VValueBag *bagMetas = (VValueBag*)inPict->RetainMetaBag();
if (bagMetas != nil)
{
pictureSettings = new VValueBag();
ImageEncoding::stWriter settingsWriter(pictureSettings);
VValueBag *bagRetained = settingsWriter.CreateOrRetainMetadatas( bagMetas);
if (bagRetained)
bagRetained->Release();
}
err=encoder->Encode(*pic, pictureSettings, *file);
QuickReleaseRefCountable(bagMetas);
QuickReleaseRefCountable(pictureSettings);
if (err == VE_OK)
ok = true;
}
encoder->Release();
}
file->Release();
}
else
vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_FILE, "1");
}
ioParms.ReturnBool(ok);
}
示例2: _setPath
void VJSImage::_setPath(XBOX::VJSParms_callStaticFunction& ioParms, VJSPictureContainer* inPict)
{
VPicture* pic = inPict->GetPict();
VString path;
if (pic != nil)
{
if (ioParms.CountParams() == 0 || ioParms.IsNullParam(1))
{
pic->SetOutsidePath(""); // empty string means no outside
}
else if (ioParms.IsBooleanParam(1))
{
pic->SetOutsidePath("*");
}
else if (ioParms.IsStringParam(1))
{
ioParms.GetStringParam(1, path);
pic->SetOutsidePath(path);
if (!path.IsEmpty())
pic->ReloadFromOutsidePath();
}
else
{
VFile* file = ioParms.RetainFileParam(1);
if (file != nil)
{
file->GetPath(path, FPS_POSIX);
pic->SetOutsidePath(path);
if (file->Exists())
pic->ReloadFromOutsidePath();
}
else
pic->SetOutsidePath("");
QuickReleaseRefCountable(file);
}
//inPict->SetModif();
}
}