本文整理汇总了C++中IAAFFile::Open方法的典型用法代码示例。如果您正苦于以下问题:C++ IAAFFile::Open方法的具体用法?C++ IAAFFile::Open怎么用?C++ IAAFFile::Open使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAAFFile
的用法示例。
在下文中一共展示了IAAFFile::Open方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CAAFCachePageAllocator_test
HRESULT CAAFCachePageAllocator_test(testMode_t /* mode */,
aafUID_t fileKind,
testRawStorageType_t /* rawStorageType */,
aafProductIdentification_t productID)
{
const size_t fileNameBufLen = 128;
aafWChar pFileName[ fileNameBufLen ] = L"";
GenerateTestFileName( productID.productName, fileKind, fileNameBufLen, pFileName );
(void)RemoveTestFile(pFileName );
IAAFRawStorage* pRawStorage = 0;
HRESULT hr = AAFCreateRawStorageDisk(pFileName,
kAAFFileExistence_new,
kAAFFileAccess_modify,
&pRawStorage);
if (!AAFRESULT_SUCCEEDED(hr)) return hr;
IAAFCachePageAllocator* pAllocator = 0;
hr = TestCachePageAllocator::Create(&pAllocator);
if (!AAFRESULT_SUCCEEDED(hr)) {
pRawStorage->Release();
pRawStorage = 0;
return hr;
}
IAAFRawStorage* pCachedRawStorage = 0;
hr = AAFCreateRawStorageCached2(pRawStorage,
16,
4096,
pAllocator,
&pCachedRawStorage);
if (!AAFRESULT_SUCCEEDED(hr)) {
pRawStorage->Release();
pRawStorage = 0;
pAllocator->Release();
pAllocator = 0;
return hr;
}
aafUID_t encoding = EffectiveTestFileEncoding(fileKind);
IAAFFile* pFile = 0;
hr = AAFCreateAAFFileOnRawStorage(pCachedRawStorage,
kAAFFileExistence_new,
kAAFFileAccess_modify,
&encoding,
0,
&productID,
&pFile);
if (!AAFRESULT_SUCCEEDED(hr)) {
pRawStorage->Release();
pRawStorage = 0;
pAllocator->Release();
pAllocator = 0;
pCachedRawStorage->Release();
pCachedRawStorage = 0;
return hr;
}
hr = pFile->Open();
if (!AAFRESULT_SUCCEEDED(hr)) {
pRawStorage->Release();
pRawStorage = 0;
pAllocator->Release();
pAllocator = 0;
pCachedRawStorage->Release();
pCachedRawStorage = 0;
pFile->Release();
pFile = 0;
return hr;
}
hr = pFile->Save();
if (!AAFRESULT_SUCCEEDED(hr)) return hr;
hr = pFile->Close();
if (!AAFRESULT_SUCCEEDED(hr)) return hr;
pRawStorage->Release();
pRawStorage = 0;
pAllocator->Release();
pAllocator = 0;
pCachedRawStorage->Release();
pCachedRawStorage = 0;
pFile->Release();
pFile = 0;
return hr;
}