BOOL DirImageInfoProvider::IsLegalPicture(LPCTSTR path, LPCTSTR albumName, BOOL bStrict) { ASSERT(path != NULL); ASSERT(albumName != NULL); #ifdef _DEBUG TRACE(_T("DirImageInfoProvider::IsLegalPicture. StrictSearch: %d\r\n"), bStrict); if (!bStrict && !IsIncluded(path, albumName, TRUE, _T("._ -'!?"))) TRACE(_T("DirImageInfoProvider::IsLegalPicture. Strict would have failed (%s)!!!\r\n"), path); #endif if (bStrict && !IsIncluded(path, albumName, TRUE, _T("._ -'!?"))) return FALSE; if (_tcsstr(path, _T("AlbumArtSmall.jpg")) != NULL) return FALSE; if (_tcsstr(path, _T("}_Small.jpg")) != NULL) return FALSE; return TRUE; }
LONG CED6AsDecompiler::DecompileFunctions(ED6_ACTION_SCRIPT_INFO *pAsInfo) { LONG Status; ULONG FunctionCount; POSITION Pos; ED6_AS_CRAFT_INFO *pFunction; pAsInfo->FunctionCount = m_FuntionMap.GetCount(); if (pAsInfo->FunctionCount == 0) return ASDECL_ERROR_SUCCESS; pFunction = (ED6_AS_CRAFT_INFO *)m_mem.Alloc(pAsInfo->FunctionCount * sizeof(*pFunction), HEAP_ZERO_MEMORY); if (pFunction == NULL) return ASDECL_ERROR_OUT_OF_MEMORY; pAsInfo->pFunctionInfo = pFunction; Pos = m_FuntionMap.GetStartPosition(); do { ULONG Offset; ED6_INSTRUCTION_RECORD Function; m_FuntionMap.GetNextAssoc(Pos, Offset, Function); pFunction->Offset = Offset; ++pFunction; } while (Pos != NULL); pFunction = pAsInfo->pFunctionInfo; FunctionCount = pAsInfo->FunctionCount; LOOP_ALWAYS { for (ULONG Count = FunctionCount; Count; --Count) { Status = DecompilerOneCraft(pAsInfo, pFunction); if (Status != ASDECL_ERROR_UNKNOWN_INSTRUCTION) AS_IF_FAIL_RETURN(Status); ++pFunction; } FunctionCount = m_FuntionMap.GetCount(); if (pAsInfo->FunctionCount == FunctionCount) break; pFunction = (ED6_AS_CRAFT_INFO *)m_mem.ReAlloc(pAsInfo->pFunctionInfo, FunctionCount * sizeof(*pFunction), HEAP_ZERO_MEMORY); if (pFunction == NULL) return ASDECL_ERROR_OUT_OF_MEMORY; pAsInfo->pFunctionInfo = pFunction; pFunction += pAsInfo->FunctionCount; Pos = m_FuntionMap.GetStartPosition(); do { ULONG Offset; ED6_INSTRUCTION_RECORD Function; m_FuntionMap.GetNextAssoc(Pos, Offset, Function); if (IsIncluded(pAsInfo->pFunctionInfo, pAsInfo->FunctionCount, Offset)) continue; pFunction->Offset = Offset; ++pFunction; } while (Pos != NULL); pFunction = pAsInfo->pFunctionInfo + pAsInfo->FunctionCount; Swap(FunctionCount, pAsInfo->FunctionCount); FunctionCount = pAsInfo->FunctionCount - FunctionCount; } ED6_AS_CRAFT_INFO **pTable; pTable = (ED6_AS_CRAFT_INFO **)m_mem.Alloc(pAsInfo->FunctionCount * sizeof(*pTable)); if (pTable == NULL) return ASDECL_ERROR_OUT_OF_MEMORY; pAsInfo->pFunctionTable = pTable; pFunction = pAsInfo->pFunctionInfo; for (ULONG Count = pAsInfo->FunctionCount; Count; --Count) *pTable++ = pFunction++; pTable = pAsInfo->pFunctionTable; for (ULONG i = pAsInfo->FunctionCount; i; --i) { for (ULONG j = 0; j != i - 1; ++j) { if (pTable[j]->Offset > pTable[j + 1]->Offset) Swap(pTable[j], pTable[j + 1]); } } return Status; }
bool Window::IsIncluded(const Interval& interval) const { return IsIncluded(interval.GetLeft(), interval.GetRight()); }
bool Window::IsIncluded(double point) const { return IsIncluded(point, point); }