/** @brief 文字列分割 @note http://shnya.jp/blog/?p=195 のコードを改造 */ static std::vector<astring> split(const astring &str, const astring &delim) { std::vector<astring> res; size_t current = 0, found, delimlen = delim.size(); while ((found = str.find(delim, current)) != astring::npos) { res.push_back(astring(str, current, found - current)); current = found + delimlen; } res.push_back(astring(str, current, str.size() - current)); return res; }
void read(PCWSTR path, astring &buf) { memory::auto_close<HANDLE> file(::CreateFileW(path, GENERIC_READ, 0, nullptr, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, nullptr)); if (file != INVALID_HANDLE_VALUE) { DWORD size = (DWORD)get_size(file); buf.reserve(size); CheckApi(::ReadFile(file, (PWSTR )buf.c_str(), buf.size(), &size, nullptr)); } }
void VSCVidItemCamConf::VidFilter(astring strFilter) { if (strFilter.size() == 0) { setHidden(false); return; } std::size_t found = m_cCam.strname().find(strFilter); if (found != std::string::npos) { setHidden(false); }else { setHidden(true); } }
void VSCVidItemCam::VidFilter(astring strFilter) { VDC_DEBUG( "%s %d Filter %s name %s\n",__FUNCTION__, __LINE__, strFilter.c_str(), m_cCam.strname().c_str()); if (strFilter.size() == 0) { setHidden(false); return; } std::size_t found = m_cCam.strname().find(strFilter); if (found != std::string::npos) { setHidden(false); }else { setHidden(true); } }