neoWidgets
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Pages
Classes | Public Member Functions | List of all members
neo::FileSearch Class Reference

Wrapper for the FindFirstFile API. More...

#include <util.h>

Classes

class  iterator
 iterator for STL algorithm integration More...
 

Public Member Functions

 FileSearch (const tstring &searchPattern)
 Starts the search. More...
 
iterator begin ()
 STL algorithms integration.
 
const FileSearchItemData () const
 Data of the current file.
 
bool Done () const
 True if the iteration is at the end, meaning further calls to next won't work.
 
iterator end ()
 STL algorithms integration.
 
bool Next ()
 Iterate to next file in the search.
 
bool Ok () const
 True if the search found at least one file.
 

Detailed Description

Wrapper for the FindFirstFile API.

This should be much simpler to use than the API. It can fit inside a for-loop, it support iterators and even the new C++11 foreach is possible.

for(FileSearch s(path); !s.Done(); s.Next())
{
s.Data().GetFilename();
}
//------------------------------------------
FileSearch s(path)
for(auto it = s.begin(); it != s.end(); ++s)
{
it->GetFilename();
}
//------------------------------------------
for(auto item : FileSearch(path))
{
item.GetFilename();
}

Constructor & Destructor Documentation

neo::FileSearch::FileSearch ( const tstring &  searchPattern)
inline

Starts the search.

Parameters
searchPatternsee the FindFirstFile API for the possible syntax

The documentation for this class was generated from the following files: