static inline CFileType* getFT(const char* aFileName, bool& isMulti, const char** pExt = nullptr) { const char* ext = extractExt(aFileName); if (!ext) return nullptr; if (pExt) *pExt = ext; return FindFileType(ext, isMulti); }
unsigned char *loadSound( String path,int *length,int *channels,int *format,int *hertz ){ String ext=extractExt( path ).ToLower(); if( ext=="wav" ) return loadSound_wav( path,length,channels,format,hertz ); if( ext=="ogg" ) return loadSound_ogg( path,length,channels,format,hertz ); return 0; }
bool VDirAdapter_Unix::findFile(const VString &strPath) { if (strPath.empty() || strPath == "") { return false; } extractRoot(strPath, m_strRoot); extractExt(strPath, m_strExt); m_pDir = opendir(m_strRoot.c_str()); m_bExtractName = false; return (m_pDir != NULL); }
void CodeEditor::rename( const QString &path ){ _path=path; _fileType=extractExt( _path ).toLower(); QString t=';'+_fileType+';'; _txt=textFileTypes.contains( t ); _code=codeFileTypes.contains( t ); _monkey=_fileType=="monkey"; if( _txt ){ setLineWrapMode( QPlainTextEdit::WidgetWidth ); }else{ setLineWrapMode( QPlainTextEdit::NoWrap ); } }
bool VDirAdapter_Unix::findNextFile() { if (NULL == m_pDir) { return false; } m_pDirent = readdir(m_pDir); if (m_pDirent != NULL && !isDirectory()) { VString strName = m_pDirent->d_name; VString strExt; extractExt(strName, strExt); if (strExt != m_strExt && m_strExt != "*" && m_strExt != "") findNextFile(); } m_bExtractName = false; return (m_pDirent != NULL); }