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}::MatchName Class Reference

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

Public Member Functions

 MatchName (std::string const &name)
 Initialize a MatchName object. More...
bool operator() (FileEntry::pointer_t entry) const
 Compare an entry to this MatchName. 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::getName()) is identical to the name specified in the MatchName constructor.

Definition at line 60 of file filecollection.cpp.

Constructor & Destructor Documentation

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

This function saves the name to search in the FileCollection.

This class expect the name to be a full path and file name with extension. The full name has to match.

[in]nameThe name of the file being searched.

Definition at line 72 of file filecollection.cpp.

Member Function Documentation

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

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

We could transform that with lambda at some point.
[in]entryThe entry to compare with the MatchName.
true if the name of the entry matches the MatchName.

Definition at line 90 of file filecollection.cpp.

Member Data Documentation

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

Definition at line 96 of file filecollection.cpp.

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