bool OgreXmlSerializer::ReadAttribute<bool>(const std::string &name) const { std::string value = Ogre::ToLower(ReadAttribute<std::string>(name)); if (ASSIMP_stricmp(value, "true") == 0) { return true; } else if (ASSIMP_stricmp(value, "false") == 0) { return false; } else { ThrowAttibuteError(m_reader, name, "Boolean value is expected to be 'true' or 'false', encountered '" + value + "'"); return false; } }
//------------------------------------------------------------------------------- bool CMaterialManager::TryLongerPath(char* szTemp,aiString* p_szString) { char szTempB[MAX_PATH]; stx_strlcpy(szTempB,szTemp,MAX_PATH); // go to the beginning of the file name char* szFile = stx_strrchr(szTempB,stx_getOsSeparator()); if (!szFile)szFile = stx_strrchr(szTempB,stx_getOsSeparator()); char* szFile2 = szTemp + (szFile - szTempB)+1; szFile++; char* szExt = stx_strrchr(szFile,'.'); if (!szExt)return false; szExt++; *szFile = 0; stx_strlcat(szTempB,"*.*",MAX_PATH); const unsigned int iSize = (const unsigned int) ( szExt - 1 - szFile ); #if 0 HANDLE h; WIN32_FIND_DATA info; // build a list of files h = FindFirstFile(szTempB, &info); if (h != INVALID_HANDLE_VALUE) { do { if (!(strcmp(info.cFileName, ".") == 0 || strcmp(info.cFileName, "..") == 0)) { char* szExtFound = stx_strrchr(info.cFileName, '.'); if (szExtFound) { ++szExtFound; if (0 == ASSIMP_stricmp(szExtFound,szExt)) { const unsigned int iSizeFound = (const unsigned int) ( szExtFound - 1 - info.cFileName); for (unsigned int i = 0; i < iSizeFound;++i) info.cFileName[i] = (CHAR)tolower(info.cFileName[i]); if (0 == memcmp(info.cFileName,szFile2, std::min(iSizeFound,iSize))) { // we have it. Build the full path ... char* sz = stx_strrchr(szTempB,'*'); *(sz-2) = 0x0; stx_strlcat(szTempB,info.cFileName,MAX_PATH); // copy the result string back to the aiString const size_t iLen = strlen(szTempB); size_t iLen2 = iLen+1; iLen2 = iLen2 > MAXLEN ? MAXLEN : iLen2; stx_memcpy(p_szString->data,szTempB,iLen2); p_szString->length = iLen; return true; } } // check whether the 8.3 DOS name is matching if (0 == ASSIMP_stricmp(info.cAlternateFileName,p_szString->data)) { stx_strlcat(szTempB,info.cAlternateFileName,MAX_PATH); // copy the result string back to the aiString const size_t iLen = strlen(szTempB); size_t iLen2 = iLen+1; iLen2 = iLen2 > MAXLEN ? MAXLEN : iLen2; stx_memcpy(p_szString->data,szTempB,iLen2); p_szString->length = iLen; return true; } } } } while (FindNextFile(h, &info)); FindClose(h); } #else //??? #endif return false; }
bool OgreXmlSerializer::CurrentNodeNameEquals(const std::string &name) const { return (ASSIMP_stricmp(m_currentNodeName, name) == 0); }