本文整理汇总了C++中FindNext函数的典型用法代码示例。如果您正苦于以下问题:C++ FindNext函数的具体用法?C++ FindNext怎么用?C++ FindNext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FindNext函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: BuildTreeView
//---------------------------------------------------------------------------
//
//---------------------------------------------------------------------------
void __fastcall TDialogProjectNew::BuildTreeView(TTreeView *TreeView, TTreeNode *TreeNode, const String Path)
{
TSearchRec SearchRec;
if (FindFirst(Path + "\\*.*", faAnyFile, SearchRec) == 0) {
do {
if (SearchRec.Name[1] != '.') {
if (SearchRec.Attr & faDirectory) {
TTreeNode *TreeNode2 = TreeView->Items->AddChild(TreeNode, SearchRec.Name);
TreeNode2->ImageIndex = 2;
TreeNode2->SelectedIndex = 2;
BuildTreeView(TreeView, TreeNode2, Path + "\\" + SearchRec.Name);
}
}
} while (FindNext(SearchRec) == 0);
FindClose(SearchRec);
}
if (FindFirst(Path + "\\*.*", faAnyFile, SearchRec) == 0) {
do {
if (SearchRec.Name[1] != '.') {
if (!(SearchRec.Attr & faDirectory)) {
TTreeNode *TreeNode2 = TreeView->Items->AddChild(TreeNode, SearchRec.Name);
TreeNode2->ImageIndex = 1;
TreeNode2->SelectedIndex = 1;
}
}
} while (FindNext(SearchRec) == 0);
FindClose(SearchRec);
}
}
开发者ID:NogsIoT,项目名称:Nogs-IDE,代码行数:32,代码来源:ProjectNewDlg.cpp
示例2: printf
int UnitTest::RunAllInGroup( const char* group )
{
printf( "GROUP %s\n", group );
int error_count = 0;
const char dashes[] = "------------------------------";
// Because of (naughty) reliance of static constructor to register tests, the order in the list is out of my
// control. A little extra code to make them run in alphabetical order.
UnitTest* test = FindNext( group, NULL );
while( test )
{
size_t offset = strlen( test->m_Name );
if( offset >= sizeof( dashes ) )
{
offset = sizeof( dashes ) - 1;
}
printf( " %s %s ", test->m_Name, dashes + offset );
test->m_ErrorCount = 0;
test->Test();
if( test->m_ErrorCount == 0 )
{
printf( "pass\n" );
}
error_count += test->m_ErrorCount;
test->m_Done = true;
test = FindNext( group, test );
}
return error_count;
}
开发者ID:RonPieket,项目名称:MojoLib,代码行数:30,代码来源:UnitTest.cpp
示例3: ASSERT
LRESULT EditFind::FindReplaceCmd(WPARAM, LPARAM lParam)
{
FindReplaceDialog* dialog = FindReplaceDialog::GetNotifier(lParam);
ASSERT(dialog == m_dialog);
bool found = true;
if (dialog->IsTerminating())
{
m_lastFind = dialog->GetFindString();
m_searchDown = dialog->SearchDown();
m_matchCase = dialog->MatchCase();
m_matchWholeWord = dialog->MatchWholeWord();
m_dialog = NULL;
}
else if (dialog->FindNext())
{
found = FindNext(true);
if (!found)
found = FindNext(false);
}
else if (dialog->ReplaceCurrent())
found = Replace();
else if (dialog->ReplaceAll())
found = ReplaceAll();
if (!found)
::MessageBeep(MB_ICONEXCLAMATION);
return 0;
}
开发者ID:DavidKinder,项目名称:Windows-Inform7,代码行数:30,代码来源:EditFind.cpp
示例4: AddMenu
void __fastcall TForm1::FindFile2(TMenuItem *parent, String path) {
TSearchRec sr;
if (FindFirst(TPath::Combine(path, "*.*"), faDirectory, sr) == 0) {
do {
if (sr.Name == "." || sr.Name == ".." || sr.Attr != faDirectory)
continue;
TMenuItem *item = AddMenu(parent, sr, TPath::Combine(path, sr.Name));
if (sr.Attr & faDirectory && chbSubDirectory->Checked) {
FindFile2(item, TPath::Combine(path, sr.Name));
}
}
while (!FindNext(sr));
}
if (FindFirst(TPath::Combine(path, edtPattern->Text), faAnyFile, sr) == 0) {
do {
if (sr.Name == "." || sr.Name == ".." || sr.Attr & faDirectory)
continue;
AddMenu(parent, sr, TPath::Combine(path, sr.Name));
}
while (!FindNext(sr));
}
FindClose(sr);
}
开发者ID:leiqunni,项目名称:ttlogin,代码行数:26,代码来源:main.cpp
示例5: RecursiveSearch
bool ClassBrowser::RecursiveSearch(const wxString& search, wxTreeCtrl* tree, const wxTreeItemId& parent, wxTreeItemId& result)
{
if (!parent.IsOk() || !tree)
return false;
// first check the parent item
if (FoundMatch(search, tree, parent))
{
result = parent;
return true;
}
wxTreeItemIdValue cookie;
wxTreeItemId child = tree->GetFirstChild(parent, cookie);
if (!child.IsOk())
return RecursiveSearch(search, tree, FindNext(search, tree, parent), result);
while (child.IsOk())
{
if (FoundMatch(search, tree, child))
{
result = child;
return true;
}
if (tree->ItemHasChildren(child))
{
if (RecursiveSearch(search, tree, child, result))
return true;
}
child = tree->GetNextChild(parent, cookie);
}
return RecursiveSearch(search, tree, FindNext(search, tree, parent), result);
}
开发者ID:simple-codeblocks,项目名称:Codeblocks,代码行数:35,代码来源:classbrowser.cpp
示例6: assert
//@Override
ECode FindActionModeCallback::OnActionItemClicked(
/* [in] */ IActionMode* mode,
/* [in] */ IMenuItem* item,
/* [out] */ Boolean* result)
{
if (mWebView == NULL) {
//throw new AssertionError(
// "No WebView for FindActionModeCallback::onActionItemClicked");
assert(0);
}
AutoPtr<IBinder> binder;
assert(0);
// mWebView->GetWebView()->GetWindowToken((IBinder**)&binder);
mInput->HideSoftInputFromWindow(binder, 0, NULL);
Int32 id;
item->GetItemId(&id);
switch(id) {
case R::id::find_prev:
FindNext(FALSE);
break;
case R::id::find_next:
FindNext(TRUE);
break;
default:
if (result) *result = FALSE;
return NOERROR;
}
if (result) *result = TRUE;
return NOERROR;
}
开发者ID:TheTypoMaster,项目名称:ElastosRDK5_0,代码行数:34,代码来源:FindActionModeCallback.cpp
示例7: DateTime
bool
MoonPhases::Test( )
{
bool ok = true;
cout << "Testing MoonPhases" << endl;
double jan2000 = DateTime( 1, January, 2000, 0, 0 ).JulianDay( );
TESTCHECKFE( FindNext( jan2000, New ),
DateTime( 6, January, 2000, 18, 14 ).JulianDay( ), &ok,
2.e-10 );
TESTCHECKFE( FindNext( jan2000, FirstQuarter ),
DateTime( 14, January, 2000, 13, 34 ).JulianDay( ), &ok,
2.e-10 );
TESTCHECKFE( FindNext( jan2000, Full ),
DateTime( 21, January, 2000, 4, 40 ).JulianDay( ), &ok,
2.e-10 );
TESTCHECKFE( FindNext( jan2000, LastQuarter ),
DateTime( 28, January, 2000, 7, 57 ).JulianDay( ), &ok,
2.e-10 );
if ( ok )
cout << "MoonPhases PASSED." << endl << endl;
else
cout << "MoonPhases FAILED." << endl << endl;
return ok;
}
开发者ID:davidand36,项目名称:libEpsilonDelta,代码行数:26,代码来源:MoonPhases.cpp
示例8: ReplaceOnce
void
FindAndReplace::OnReplaceButton(LPFINDREPLACE& lpfr)
{
CharacterRange crange;
CharacterRange crtextrange;
if(m_havefound)
{
ReplaceOnce(lpfr->lpstrFindWhat, lpfr->lpstrReplaceWith);
m_havefound = FindNext(lpfr->lpstrFindWhat,
(wyBool)(!(lpfr->Flags & FR_DOWN)),
(wyBool)(lpfr->Flags & FR_WHOLEWORD),
(wyBool)(lpfr->Flags & FR_MATCHCASE));
}
else
{
crange = GetSelection();
pGlobals->m_findcount = 0;
::SendMessage (m_hwndedit, SCI_SETSEL, crange.cpMin, crange.cpMin);
m_havefound = FindNext(lpfr->lpstrFindWhat,
(wyBool)(!(lpfr->Flags & FR_DOWN)),
(wyBool)(lpfr->Flags & FR_WHOLEWORD),
(wyBool)(lpfr->Flags & FR_MATCHCASE));
crtextrange = GetSelection();
//checking whether the selected text is same as text to be replaced.
//if it is not same, then we are selecting the text,then on next replace click we will replace the text.
//if it is same then we will replace the text.
if(m_havefound && crtextrange.cpMin == crange.cpMin && crtextrange.cpMax == crange.cpMax )
{
//replace the selected text
ReplaceOnce(lpfr->lpstrFindWhat, lpfr->lpstrReplaceWith);
// Find the next given text
m_havefound = FindNext(lpfr->lpstrFindWhat,
(wyBool)(!(lpfr->Flags & FR_DOWN)),
(wyBool)(lpfr->Flags & FR_WHOLEWORD),
(wyBool)(lpfr->Flags & FR_MATCHCASE));
}
}
//if text not found
if(m_havefound == wyFalse)
{
NotFoundMsg(lpfr->lpstrFindWhat);
return;
}
return;
}
开发者ID:ArsalanYaqoob,项目名称:sqlyog-community,代码行数:54,代码来源:FindAndReplace.cpp
示例9: GetNode
HtmlNode GetNode(std::istream& io_is)
{
//get name
std::string node_name = GetString('>', io_is);
if(!FindNext('>', io_is))
{
throw std::logic_error("no >");
}
auto pos = io_is.tellg();
//get childs
std::vector<HtmlNode> node_childs;
while(FindNext('<', io_is) && io_is.peek() != '/')
{
node_childs.push_back(GetNode(io_is));
pos = io_is.tellg();
}
io_is.seekg(pos);
//get text
std::string node_text;
if(node_childs.empty())
{
//get text
node_text = GetString('<', io_is);
}
if(!FindNext('<', io_is))
{
throw std::logic_error("no <");
}
if(!FindNext('/', io_is))
{
throw std::logic_error("no /");
}
//get closed name
std::string node_close_name = GetString('>', io_is);
if(!FindNext('>', io_is))
{
throw std::logic_error("no >");
}
if(node_close_name != node_name)
{
throw std::logic_error("invalid close name");
}
HtmlNode node(node_name, node_text, node_childs);
return node;
}
开发者ID:AnatoliiKubariev,项目名称:HtlmReader,代码行数:50,代码来源:HtmlParser.cpp
示例10: dirSpec
/* Starts enumeration process. */
CHXDirectory::FSOBJ
CHXDirectory::FindFirst(const char* szPattern, char* szPath, UINT16 nSize)
{
OSErr err;
CHXDirSpecifier dirSpec(m_strPath);
require(dirSpec.IsSet() && CHXFileSpecUtils::DirectoryExists(dirSpec), bail);
// if there is already an iterator, dispose it
if (m_FSIterator)
{
err = FSCloseIterator(m_FSIterator);
check_noerr(err);
m_FSIterator = 0;
}
err = FSOpenIterator((FSRef *) dirSpec, kFSIterateFlat, &m_FSIterator);
require_noerr(err, bail);
m_strFindPattern = szPattern;
return FindNext(szPath, nSize);
bail:
return FSOBJ_NOTVALID;
}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:29,代码来源:hxdir_carbon.cpp
示例11: assert
LRESULT ViewFilesDialog::OnFindDialogMessage(WPARAM wParam, LPARAM lParam)
{
/*
* Handle activity in the modeless "find" dialog.
*/
assert(fpFindDialog != NULL);
fFindDown = (fpFindDialog->SearchDown() != 0);
fFindMatchCase = (fpFindDialog->MatchCase() != 0);
fFindMatchWholeWord = (fpFindDialog->MatchWholeWord() != 0);
if (fpFindDialog->IsTerminating()) {
LOGI("VFD find dialog closing");
fpFindDialog = NULL;
return 0;
}
if (fpFindDialog->FindNext()) {
fFindLastStr = fpFindDialog->GetFindString();
FindNext(fFindLastStr, fFindDown, fFindMatchCase, fFindMatchWholeWord);
} else {
LOGI("Unexpected find dialog activity");
}
return 0;
}
开发者ID:rostamn739,项目名称:ciderpress,代码行数:27,代码来源:ViewFilesDialog.cpp
示例12: TForm
//---------------------------------------------------------------------------
//
//---------------------------------------------------------------------------
__fastcall TDialogProjectNew::TDialogProjectNew(TComponent* Owner)
: TForm(Owner)
{
TemplatePath = Usul()->Ini->ReadString("Settings", "PathTemplatesProjects", TemplatePath = Usul()->Path + "\\Templates\\Projects");
PageControl->ActivePageIndex = 0;
TSearchRec SearchRec;
if (FindFirst(TemplatePath + "\\*", faDirectory, SearchRec) == 0) {
do {
if (SearchRec.Name[1] != '.') {
TListItem *ListItem = ListView->Items->Add();
ListItem->Caption = SearchRec.Name;
ListItem->ImageIndex = 1;
}
} while (FindNext(SearchRec) == 0);
}
FindClose(SearchRec);
if (Usul()->HasWriteAccessToExeDirectrory())
Edit->Text = Usul()->Path + "\\New project";
else
Edit->Text = Usul()->PathDocuments + "\\New project";
for (int I = 2;;I++) {
bool IsDirectoryExists = DirectoryExists(Edit->Text);
bool IsFileExists = FileExists(Edit->Text);
if (!IsDirectoryExists && !IsFileExists) break;
Edit->Text = Usul()->Path + "\\New project" + String(I);
}
}
开发者ID:NogsIoT,项目名称:Nogs-IDE,代码行数:31,代码来源:ProjectNewDlg.cpp
示例13: FindFirstFileA
bool FileFind::FindFirst(std::string &name)
{
#ifdef WIN32
mInternalFind->hFindNext = FindFirstFileA(mSearchName, &mInternalFind->finddata);
if ( mInternalFind->hFindNext == INVALID_HANDLE_VALUE )
return false;
mInternalFind->bFound = 1; // have an initial file to check.
return FindNext(name);
#endif
#ifdef LINUX_GENERIC
mInternalFind->mDir = opendir(".");
return FindNext(name);
#endif
//return false;
}
开发者ID:sheldonrobinson,项目名称:codesuppository,代码行数:16,代码来源:ffind.cpp
示例14: GenerateFileList
// Generates a list of files in the root directory on the card
void GenerateFileList()
{
SearchRec file;
int i;
// Reset vars
g_FilesInList = 0;
// All file types except for directories
unsigned char Attributes = ATTR_HIDDEN | ATTR_SYSTEM | ATTR_READ_ONLY | ATTR_VOLUME| ATTR_ARCHIVE;
if(FindFirst("*.*", Attributes, &file) == 0)// 0 is success
{
g_FilesInList = 1;
strcpy(g_FileNames[0], file.filename);
g_FileLengths[0] = file.filesize;
for(i=1; i < MAX_FILENAMES; i++)
{
if(FindNext(&file) == 0)
{
strcpy(g_FileNames[i], file.filename);
g_FileLengths[i] = file.filesize;
}
else
break;
g_FilesInList++;
}
}
}
开发者ID:aftersomemath,项目名称:XGS-PIC-Programs,代码行数:32,代码来源:MAIN.c
示例15: ResetLastHit
bool t4p::FinderClass::FindPrevious(const UnicodeString& text, int32_t start) {
bool found = false;
if (t4p::FinderClass::EXACT == Mode) {
ResetLastHit();
found = FindPreviousExact(text, start, true);
} else if (t4p::FinderClass::CASE_INSENSITIVE == Mode) {
ResetLastHit();
found = FindPreviousExact(text, start, false);
} else {
// lazy way of backwards searching, search from the beginning until
// we find the last hit before start
int32_t position = 0,
length = 0,
nextPosition = 0,
nextLength = 0;
while (FindNext(text, nextPosition + nextLength)) {
if (GetLastMatch(nextPosition, nextLength)) {
if ((nextPosition + nextLength) >= start && start > 0) {
break;
}
found = true;
position = nextPosition;
length = nextLength;
}
}
IsFound = found;
if (IsFound) {
LastPosition = position;
LastLength = length;
}
}
return IsFound;
}
开发者ID:adjustive,项目名称:triumph4php,代码行数:33,代码来源:FinderClass.cpp
示例16: StrBeginIter
// Try to load the resource DLL from [each directory in %PATH%]/<lcid>/
static void *LoadSearchPath(const MyString &resourceDllName, LocalizedFileHandler lfh)
{
void *hmod = NULL;
// Get the PATH variable into a C++ string
MyString envPath;
if (ClrGetEnvironmentVariable("PATH", envPath))
return hmod;
MyStringIterator endOfChunk, startOfChunk = StrBeginIter(envPath);
MyString tryPath;
for (SkipChars(envPath, startOfChunk, W(' '), W(';'));
hmod == NULL && startOfChunk != StrEndIter(envPath);
SkipChars(envPath, startOfChunk, W(' '), W(';')))
{
// copy this chunk of the path into our trypath
endOfChunk = startOfChunk;
FindNext(envPath, endOfChunk, W(';'));
MakeString(tryPath, envPath, startOfChunk, endOfChunk);
// Don't try invalid locations
if (IsEmptyStr(tryPath) || CharLength(tryPath) >= _MAX_PATH)
continue;
// Try to load the dll
hmod = LoadLocalFile(tryPath, resourceDllName, lfh);
startOfChunk = endOfChunk;
}
return hmod;
}
开发者ID:0-wiz-0,项目名称:coreclr,代码行数:32,代码来源:loadrc-impl.cpp
示例17: FindReset
CFile *CNTFSDirectory::FindFirst(const wstring &name, int attribs)
{
if ( !isvalid() ) return NULL;
// Reset
FindReset();
CStream *rootstream = m_file.openstream(m_ir_attribnum, false);
if ( !rootstream ) return NULL;
NTFSindexroot *indexroot = NTFSindexroot::Read(rootstream);
delete rootstream;
if ( !indexroot ) return NULL;
CBlockStream *indexnodestream = NULL;
int blocksize = 0;
if ( indexroot->islargeindex() )
{
indexnodestream = m_file.openstream(m_ia_attribnum, false);
if ( !indexnodestream ) { free(indexroot); return NULL; }
blocksize = indexnodestream->PhysicalBlockSize();
}
bool result = read(m_ntfs, indexnodestream, &indexroot->indexentries, indexroot->indexnodesize, blocksize, name, attribs);
free(indexroot);
if ( indexnodestream )
{
delete indexnodestream;
indexnodestream = NULL;
}
return result ? FindNext(name, attribs) : NULL;
}
开发者ID:TrevorHarrison,项目名称:umfs,代码行数:34,代码来源:NTFSDirectory.cpp
示例18: initialActionsIcons
void MainWindow::initialActions()
{
initialActionsIcons();
initialActionsShortcuts();
connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(openDocumentAction()));
connect(ui->actionSave, SIGNAL(triggered()), this, SLOT(saveDocumentAction()));
connect(ui->actionSaveAs, SIGNAL(triggered()), this, SLOT(saveAsDocumentAction()));
connect(ui->actionProperties, SIGNAL(triggered()), this, SLOT(propertiesAction()));
connect(ui->actionClose, SIGNAL(triggered()), this, SLOT(closeDocumentAction()));
connect(ui->actionExit, SIGNAL(triggered()), qApp, SLOT(closeAllWindows()));
connect(ui->actionCopy, SIGNAL(triggered()), this, SLOT(copyNodeAction()));
connect(ui->actionFind, SIGNAL(triggered()), this, SLOT(findAction()));
connect(ui->actionFindNext, SIGNAL(triggered()), findWidget, SLOT(FindNext()));
connect(ui->actionFindPrevious, SIGNAL(triggered()), findWidget, SLOT(FindPrevious()));
// bookmarks
connect(ui->actionBookmark, SIGNAL(triggered()), this, SLOT(bookmarkToggled()));
connect(ui->actionBookmarkGotoNext, SIGNAL(triggered()), model, SLOT(bookmarkNext()));
connect(ui->actionBookmarkGotoPrevious, SIGNAL(triggered()), model, SLOT(bookmarkPrev()));
// view
connect( ui->actionCollapseAll, SIGNAL(triggered()), this, SLOT(collapseAll()) );
connect( ui->actionExpandAll, SIGNAL(triggered()), this, SLOT(expandAll()) );
// FIXME: it's a temporary
ui->actionNew->setVisible( false );
}
开发者ID:elemc,项目名称:XMLer,代码行数:29,代码来源:mainwindow.cpp
示例19: strcpy
CFile* CFSCobraDEVIL::FindFirst(char* pattern)
{
findIdx = 0;
strcpy(DEVIL_FindPattern, pattern);
return FindNext();
}
开发者ID:vamposdecampos,项目名称:hc-disk,代码行数:7,代码来源:CFSCobraDEVIL.cpp
示例20: FindFocus
void SearchPanel::InitSearch(const wxString& searchtext, bool replace) {
wxWindow* focus_win = FindFocus();
if (focus_win == replaceBox) {
if (replace) Replace();
else searchbox->SetFocus();
return;
}
if (!replace && focus_win == searchbox) {
FindNext();
return;
}
nosearch = true;
if (!searchtext.empty()) {
searchbox->SetValue(searchtext);
nextButton->Enable();
prevButton->Enable();
replaceButton->Enable();
allButton->Enable();
}
nosearch = false;
SetState(cxFOUND);
if (replace) {
replaceBox->SetSelection(-1, -1); // select all
replaceBox->SetFocus();
}
else {
searchbox->SetSelection(-1, -1); // select all
searchbox->SetFocus();
}
}
开发者ID:dxtravi,项目名称:e,代码行数:34,代码来源:SearchPanel.cpp
注:本文中的FindNext函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论