bool SkAnimator::decodeURI(const char uri[]) { // SkDebugf("animator decode %s\n", uri); // SkStream* stream = SkStream::GetURIStream(fMaker->fPrefix.c_str(), uri); SkStream* stream = new SkFILEStream(uri); SkAutoTDelete<SkStream> autoDel(stream); setURIBase(uri); return decodeStream(stream); }
//---------------------------------------------------------------------------------------- // FunctionNotBeingUsed //---------------------------------------------------------------------------------------- //Function used for compiling its header file. static void FunctionNotBeingUsed() { int a = 5; StRestoreValue<int> autoVal(a, 4); char * str = new char; StPtrDeleter<char> autoDel( str, true ); StSmartBuff<char> buff(50); }
// differs from SkAnimator::decodeURI in that it does not set URI base bool SkAnimateMaker::decodeURI(const char uri[]) { // SkDebugf("animator decode %s\n", uri); // SkStream* stream = SkStream::GetURIStream(fPrefix.c_str(), uri); SkStream* stream = new SkFILEStream(uri); SkAutoTDelete<SkStream> autoDel(stream); bool success = decodeStream(stream); if (hasError() && fError.hasNoun() == false) fError.setNoun(uri); return success; }
//---------------------------------------------------------------------------------------- // FetchEditionsFromPath //---------------------------------------------------------------------------------------- bool ZMFileUtils::FetchEditionsFromPath( const PMString& parentPath, ZMstEditionSList & oEditionList) const { LogFunctionEnterExit; IZPLog_Str_( thisFileLA, enLT_DebugInfo, "From path : %s", parentPath.GrabCString()); SDKFileHelper fileHelper(parentPath); IDFile fileId = fileHelper.GetIDFile(); PlatformFileSystemIterator iter; if(!iter.IsDirectory(fileId)) return false; InterfacePtr<const IWorkspace> iWorkspace(gSession->QueryWorkspace()); InterfacePtr<const IZMPrefs> workspacePrefs( iWorkspace, UseDefaultIID() ); ASSERT( workspacePrefs ); const PMString & filePrefixName = workspacePrefs->GetAdFileNamePrefix(); IZPLog_Str_( thisFileLA, enLT_DebugInfo, "File prefix name : %s", filePrefixName.GrabCString()); bool result = false; ZMPMStringSList editionList; this->GetAllDirectoryNames(parentPath, editionList); ZMPMStringSListCIter editionIter = editionList.begin(); ZMPMStringSListCIter editionIterEnd = editionList.end(); for(; editionIter != editionIterEnd; ++editionIter) { stEdition *currEdition = new stEdition(); StPtrDeleter<stEdition> autoDel( currEdition, true ); const PMString edition(**editionIter); PMString editionFullPath (parentPath); editionFullPath.Append(FileUtils::GetDirectorySeperator()); editionFullPath.Append(edition); if (this->FetchAdsFileFromPath(editionFullPath, currEdition->mXmlFiles, filePrefixName)) { result = true; currEdition->mName = edition; oEditionList.push_back(currEdition); autoDel.Forget(); } } return result; }
void SkImageBaseBitmap::resolve() { fDirty = false; if (base64.fData) { fBitmap.reset(); SkImageDecoder::DecodeMemory(base64.fData, base64.fLength, &fBitmap); } else if (src.size()) { if (fLast.equals(src)) return; fLast.set(src); fBitmap.reset(); //SkStream* stream = SkStream::GetURIStream(fUriBase, src.c_str()); SkStream* stream = new SkFILEStream(src.c_str()); SkAutoTDelete<SkStream> autoDel(stream); SkImageDecoder::DecodeStream(stream, &fBitmap); } }
SkShader* SkDrawBitmapShader::getShader() { if (image == NULL) return NULL; // note: bitmap shader now supports independent tile modes for X and Y // we pass the same to both, but later we should extend this flexibility // to the xml (e.g. tileModeX="repeat" tileModeY="clmap") // // oops, bitmapshader no longer takes filterBitmap, but deduces it at // draw-time from the paint SkShader* shader = SkShader::CreateBitmapShader(image->fBitmap, (SkShader::TileMode) tileMode, (SkShader::TileMode) tileMode, getMatrix()); SkAutoTDelete<SkShader> autoDel(shader); (void)autoDel.detach(); return shader; }
//---------------------------------------------------------------------------------------- // FetchListFromPath //---------------------------------------------------------------------------------------- void ZMFileUtils::FetchListFromPath( const PMString& parentPath, ZMstTitleSList & oTitleList) const { LogFunctionEnterExit; IZPLog_Str_( thisFileLA, enLT_DebugInfo, "From path : %s", parentPath.GrabCString()); SDKFileHelper fileHelper(parentPath); IDFile fileId = fileHelper.GetIDFile(); PlatformFileSystemIterator iter; if(!iter.IsDirectory(fileId)) return; ZMPMStringSList titleList; this->GetAllDirectoryNames(parentPath, titleList); ZMPMStringSListCIter titleIter = titleList.begin(); ZMPMStringSListCIter titleIterEnd = titleList.end(); for(; titleIter != titleIterEnd; ++titleIter) { stTitle *currTitle = new stTitle(); StPtrDeleter<stTitle> autoDel( currTitle, true); const PMString & title = (**titleIter); PMString titleFullPath(parentPath); titleFullPath.Append(FileUtils::GetDirectorySeperator()); titleFullPath.Append(title); if ( this->FetchEditionsFromPath(titleFullPath, currTitle->mEditions) ) { currTitle->mName = title; oTitleList.push_back(currTitle); autoDel.Forget(); } } }