int main () { int val; char buf[100]; GetMatches ( "99 bottles of beer on the wall", " %d %s ", &val, buf); printf ("Product: %s\nQuantity: %d\n", buf, val); return 0; }
void CAutoComplete::OnComplete(CWnd* pWnd, CString s) { CStringArray arMatches; // 匹配串 GetMatches(s,arMatches); if (s.GetLength() && arMatches.GetSize()&&m_iType) DoCompletion(pWnd, s, arMatches); m_sPrevious=s; // 记住当前串 }
bool MANFrame::SearchManPage(const wxString &dirs, const wxString &keyword) { SetDirs(dirs); if (keyword.IsEmpty()) { if (m_dirsVect.empty()) { SetPage(NoSearchDirsSet); } return false; } std::vector<wxString> files_found; GetMatches(keyword, &files_found); m_entry->SetValue(keyword); if (files_found.empty()) { SetPage(ManPageNotFound); return false; } if (files_found.size() == 1) { wxString filename = files_found.front(); wxString man_page = GetManPage(filename); if (man_page.IsEmpty()) { SetPage(ManPageNotFound); return false; } SetPage(cbC2U(man2html_buffer(cbU2C(man_page)))); return true; } SetPage(CreateLinksPage(files_found)); return true; }
int main(int argc, const char * * argv) { if (argc != 2) { printf ( "We expect the directory to be the first and only argument!\n" ); exit(1); } printf ( "In The beginning!\n" ); CddbClient * client = CreateClient(); GetMatches(client, argv[1]); DisposeClient(client); printf ( "The end ...\n" ); return 0; }