void BF_GUI_FilesPanel::Action_Tracker_Addons_Start_LoadAddOns(bool b_FromHome,BL_List &lo_MenuResult,bool b_LoadSIcons) { BF_NodeList loNode; BF_GUI_ViewMenu_Item *po; BL_String s; BF_Node *poNode; BF_Path oPath(b_FromHome?ADDONS_FOLDER_HOME:ADDONS_FOLDER_SYS); BF_Roster_LoadNodeList(oPath,loNode,BF_ROSTER_LOAD_NODE_FILE|BF_ROSTER_LOAD_NODE_LINK|(b_LoadSIcons?BF_ROSTER_LOAD_SICON:0)); for(int i=0;i<loNode.CountItems();i++){ poNode = (BF_Node*)loNode.ItemAt(i); // prepare code // s = oPath.Path(); s<<"/"; s<<poNode->sName; // make new menu_item // po = new BF_GUI_ViewMenu_Item(poNode->sName.String(),s.String() ); lo_MenuResult.AddItem(po); if(b_LoadSIcons && poNode->poSIcon) po->poSIcon = new BBitmap( poNode->poSIcon ); } }
// Only called from SelectFile(), no locking is done here CByteArray CPkiCard::SelectByPath(const std::string & csPath, bool bReturnFileInfo) { unsigned char ucP2 = bReturnFileInfo ? 0x00 : 0x0C; unsigned long ulPathLen = (unsigned long) (csPath.size() / 2); CByteArray oPath(ulPathLen); for (unsigned long i = 0; i < ulPathLen; i++) oPath.Append(Hex2Byte(csPath, i)); CByteArray oResp = SendAPDU(0xA4, 0x80, ucP2, oPath); if (ShouldSelectApplet(0xA4, getSW12(oResp))) { // The file still wasn't found, so let's first try to select the applet if (SelectApplet()) { m_selectAppletMode = ALW_SELECT_APPLET; oResp = SendAPDU(0xA4, 0x80, ucP2, oPath); } } getSW12(oResp, 0x9000); return oResp; }
bool ExportMediaDialog::InvalidCharExist(const char* p_vpPath, const char* p_vpFileName) { string oPath(p_vpPath); string oFileName(p_vpFileName); bool vPathInvalidCharExist(false); bool vFileNameInvalidCharExist(false); int vPos(0); while(vPos < oPath.length() && vPos != -1) { vPos = oPath.find_first_of('\\', vPos); if(vPos == 0) { vPos++; continue; } if(vPos == 1) { vPos++; continue; } if(oPath[vPos + 1] == '\\' && vPos != -1) { vPathInvalidCharExist = true; break; } if(vPos != -1) vPos++; } if(oPath.find_first_of('.') == 0) vPathInvalidCharExist = true; if(oPath.find_first_of('/') != -1) vPathInvalidCharExist = true; if(oPath.find_first_of(':') != -1 && oPath.find_first_of(':') != 1) vPathInvalidCharExist = true; if(oPath.find_first_of('*') != -1) vPathInvalidCharExist = true; if(oPath.find_first_of('?') != -1) vPathInvalidCharExist = true; if(oPath.find_first_of('"') != -1) vPathInvalidCharExist = true; if(oPath.find_first_of('<') != -1) vPathInvalidCharExist = true; if(oPath.find_first_of('>') != -1) vPathInvalidCharExist = true; if(oPath.find_first_of('|') != -1) vPathInvalidCharExist = true; if(vPathInvalidCharExist) m_opMsgBox -> DisplayDialog(m_opDialogWindow -> GetNativeView(), "The specified path has invalid character(s)", "Invalid character(s)", EM_DIALOG_ICON_ERROR); if(oFileName.find_first_of('.') == 0) vFileNameInvalidCharExist = true; if(oFileName.find_first_of('\\') != -1) vFileNameInvalidCharExist = true; if(oFileName.find_first_of('/') != -1) vFileNameInvalidCharExist = true; if(oFileName.find_first_of(':') != -1) vFileNameInvalidCharExist = true; if(oFileName.find_first_of('*') != -1) vFileNameInvalidCharExist = true; if(oFileName.find_first_of('?') != -1) vFileNameInvalidCharExist = true; if(oFileName.find_first_of('"') != -1) vFileNameInvalidCharExist = true; if(oFileName.find_first_of('<') != -1) vFileNameInvalidCharExist = true; if(oFileName.find_first_of('>') != -1) vFileNameInvalidCharExist = true; if(oFileName.find_first_of('|') != -1) vFileNameInvalidCharExist = true; if(vFileNameInvalidCharExist) m_opMsgBox -> DisplayDialog(m_opDialogWindow -> GetNativeView(), "The File Name has invalid character(s)", "Invalid character(s)", EM_DIALOG_ICON_ERROR); if(vPathInvalidCharExist || vFileNameInvalidCharExist) return true; return false; }