#ifndef WILDCARDS_H #define WILDCARDS_H /////////////////////////////////////////////////////////////// // wildcards.h - find strings that match, using wild cards // // ver 1.1 // // // // Language: Visual C++, ver 6.0 // // Platform: Dell Dimension 8100, Windows 2000, sp1 // // Application: CSE687 demonstration // // Author: Jim Fawcett, CST 2-187, (315) 443-3948 // // jfawcett@twcny.rr.com // /////////////////////////////////////////////////////////////// /* Manual Page ----------- This wildcards class constructs objects that hold strings which it assumes may have wildcard characters, e.g., "*" or "?". It provides a single member function to check for matches against a string that it assumes has no wild card characters. class wildcard Operations: -------------------------- wildcards wc("foo.*"); // may have "*" and/or "?" if(wc.matches("foo.bar") // no wild cards here cout << " got a match\n"; */ // /////////////////////////////////////////////////////////////// // maintenance page // /////////////////////////////////////////////////////////////// // Build Process // // // // Files Required: // // wildcards.h, wildcards.cpp // // // // Building with Visual C++ , ver 6.0, from command line: // // cl /GX /DTEST_WILDCARDS wildcards.cpp // // // /////////////////////////////////////////////////////////////// /* Maintenance History =================== ver 1.1 : 09 Jan 2002 - fixed bug in matching algorithm which caused failure if pattern ended in * ver 1.0 : 30 Jan 2000 - first release Planned Modifications: ====================== Detect more of the regular expression grammar. */ /////////////////////////////////////////////////////////////// // Declarations // /////////////////////////////////////////////////////////////// #include //----< default file and directory processing >---------------- class wildcards { public: wildcards(const std::string &pattern) : pat(pattern) { } bool matches(const std::string &s); private: std::string pat; }; #endif