Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

CEnum - File Enumeration and File Globbing Class

, 6 Dec 2008
CEnum is used for enumeration of files and directories using wildcard matching (globbing)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>CEnum1: CEnum Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.7.1 -->
<script type="text/javascript">
<!--
function changeDisplayState (e){
  var num=this.id.replace(/[^[0-9]/g,'');
  var button=this.firstChild;
  var sectionDiv=document.getElementById('dynsection'+num);
  if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
    sectionDiv.style.display='block';
    button.src='open.gif';
  }else{
    sectionDiv.style.display='none';
    button.src='closed.gif';
  }
}
function initDynSections(){
  var divs=document.getElementsByTagName('div');
  var sectionCounter=1;
  for(var i=0;i<divs.length-1;i++){
    if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
      var header=divs[i];
      var section=divs[i+1];
      var button=header.firstChild;
      if (button!='IMG'){
        divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
        button=document.createElement('img');
        divs[i].insertBefore(button,divs[i].firstChild);
      }
      header.style.cursor='pointer';
      header.onclick=changeDisplayState;
      header.id='dynheader'+sectionCounter;
      button.src='closed.gif';
      section.id='dynsection'+sectionCounter;
      section.style.display='none';
      section.style.marginLeft='14px';
      sectionCounter++;
    }
  }
}
window.onload = initDynSections;
-->
</script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>CEnum Class Reference</h1><!-- doxytag: class="CEnum" --><a class="el" href="class_c_enum.html" title="CEnum - File Enumeration and File Globbing Class.">CEnum</a> - File Enumeration and File Globbing Class.  
<a href="#_details">More...</a>
<p>

<p>
<a href="class_c_enum-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#7d23d7d2c6e537a4c16dde04bc47c1b8">CEnum</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default constructor.  <a href="#7d23d7d2c6e537a4c16dde04bc47c1b8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#f1f9db14847a7bb3916d1bce24c388b1">CEnum</a> (<a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> sPath, <a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> sExcludePatternDirs=_T(&quot;&quot;), <a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> sExcludePatternFiles=_T(&quot;&quot;), <a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> sIncludePatternDirs=_T(&quot;&quot;), <a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> sIncludePatternFiles=_T(&quot;&quot;), bool bRecursiveSearch=false, bool bUseFullPath=false, bool bIgnoreCaseDirs=false, bool bIgnoreCaseFiles=false)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Parametrized constructor.  <a href="#f1f9db14847a7bb3916d1bce24c388b1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#6bad6a8388a408b1fd0fdb3b0f613084">~CEnum</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor.  <a href="#6bad6a8388a408b1fd0fdb3b0f613084"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#1183984e8ca2c2aab46bb5f194d55180">EnumerateAll</a> (<a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> sPath)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Start enumerating.  <a href="#1183984e8ca2c2aab46bb5f194d55180"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">list&lt; <a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &gt; *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#aab4eb0b3a2c65a1aca5bced63dfc2d7">GetDirs</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get a pointer to STL list of directories found.  <a href="#aab4eb0b3a2c65a1aca5bced63dfc2d7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">list&lt; <a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &gt; *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#8a6c835eef6e0f376e4b5f69296e3944">GetFiles</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get a pointer to STL list of files found.  <a href="#8a6c835eef6e0f376e4b5f69296e3944"></a><br></td></tr>
<tr><td colspan="2"><div class="groupHeader">MFC conversion functions</div></td></tr>
<tr><td colspan="2"><div class="groupText">These functions are hidden behind preprocessor directive #ifdef MFC, and are by default inactive (not compiled). <br><br></div></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">CStringArray *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#2eaa814f3cdad2ef9eaf78b21f73ad07">GetDirsAsCStringArray</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Convert STL list of directories found into a MFC CStringArray.  <a href="#2eaa814f3cdad2ef9eaf78b21f73ad07"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">CStringArray *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#b651054acfe9752b97e640ac2566be97">GetFilesAsCStringArray</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Convert STL list of files found into a MFC CStringArray.  <a href="#b651054acfe9752b97e640ac2566be97"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">CStringList *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#06b776a9abe25ac2d221a9d1e685833c">GetDirsAsCStringList</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Convert STL list of directories found into a MFC CStringList.  <a href="#06b776a9abe25ac2d221a9d1e685833c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">CStringList *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#28bdd7e09d3ba248bea06d4761902803">GetFilesAsCStringList</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Convert STL list of files found into a MFC CStringList.  <a href="#28bdd7e09d3ba248bea06d4761902803"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Public Attributes</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
<tr><td colspan="2"><div class="groupText">Public member variables are used to set desired options. Default values are empty strings _T("") for all Pattern strings, and false for bool values. In case of conflict, Exclude pattern has precedence over Include pattern. Multiple search strings can be separated by a semicolon ';' character. <br><br></div></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#e3eed7e9ddfee5b769931a758e43ffe1">sExcPatternDirs</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Exclude pattern in directory search.  <a href="#e3eed7e9ddfee5b769931a758e43ffe1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#ba1b137713cd8b81331446f39a456299">sExcPatternFiles</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Exclude pattern in file search.  <a href="#ba1b137713cd8b81331446f39a456299"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#0170adce01319f34c71d29146f9299ac">sIncPatternDirs</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Include pattern in directory search.  <a href="#0170adce01319f34c71d29146f9299ac"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#323cafacd230d68dac8d9f56e5c2db04">sIncPatternFiles</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Include pattern in file search.  <a href="#323cafacd230d68dac8d9f56e5c2db04"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#ae7cf72a584bed97e933b7e66d25b854">bRecursive</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Enumerate content of subdirectories too.  <a href="#ae7cf72a584bed97e933b7e66d25b854"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#6a8fab25b7332f1ea317e863a71b9f70">bFullPath</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Enumeration using file's full path.  <a href="#6a8fab25b7332f1ea317e863a71b9f70"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#e6d9387e3f37c84ee7aac6ddea1258be">bNoCaseDirs</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Ignore case when searching for directories (and only directories!).  <a href="#e6d9387e3f37c84ee7aac6ddea1258be"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#5b9907e2797bf093db3d6678414b8006">bNoCaseFiles</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Ignore case when searching for files (and only files!).  <a href="#5b9907e2797bf093db3d6678414b8006"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#e569d2fbc71b0a9664f746a431b24f08">CompareStrings</a> (LPCTSTR sPattern, LPCTSTR sFileName, bool bNoCase)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wildcard compare functionality. If desired, strings can be compared regardless of case.  <a href="#e569d2fbc71b0a9664f746a431b24f08"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#2d4ca338fff96a6b91c9ba768cae088d">CompareList</a> (list&lt; <a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &gt; &amp;plsPattern, <a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &amp;sFileName, bool bNoCase)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compare file name with one or more search patterns that user supplied.  <a href="#2d4ca338fff96a6b91c9ba768cae088d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#57b7842cffd46a96d271f6199707da11">Enumerate</a> (<a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &amp;sPath)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Start enumerating root directory.  <a href="#57b7842cffd46a96d271f6199707da11"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#4f36e518854cc60ad0b57cb0d4d40eb8">EnumerateFile</a> (<a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &amp;sPath, <a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &amp;sFileName, list&lt; <a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &gt; &amp;pList)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Enumerate a single file.  <a href="#4f36e518854cc60ad0b57cb0d4d40eb8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#f0654d806dc9f9de0579d1bdd1d8ea4f">EnumerateDir</a> (<a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &amp;sPath, <a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &amp;sDirName, list&lt; <a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &gt; &amp;pList)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Enumerate a single directory.  <a href="#f0654d806dc9f9de0579d1bdd1d8ea4f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#3dd7268e03ddcf93a531074283031d01">Tokenize</a> (list&lt; <a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &gt; &amp;plsTokenized, <a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &amp;sPattern)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Tokenize the search string, i.e. split it by tokenize character.  <a href="#3dd7268e03ddcf93a531074283031d01"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Private Attributes</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
<tr><td colspan="2"><div class="groupText">Notice the space in front of the right angle bracket in declaration of all six lists! <br><br></div></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">list&lt; <a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &gt; *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#9c3b31a91647b6537dbfa8d42af5d51e">plstDirs</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This std::list holds a list of directories found in a search.  <a href="#9c3b31a91647b6537dbfa8d42af5d51e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">list&lt; <a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &gt; *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#2e7577c67863f333f1e0440350ac6462">plstFiles</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This std::list holds a list of files found in a search.  <a href="#2e7577c67863f333f1e0440350ac6462"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">list&lt; <a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#4eed2d7bd97a6d7dce9e3abd170e8999">plstExcPatternDirs</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">User supplied, holds Exclude pattern(s) for directory search.  <a href="#4eed2d7bd97a6d7dce9e3abd170e8999"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">list&lt; <a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#3f4942934e9072e40f3d77056f499148">plstExcPatternFiles</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">User supplied, holds Exclude pattern(s) for file search.  <a href="#3f4942934e9072e40f3d77056f499148"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">list&lt; <a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#76a22ee013f475d5c06c56e439ad2c30">plstIncPatternDirs</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">User supplied, holds Include pattern(s) for directory search.  <a href="#76a22ee013f475d5c06c56e439ad2c30"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">list&lt; <a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#fff77913687d2491151ac0925661e423">plstIncPatternFiles</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">User supplied, holds Include pattern(s) for file search.  <a href="#fff77913687d2491151ac0925661e423"></a><br></td></tr>
<tr><td colspan="2"><div class="groupHeader">MFC containers</div></td></tr>
<tr><td colspan="2"><div class="groupText">This is used only in case user wants to convert std:: containers to their MFC counterparts and is, by default, inactive. <br><br></div></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">CStringArray *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#616ecf49cabe06e89a9e2df7c499050a">pCSArrayDirs</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">List of directories found in a search converted to MFC's CStringArray.  <a href="#616ecf49cabe06e89a9e2df7c499050a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">CStringArray *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#2575b1ef8b9803517ea4bd1f4405f82b">pCSArrayFiles</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">List of files found in a search converted to MFC's CStringArray.  <a href="#2575b1ef8b9803517ea4bd1f4405f82b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">CStringList *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#a3e87261a66891a6a92615305fe8b8ef">pCSListDirs</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">List of directories found in a search converted to MFC's CStringList.  <a href="#a3e87261a66891a6a92615305fe8b8ef"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">CStringList *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_enum.html#2bd5cbad53554476ff43fd5e3022a46f">pCSListFiles</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">List of files found in a search converted to MFC's CStringList.  <a href="#2bd5cbad53554476ff43fd5e3022a46f"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<a class="el" href="class_c_enum.html" title="CEnum - File Enumeration and File Globbing Class.">CEnum</a> - File Enumeration and File Globbing Class. 
<p>
<a class="el" href="class_c_enum.html" title="CEnum - File Enumeration and File Globbing Class.">CEnum</a> is a fast and simple class that lets you enumerate (i.e. make a list of) all files in a directory. It supports:<ul>
<li>the use of wild card characters * and ? (i.e. its a file globbing class too)</li><li>separate enumeration of files and subdirectories</li><li>separate include list, exclude list and ignore case option for both files and directories</li><li>recursive search (i.e. it can enumerate contest of subdirectories too)</li><li>enumeration either using file's full path or just file name</li><li>written in STL, but it optionally supports MFC collection classes</li><li>UNICODE aware (in MS world UNICODE stands for UTF-16 little-endian)</li><li>works as a wrapper around FindFirstFile and FindNextFile</li></ul>
<p>
<dl class="author" compact><dt><b>Author:</b></dt><dd>Loreia (loreia (at) net.hr) </dd></dl>
<dl class="version" compact><dt><b>Version:</b></dt><dd>1.1 </dd></dl>
<dl class="date" compact><dt><b>Date:</b></dt><dd>published on www.codeproject.com on 11/2008 </dd></dl>
<dl class="user" compact><dt><b>License</b></dt><dd>There is no limitation on use of this class. You may freely use, redistribute and modify this code (as whole or just parts of it) with or without author's premission in any sort of project regardless of license issues, in both commercial and open source projects. </dd></dl>
<dl class="user" compact><dt><b>Errata</b></dt><dd><ol type=1>
<li>Fatal error C1010: unexpected end of file while looking for precompiled header.<br>
 Did you forget to add '#include "stdafx.h"' to your source?<br>
</li></ol>
<ul>
<li>Solution:<br>
<ol type=a>
<li>In the Solution Explorer pane of the project, right-click the project name, and then click Properties.<br>
</li><li>In the left pane, click the C/C++ folder. <br>
</li><li>Click the Precompiled Headers node. <br>
</li><li>In the right pane, click Create/Use Precompiled Header, and then click Not Using Precompiled Headers. <br>
 </li></ol>
</li></ul>
</dd></dl>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="7d23d7d2c6e537a4c16dde04bc47c1b8"></a><!-- doxytag: member="CEnum::CEnum" ref="7d23d7d2c6e537a4c16dde04bc47c1b8" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CEnum::CEnum           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Default constructor. 
<p>
Default constructor initializes all members to the most common values. If you wish, change defaults to your liking. 
</div>
</div><p>
<a class="anchor" name="f1f9db14847a7bb3916d1bce24c388b1"></a><!-- doxytag: member="CEnum::CEnum" ref="f1f9db14847a7bb3916d1bce24c388b1" args="(_stl_string sPath, _stl_string sExcludePatternDirs=_T(&quot;&quot;), _stl_string sExcludePatternFiles=_T(&quot;&quot;), _stl_string sIncludePatternDirs=_T(&quot;&quot;), _stl_string sIncludePatternFiles=_T(&quot;&quot;), bool bRecursiveSearch=false, bool bUseFullPath=false, bool bIgnoreCaseDirs=false, bool bIgnoreCaseFiles=false)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CEnum::CEnum           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a>&nbsp;</td>
          <td class="paramname"> <em>sPath</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a>&nbsp;</td>
          <td class="paramname"> <em>sExcludePatternDirs</em> = <code>_T(&quot;&quot;)</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a>&nbsp;</td>
          <td class="paramname"> <em>sExcludePatternFiles</em> = <code>_T(&quot;&quot;)</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a>&nbsp;</td>
          <td class="paramname"> <em>sIncludePatternDirs</em> = <code>_T(&quot;&quot;)</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a>&nbsp;</td>
          <td class="paramname"> <em>sIncludePatternFiles</em> = <code>_T(&quot;&quot;)</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>bRecursiveSearch</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>bUseFullPath</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>bIgnoreCaseDirs</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>bIgnoreCaseFiles</em> = <code>false</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Parametrized constructor. 
<p>
Parametrized constructor uses the same defaults for member vaiables as default constructor... <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_c_enum.html#1183984e8ca2c2aab46bb5f194d55180" title="Start enumerating.">EnumerateAll()</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="6bad6a8388a408b1fd0fdb3b0f613084"></a><!-- doxytag: member="CEnum::~CEnum" ref="6bad6a8388a408b1fd0fdb3b0f613084" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CEnum::~CEnum           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Destructor. 
<p>
If you don't want to free memory allocated by <a class="el" href="class_c_enum.html" title="CEnum - File Enumeration and File Globbing Class.">CEnum</a> than comment out some (or all) lines of destructor. 
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="2d4ca338fff96a6b91c9ba768cae088d"></a><!-- doxytag: member="CEnum::CompareList" ref="2d4ca338fff96a6b91c9ba768cae088d" args="(list&lt; _stl_string &gt; &amp;plsPattern, _stl_string &amp;sFileName, bool bNoCase)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool CEnum::CompareList           </td>
          <td>(</td>
          <td class="paramtype">list&lt; <a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &gt; &amp;&nbsp;</td>
          <td class="paramname"> <em>plsPattern</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>sFileName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>bNoCase</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [inline, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Compare file name with one or more search patterns that user supplied. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>plsPattern</em>&nbsp;</td><td>STL list of tokenized search patterns. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>sFileName</em>&nbsp;</td><td>A string to compare to search pattern(s), (in this class it is always a file name) </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>bNoCase</em>&nbsp;</td><td>If true, case will be ignored when comparing strings </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The test results, true if at least one search string matches file name, false otherwise </dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_c_enum.html#3dd7268e03ddcf93a531074283031d01" title="Tokenize the search string, i.e. split it by tokenize character.">Tokenize()</a>, <a class="el" href="class_c_enum.html#e569d2fbc71b0a9664f746a431b24f08" title="Wildcard compare functionality. If desired, strings can be compared regardless of...">CompareStrings()</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="e569d2fbc71b0a9664f746a431b24f08"></a><!-- doxytag: member="CEnum::CompareStrings" ref="e569d2fbc71b0a9664f746a431b24f08" args="(LPCTSTR sPattern, LPCTSTR sFileName, bool bNoCase)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool CEnum::CompareStrings           </td>
          <td>(</td>
          <td class="paramtype">LPCTSTR&nbsp;</td>
          <td class="paramname"> <em>sPattern</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">LPCTSTR&nbsp;</td>
          <td class="paramname"> <em>sFileName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>bNoCase</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [inline, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Wildcard compare functionality. If desired, strings can be compared regardless of case. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>sPattern</em>&nbsp;</td><td>Wildcard string, it can contain wild card characters '?' (match exactly one char) and '*' (match zero or more chars) </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>sFileName</em>&nbsp;</td><td>A string to compare to sPattern, (in this class it is always a file name) </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>bNoCase</em>&nbsp;</td><td>If true, case will be ignored when comparing strings </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The test result, true if strings match, false otherwise </dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_c_enum.html#2d4ca338fff96a6b91c9ba768cae088d" title="Compare file name with one or more search patterns that user supplied.">CompareList()</a>, <a class="el" href="class_c_enum.html#1183984e8ca2c2aab46bb5f194d55180" title="Start enumerating.">EnumerateAll()</a> </dd></dl>
<dl class="note" compact><dt><b>Note:</b></dt><dd>'_tcsicmp' function requires to set locale by calling '_tsetlocale' </dd></dl>

</div>
</div><p>
<a class="anchor" name="57b7842cffd46a96d271f6199707da11"></a><!-- doxytag: member="CEnum::Enumerate" ref="57b7842cffd46a96d271f6199707da11" args="(_stl_string &amp;sPath)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CEnum::Enumerate           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>sPath</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Start enumerating root directory. 
<p>
This function does the actual enumeration. It scans for files and dirs and enumerates them if they match search criteria. If needed, function can call itself to enumerate subdirectories. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>sPath</em>&nbsp;</td><td>Root directory to start your search from. </td></tr>
  </table>
</dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_c_enum.html#4f36e518854cc60ad0b57cb0d4d40eb8" title="Enumerate a single file.">EnumerateFile()</a>, <a class="el" href="class_c_enum.html#f0654d806dc9f9de0579d1bdd1d8ea4f" title="Enumerate a single directory.">EnumerateDir()</a></dd></dl>
<dl class="warning" compact><dt><b>Warning:</b></dt><dd>After enumerating files in each directory, STL list's sort() method is called to sort list in alphabetic order. This may cause file names to be sorted in different order than in windows explorer. If you wish you can comment out a call to sort() method, and provide your own sorting functionallity. </dd></dl>

</div>
</div><p>
<a class="anchor" name="1183984e8ca2c2aab46bb5f194d55180"></a><!-- doxytag: member="CEnum::EnumerateAll" ref="1183984e8ca2c2aab46bb5f194d55180" args="(_stl_string sPath)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CEnum::EnumerateAll           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a>&nbsp;</td>
          <td class="paramname"> <em>sPath</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Start enumerating. 
<p>
This is one and only public method (because MFC stuff is not compiled by default), and it does all the work. After setting public member variables, user only needs to call this method. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>sPath</em>&nbsp;</td><td>Root directory to start your search from. </td></tr>
  </table>
</dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_c_enum.html#57b7842cffd46a96d271f6199707da11" title="Start enumerating root directory.">Enumerate()</a>, <a class="el" href="class_c_enum.html#3dd7268e03ddcf93a531074283031d01" title="Tokenize the search string, i.e. split it by tokenize character.">Tokenize()</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="f0654d806dc9f9de0579d1bdd1d8ea4f"></a><!-- doxytag: member="CEnum::EnumerateDir" ref="f0654d806dc9f9de0579d1bdd1d8ea4f" args="(_stl_string &amp;sPath, _stl_string &amp;sDirName, list&lt; _stl_string &gt; &amp;pList)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CEnum::EnumerateDir           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>sPath</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>sDirName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">list&lt; <a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &gt; &amp;&nbsp;</td>
          <td class="paramname"> <em>pList</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [inline, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Enumerate a single directory. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>sPath</em>&nbsp;</td><td>Path to directory where newly found directory item resides. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>sDirName</em>&nbsp;</td><td>Name of the directory that is about to be enumerated. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pList</em>&nbsp;</td><td>A reference to STL list in which item will be enumerated. </td></tr>
  </table>
</dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_c_enum.html#57b7842cffd46a96d271f6199707da11" title="Start enumerating root directory.">Enumerate()</a>, <a class="el" href="class_c_enum.html#4f36e518854cc60ad0b57cb0d4d40eb8" title="Enumerate a single file.">EnumerateFile()</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="4f36e518854cc60ad0b57cb0d4d40eb8"></a><!-- doxytag: member="CEnum::EnumerateFile" ref="4f36e518854cc60ad0b57cb0d4d40eb8" args="(_stl_string &amp;sPath, _stl_string &amp;sFileName, list&lt; _stl_string &gt; &amp;pList)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CEnum::EnumerateFile           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>sPath</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>sFileName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">list&lt; <a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &gt; &amp;&nbsp;</td>
          <td class="paramname"> <em>pList</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [inline, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Enumerate a single file. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>sPath</em>&nbsp;</td><td>Path to directory where file resides. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>sFileName</em>&nbsp;</td><td>Name of the file that is about to be enumerated. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pList</em>&nbsp;</td><td>A reference to STL list in which file will be enumerated </td></tr>
  </table>
</dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_c_enum.html#57b7842cffd46a96d271f6199707da11" title="Start enumerating root directory.">Enumerate()</a>, <a class="el" href="class_c_enum.html#f0654d806dc9f9de0579d1bdd1d8ea4f" title="Enumerate a single directory.">EnumerateDir()</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="aab4eb0b3a2c65a1aca5bced63dfc2d7"></a><!-- doxytag: member="CEnum::GetDirs" ref="aab4eb0b3a2c65a1aca5bced63dfc2d7" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">list&lt;<a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &gt;* CEnum::GetDirs           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get a pointer to STL list of directories found. 
<p>
After enumeration is done, call this method to obtain pointer to STL list of directories found. This object is free'd in CEnum's destructor <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_c_enum.html#57b7842cffd46a96d271f6199707da11" title="Start enumerating root directory.">Enumerate()</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="2eaa814f3cdad2ef9eaf78b21f73ad07"></a><!-- doxytag: member="CEnum::GetDirsAsCStringArray" ref="2eaa814f3cdad2ef9eaf78b21f73ad07" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CStringArray* CEnum::GetDirsAsCStringArray           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Convert STL list of directories found into a MFC CStringArray. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>A pointer to new MFC CStringArray containing the list of directories found. </dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_c_enum.html#06b776a9abe25ac2d221a9d1e685833c" title="Convert STL list of directories found into a MFC CStringList.">GetDirsAsCStringList()</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="06b776a9abe25ac2d221a9d1e685833c"></a><!-- doxytag: member="CEnum::GetDirsAsCStringList" ref="06b776a9abe25ac2d221a9d1e685833c" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CStringList* CEnum::GetDirsAsCStringList           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Convert STL list of directories found into a MFC CStringList. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>A pointer to new MFC CStringList containing the list of directories found. </dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_c_enum.html#2eaa814f3cdad2ef9eaf78b21f73ad07" title="Convert STL list of directories found into a MFC CStringArray.">GetDirsAsCStringArray()</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="8a6c835eef6e0f376e4b5f69296e3944"></a><!-- doxytag: member="CEnum::GetFiles" ref="8a6c835eef6e0f376e4b5f69296e3944" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">list&lt;<a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &gt;* CEnum::GetFiles           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get a pointer to STL list of files found. 
<p>
After enumeration is done, call this method to obtain pointer to STL list of files found. This object is free'd in CEnum's destructor <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_c_enum.html#57b7842cffd46a96d271f6199707da11" title="Start enumerating root directory.">Enumerate()</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="b651054acfe9752b97e640ac2566be97"></a><!-- doxytag: member="CEnum::GetFilesAsCStringArray" ref="b651054acfe9752b97e640ac2566be97" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CStringArray* CEnum::GetFilesAsCStringArray           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Convert STL list of files found into a MFC CStringArray. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>A pointer to new MFC CStringArray containing the list of files found. </dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_c_enum.html#28bdd7e09d3ba248bea06d4761902803" title="Convert STL list of files found into a MFC CStringList.">GetFilesAsCStringList()</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="28bdd7e09d3ba248bea06d4761902803"></a><!-- doxytag: member="CEnum::GetFilesAsCStringList" ref="28bdd7e09d3ba248bea06d4761902803" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CStringList* CEnum::GetFilesAsCStringList           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Convert STL list of files found into a MFC CStringList. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>A pointer to new MFC CStringList containing the list of files found. </dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_c_enum.html#b651054acfe9752b97e640ac2566be97" title="Convert STL list of files found into a MFC CStringArray.">GetFilesAsCStringArray()</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="3dd7268e03ddcf93a531074283031d01"></a><!-- doxytag: member="CEnum::Tokenize" ref="3dd7268e03ddcf93a531074283031d01" args="(list&lt; _stl_string &gt; &amp;plsTokenized, _stl_string &amp;sPattern)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CEnum::Tokenize           </td>
          <td>(</td>
          <td class="paramtype">list&lt; <a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &gt; &amp;&nbsp;</td>
          <td class="paramname"> <em>plsTokenized</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>sPattern</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [inline, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Tokenize the search string, i.e. split it by tokenize character. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>plsTokenized</em>&nbsp;</td><td>STL list that holds tokenizes strings. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>sPattern</em>&nbsp;</td><td>Pattern string that user supplied, it may or may not contain multiple search strings separated by tokenize character. </td></tr>
  </table>
</dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_c_enum.html#1183984e8ca2c2aab46bb5f194d55180" title="Start enumerating.">EnumerateAll()</a> </dd></dl>
<dl class="note" compact><dt><b>Note:</b></dt><dd>Tokenize character is ';' (semicolon) </dd></dl>

</div>
</div><p>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="6a8fab25b7332f1ea317e863a71b9f70"></a><!-- doxytag: member="CEnum::bFullPath" ref="6a8fab25b7332f1ea317e863a71b9f70" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="class_c_enum.html#6a8fab25b7332f1ea317e863a71b9f70">CEnum::bFullPath</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Enumeration using file's full path. 
<p>

</div>
</div><p>
<a class="anchor" name="e6d9387e3f37c84ee7aac6ddea1258be"></a><!-- doxytag: member="CEnum::bNoCaseDirs" ref="e6d9387e3f37c84ee7aac6ddea1258be" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="class_c_enum.html#e6d9387e3f37c84ee7aac6ddea1258be">CEnum::bNoCaseDirs</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Ignore case when searching for directories (and only directories!). 
<p>

</div>
</div><p>
<a class="anchor" name="5b9907e2797bf093db3d6678414b8006"></a><!-- doxytag: member="CEnum::bNoCaseFiles" ref="5b9907e2797bf093db3d6678414b8006" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="class_c_enum.html#5b9907e2797bf093db3d6678414b8006">CEnum::bNoCaseFiles</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Ignore case when searching for files (and only files!). 
<p>

</div>
</div><p>
<a class="anchor" name="ae7cf72a584bed97e933b7e66d25b854"></a><!-- doxytag: member="CEnum::bRecursive" ref="ae7cf72a584bed97e933b7e66d25b854" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="class_c_enum.html#ae7cf72a584bed97e933b7e66d25b854">CEnum::bRecursive</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Enumerate content of subdirectories too. 
<p>

</div>
</div><p>
<a class="anchor" name="616ecf49cabe06e89a9e2df7c499050a"></a><!-- doxytag: member="CEnum::pCSArrayDirs" ref="616ecf49cabe06e89a9e2df7c499050a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CStringArray* <a class="el" href="class_c_enum.html#616ecf49cabe06e89a9e2df7c499050a">CEnum::pCSArrayDirs</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
List of directories found in a search converted to MFC's CStringArray. 
<p>

</div>
</div><p>
<a class="anchor" name="2575b1ef8b9803517ea4bd1f4405f82b"></a><!-- doxytag: member="CEnum::pCSArrayFiles" ref="2575b1ef8b9803517ea4bd1f4405f82b" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CStringArray* <a class="el" href="class_c_enum.html#2575b1ef8b9803517ea4bd1f4405f82b">CEnum::pCSArrayFiles</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
List of files found in a search converted to MFC's CStringArray. 
<p>

</div>
</div><p>
<a class="anchor" name="a3e87261a66891a6a92615305fe8b8ef"></a><!-- doxytag: member="CEnum::pCSListDirs" ref="a3e87261a66891a6a92615305fe8b8ef" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CStringList* <a class="el" href="class_c_enum.html#a3e87261a66891a6a92615305fe8b8ef">CEnum::pCSListDirs</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
List of directories found in a search converted to MFC's CStringList. 
<p>

</div>
</div><p>
<a class="anchor" name="2bd5cbad53554476ff43fd5e3022a46f"></a><!-- doxytag: member="CEnum::pCSListFiles" ref="2bd5cbad53554476ff43fd5e3022a46f" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CStringList* <a class="el" href="class_c_enum.html#2bd5cbad53554476ff43fd5e3022a46f">CEnum::pCSListFiles</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
List of files found in a search converted to MFC's CStringList. 
<p>

</div>
</div><p>
<a class="anchor" name="9c3b31a91647b6537dbfa8d42af5d51e"></a><!-- doxytag: member="CEnum::plstDirs" ref="9c3b31a91647b6537dbfa8d42af5d51e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">list&lt;<a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &gt;* <a class="el" href="class_c_enum.html#9c3b31a91647b6537dbfa8d42af5d51e">CEnum::plstDirs</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This std::list holds a list of directories found in a search. 
<p>

</div>
</div><p>
<a class="anchor" name="4eed2d7bd97a6d7dce9e3abd170e8999"></a><!-- doxytag: member="CEnum::plstExcPatternDirs" ref="4eed2d7bd97a6d7dce9e3abd170e8999" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">list&lt;<a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &gt; <a class="el" href="class_c_enum.html#4eed2d7bd97a6d7dce9e3abd170e8999">CEnum::plstExcPatternDirs</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
User supplied, holds Exclude pattern(s) for directory search. 
<p>

</div>
</div><p>
<a class="anchor" name="3f4942934e9072e40f3d77056f499148"></a><!-- doxytag: member="CEnum::plstExcPatternFiles" ref="3f4942934e9072e40f3d77056f499148" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">list&lt;<a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &gt; <a class="el" href="class_c_enum.html#3f4942934e9072e40f3d77056f499148">CEnum::plstExcPatternFiles</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
User supplied, holds Exclude pattern(s) for file search. 
<p>

</div>
</div><p>
<a class="anchor" name="2e7577c67863f333f1e0440350ac6462"></a><!-- doxytag: member="CEnum::plstFiles" ref="2e7577c67863f333f1e0440350ac6462" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">list&lt;<a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &gt;* <a class="el" href="class_c_enum.html#2e7577c67863f333f1e0440350ac6462">CEnum::plstFiles</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This std::list holds a list of files found in a search. 
<p>

</div>
</div><p>
<a class="anchor" name="76a22ee013f475d5c06c56e439ad2c30"></a><!-- doxytag: member="CEnum::plstIncPatternDirs" ref="76a22ee013f475d5c06c56e439ad2c30" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">list&lt;<a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &gt; <a class="el" href="class_c_enum.html#76a22ee013f475d5c06c56e439ad2c30">CEnum::plstIncPatternDirs</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
User supplied, holds Include pattern(s) for directory search. 
<p>

</div>
</div><p>
<a class="anchor" name="fff77913687d2491151ac0925661e423"></a><!-- doxytag: member="CEnum::plstIncPatternFiles" ref="fff77913687d2491151ac0925661e423" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">list&lt;<a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> &gt; <a class="el" href="class_c_enum.html#fff77913687d2491151ac0925661e423">CEnum::plstIncPatternFiles</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
User supplied, holds Include pattern(s) for file search. 
<p>

</div>
</div><p>
<a class="anchor" name="e3eed7e9ddfee5b769931a758e43ffe1"></a><!-- doxytag: member="CEnum::sExcPatternDirs" ref="e3eed7e9ddfee5b769931a758e43ffe1" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> <a class="el" href="class_c_enum.html#e3eed7e9ddfee5b769931a758e43ffe1">CEnum::sExcPatternDirs</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Exclude pattern in directory search. 
<p>

</div>
</div><p>
<a class="anchor" name="ba1b137713cd8b81331446f39a456299"></a><!-- doxytag: member="CEnum::sExcPatternFiles" ref="ba1b137713cd8b81331446f39a456299" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> <a class="el" href="class_c_enum.html#ba1b137713cd8b81331446f39a456299">CEnum::sExcPatternFiles</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Exclude pattern in file search. 
<p>

</div>
</div><p>
<a class="anchor" name="0170adce01319f34c71d29146f9299ac"></a><!-- doxytag: member="CEnum::sIncPatternDirs" ref="0170adce01319f34c71d29146f9299ac" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> <a class="el" href="class_c_enum.html#0170adce01319f34c71d29146f9299ac">CEnum::sIncPatternDirs</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Include pattern in directory search. 
<p>

</div>
</div><p>
<a class="anchor" name="323cafacd230d68dac8d9f56e5c2db04"></a><!-- doxytag: member="CEnum::sIncPatternFiles" ref="323cafacd230d68dac8d9f56e5c2db04" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_c_enum_8cpp.html#c110a68c852436709bd7d6685402d062">_stl_string</a> <a class="el" href="class_c_enum.html#323cafacd230d68dac8d9f56e5c2db04">CEnum::sIncPatternFiles</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Include pattern in file search. 
<p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li>F:/Old/Programming/CodeProject.com/My Articles/CEnum update/doxy-test/<a class="el" href="_c_enum_8cpp.html">CEnum.cpp</a></ul>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 3 12:45:13 2008 for CEnum1 by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.7.1 </small></address>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Loreia

Croatia Croatia
Nothing to brag about.
Just another engineer who works as a software developer last couple of years.

| Advertise | Privacy | Mobile
Web02 | 2.8.140905.1 | Last Updated 6 Dec 2008
Article Copyright 2008 by Loreia
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid