zipios++  2.0.2
Zipios++ – a small C++ library that provides easy access to .zip files.
Public Member Functions | Private Attributes | List of all members
zipios::anonymous_namespace{filecollection.cpp}::MatchFileName Class Reference

Class object used with the std::find_if() function. More...

Public Member Functions

 MatchFileName (std::string const &name)
 Initialize a MatchFileName object. More...
 
bool operator() (FileEntry::pointer_t entry) const
 Compare an entry to this MatchFileName. More...
 

Private Attributes

std::string const m_name
 

Detailed Description

This function object is used with the STL find_if algorithm to find a FileEntry in a container, which name (as obtained with FileEntry::getFileName()) is identical to the name specified in the MatchFileName constructor.

Warning
The file name cannot include a '/' in this case or the search will always fail.

Definition at line 111 of file filecollection.cpp.

Constructor & Destructor Documentation

zipios::anonymous_namespace{filecollection.cpp}::MatchFileName::MatchFileName ( std::string const &  name)
inlineexplicit

This function saves the base name to search in the FileCollection.

This class expect the name to be a base file name, eventually with an extension. If the name includes a slash then the search will always fail.

Parameters
[in]nameThe name of the file being searched.

Definition at line 125 of file filecollection.cpp.

Member Function Documentation

bool zipios::anonymous_namespace{filecollection.cpp}::MatchFileName::operator() ( FileEntry::pointer_t  entry) const
inline

This function compares the base name of the entry with the saved base name. If equal, then it returns true. It is used with the std::find_if() function.

Todo:
We could transform that with lambda at some point.
Parameters
[in]entryThe entry to compare with the MatchFileName.
Returns
true if the name of the entry matches the MatchFileName.

Definition at line 143 of file filecollection.cpp.

Member Data Documentation

std::string const zipios::anonymous_namespace{filecollection.cpp}::MatchFileName::m_name
private

Definition at line 149 of file filecollection.cpp.


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