| <HTML><HEAD><TITLE>Xalan-C++ API Documentation</TITLE></HEAD>
|
| <BODY>
|
| <h2 align="center">Xalan-C++ API Documentation</h2>
|
| <h3 align="center">The Xalan C++ XSLT Processor Version 1.10</h3>
|
| </BODY> |
| <!-- Generated by Doxygen 1.2.8.1 --> |
| <center> |
| <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> |
| <hr><h1>DirectoryEnumerator.hpp</h1><a href="DirectoryEnumerator_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">/*</font> |
| 00002 <font class="comment"> * Copyright 1999-2004 The Apache Software Foundation.</font> |
| 00003 <font class="comment"> *</font> |
| 00004 <font class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</font> |
| 00005 <font class="comment"> * you may not use this file except in compliance with the License.</font> |
| 00006 <font class="comment"> * You may obtain a copy of the License at</font> |
| 00007 <font class="comment"> *</font> |
| 00008 <font class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</font> |
| 00009 <font class="comment"> *</font> |
| 00010 <font class="comment"> * Unless required by applicable law or agreed to in writing, software</font> |
| 00011 <font class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</font> |
| 00012 <font class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</font> |
| 00013 <font class="comment"> * See the License for the specific language governing permissions and</font> |
| 00014 <font class="comment"> * limitations under the License.</font> |
| 00015 <font class="comment"> */</font> |
| 00016 <font class="preprocessor">#if !defined(DIRECTORY_ENUMERATOR_HEADER_GUARD_1357924680)</font> |
| <a name="l00017"></a><a class="code" href="DirectoryEnumerator_8hpp.html#a0">00017</a> <font class="preprocessor"></font><font class="preprocessor">#define DIRECTORY_ENUMERATOR_HEADER_GUARD_1357924680</font> |
| 00018 <font class="preprocessor"></font> |
| 00019 |
| 00020 |
| 00021 <font class="comment">// Base header file. Must be first.</font> |
| 00022 <font class="preprocessor">#include <<a class="code" href="PlatformSupportDefinitions_8hpp.html">xalanc/PlatformSupport/PlatformSupportDefinitions.hpp</a>></font> |
| 00023 |
| 00024 |
| 00025 |
| 00026 <font class="preprocessor">#if defined(_MSC_VER)</font> |
| 00027 <font class="preprocessor"></font><font class="preprocessor">#include <io.h></font> |
| 00028 <font class="preprocessor">#else</font> |
| 00029 <font class="preprocessor"></font><font class="preprocessor">#include <unistd.h></font> |
| 00030 <font class="preprocessor">#include <dirent.h></font> |
| 00031 <font class="preprocessor">#include <sys/stat.h></font> |
| 00032 <font class="preprocessor">#include <errno.h></font> |
| 00033 <font class="preprocessor">#endif</font> |
| 00034 <font class="preprocessor"></font> |
| 00035 |
| 00036 |
| 00037 <font class="preprocessor">#include <functional></font> |
| 00038 <font class="preprocessor">#include <iterator></font> |
| 00039 |
| 00040 |
| 00041 <font class="preprocessor">#include "xercesc/framework/MemoryManager.hpp"</font> |
| 00042 |
| 00043 |
| 00044 |
| 00045 <font class="preprocessor">#include "<a class="code" href="XalanFileOutputStream_8hpp.html">xalanc/PlatformSupport/XalanFileOutputStream.hpp</a>"</font> |
| 00046 <font class="preprocessor">#include "<a class="code" href="DOMStringHelper_8hpp.html">xalanc/PlatformSupport/DOMStringHelper.hpp</a>"</font> |
| 00047 <font class="preprocessor">#include "<a class="code" href="XalanUnicode_8hpp.html">xalanc/PlatformSupport/XalanUnicode.hpp</a>"</font> |
| 00048 |
| 00049 |
| 00050 |
| 00051 XALAN_CPP_NAMESPACE_BEGIN |
| 00052 |
| 00053 |
| 00054 |
| <a name="l00055"></a><a class="code" href="DirectoryEnumerator_8hpp.html#a1">00055</a> <a class="code" href="XSLTInputSource_8hpp.html#a3">XALAN_USING_XERCES</a>(MemoryManager) |
| 00056 |
| 00057 |
| 00058 |
| 00059 <font class="preprocessor">#if defined(_MSC_VER)</font> |
| 00060 <font class="preprocessor"></font> |
| 00061 <font class="keyword">struct </font>FindFileStruct : <font class="keyword">public</font> _wfinddata_t |
| 00062 { |
| 00063 |
| 00064 <font class="keyword">enum</font> eAttributes |
| 00065 { |
| 00066 eAttributeArchive = _A_ARCH, |
| 00067 eAttributeDirectory = _A_SUBDIR, |
| 00068 eAttributeHidden = _A_HIDDEN, |
| 00069 eAttributeNormal = _A_NORMAL, |
| 00070 eReadOnly = _A_RDONLY, |
| 00071 eSystem = _A_SYSTEM |
| 00072 }; |
| 00073 |
| 00074 <font class="keyword">public</font>: |
| 00075 |
| 00081 <font class="keyword">const</font> XalanDOMChar* |
| 00082 getName()<font class="keyword"> const</font> |
| 00083 <font class="keyword"> </font>{ |
| 00084 <font class="keywordflow">return</font> name; |
| 00085 } |
| 00086 |
| 00092 <font class="keywordtype">bool</font> |
| 00093 isDirectory()<font class="keyword"> const</font> |
| 00094 <font class="keyword"> </font>{ |
| 00095 <font class="keywordflow">return</font> attrib & eAttributeDirectory ? <font class="keyword">true</font> : <font class="keyword">false</font>; |
| 00096 } |
| 00097 |
| 00098 <font class="keywordtype">bool</font> |
| 00099 isSelfOrParent()<font class="keyword"> const</font> |
| 00100 <font class="keyword"> </font>{ |
| 00101 <font class="keywordflow">if</font> (isDirectory() == <font class="keyword">false</font>) |
| 00102 { |
| 00103 <font class="keywordflow">return</font> <font class="keyword">false</font>; |
| 00104 } |
| 00105 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (name[0] == <font class="charliteral">'.'</font>) |
| 00106 { |
| 00107 <font class="keywordflow">if</font> (name[1] == <font class="charliteral">'\0'</font>) |
| 00108 { |
| 00109 <font class="keywordflow">return</font> <font class="keyword">true</font>; |
| 00110 } |
| 00111 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (name[1] == <font class="charliteral">'.'</font> && |
| 00112 name[2] == <font class="charliteral">'\0'</font>) |
| 00113 { |
| 00114 <font class="keywordflow">return</font> <font class="keyword">true</font>; |
| 00115 } |
| 00116 <font class="keywordflow">else</font> |
| 00117 { |
| 00118 <font class="keywordflow">return</font> <font class="keyword">false</font>; |
| 00119 } |
| 00120 } |
| 00121 <font class="keywordflow">else</font> |
| 00122 { |
| 00123 <font class="keywordflow">return</font> <font class="keyword">false</font>; |
| 00124 } |
| 00125 } |
| 00126 }; |
| 00127 |
| 00128 <font class="preprocessor">#else</font> |
| 00129 <font class="preprocessor"></font> |
| 00130 <font class="keyword">struct </font>FindFileStruct : <font class="keyword">public</font> dirent |
| 00131 { |
| 00132 <font class="keyword">public</font>: |
| 00133 |
| 00139 <font class="keyword">const</font> <font class="keywordtype">char</font>* getName()<font class="keyword"> const</font> |
| 00140 <font class="keyword"> </font>{ |
| 00141 <font class="keywordflow">return</font> d_name; |
| 00142 } |
| 00143 |
| 00149 <font class="keywordtype">bool</font> isDirectory()<font class="keyword"> const</font> |
| 00150 <font class="keyword"> </font>{ |
| 00151 <font class="preprocessor">#if defined(__SunOS_5_10) && (__SUNPRO_CC >= 0x570)</font> |
| 00152 <font class="preprocessor"></font> <font class="keyword">struct </font>stat64 stat_Info; |
| 00153 |
| 00154 <font class="keyword">const</font> <font class="keywordtype">int</font> retCode = stat64(d_name, &stat_Info); |
| 00155 <font class="preprocessor">#else</font> |
| 00156 <font class="preprocessor"></font> <font class="keyword">struct </font>stat stat_Info; |
| 00157 |
| 00158 <font class="keyword">const</font> <font class="keywordtype">int</font> retCode = stat(d_name, &stat_Info); |
| 00159 <font class="preprocessor">#endif</font> |
| 00160 <font class="preprocessor"></font> |
| 00161 <font class="keywordflow">return</font> retCode == -1 ? <font class="keyword">false</font> : S_ISDIR(stat_Info.st_mode); |
| 00162 } |
| 00163 |
| 00164 <font class="keywordtype">bool</font> |
| 00165 isSelfOrParent()<font class="keyword"> const</font> |
| 00166 <font class="keyword"> </font>{ |
| 00167 <font class="keywordflow">if</font> (isDirectory() == <font class="keyword">false</font>) |
| 00168 { |
| 00169 <font class="keywordflow">return</font> <font class="keyword">false</font>; |
| 00170 } |
| 00171 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (d_name[0] == <font class="charliteral">'.'</font>) |
| 00172 { |
| 00173 <font class="keywordflow">if</font> (d_name[1] == <font class="charliteral">'\0'</font>) |
| 00174 { |
| 00175 <font class="keywordflow">return</font> <font class="keyword">true</font>; |
| 00176 } |
| 00177 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (d_name[1] == <font class="charliteral">'.'</font> && |
| 00178 d_name[2] == <font class="charliteral">'\0'</font>) |
| 00179 { |
| 00180 <font class="keywordflow">return</font> <font class="keyword">true</font>; |
| 00181 } |
| 00182 <font class="keywordflow">else</font> |
| 00183 { |
| 00184 <font class="keywordflow">return</font> <font class="keyword">false</font>; |
| 00185 } |
| 00186 } |
| 00187 <font class="keywordflow">else</font> |
| 00188 { |
| 00189 <font class="keywordflow">return</font> <font class="keyword">false</font>; |
| 00190 } |
| 00191 } |
| 00192 }; |
| 00193 |
| 00194 <font class="preprocessor">#endif</font> |
| 00195 <font class="preprocessor"></font> |
| 00196 |
| 00197 |
| 00198 <font class="preprocessor">#if defined(XALAN_NO_STD_NAMESPACE)</font> |
| 00199 <font class="preprocessor"></font><font class="keyword">struct </font><a class="code" href="structDirectoryFilterPredicate.html">DirectoryFilterPredicate</a> : <font class="keyword">public</font> unary_function<FindFileStruct, bool> |
| 00200 #else |
| <a name="l00201"></a><a class="code" href="structDirectoryFilterPredicate.html">00201</a> struct <a class="code" href="structDirectoryFilterPredicate.html">DirectoryFilterPredicate</a> : <font class="keyword">public</font> std::unary_function<FindFileStruct, bool> |
| 00202 #endif |
| 00203 { |
| 00204 result_type |
| <a name="l00205"></a><a class="code" href="structDirectoryFilterPredicate.html#a0">00205</a> <a class="code" href="structDirectoryFilterPredicate.html#a0">operator()</a>(<font class="keyword">const</font> argument_type& theFindData)<font class="keyword"> const</font> |
| 00206 <font class="keyword"> </font>{ |
| 00207 <font class="keywordflow">return</font> theFindData.isDirectory(); |
| 00208 } |
| 00209 }; |
| 00210 |
| 00211 |
| 00212 |
| 00213 <font class="preprocessor">#if defined(XALAN_NO_STD_NAMESPACE)</font> |
| 00214 <font class="preprocessor"></font><font class="keyword">struct </font><a class="code" href="structFilesOnlyFilterPredicate.html">FilesOnlyFilterPredicate</a> : <font class="keyword">public</font> unary_function<FindFileStruct, bool> |
| 00215 #else |
| <a name="l00216"></a><a class="code" href="structFilesOnlyFilterPredicate.html">00216</a> struct <a class="code" href="structFilesOnlyFilterPredicate.html">FilesOnlyFilterPredicate</a> : <font class="keyword">public</font> std::unary_function<FindFileStruct, bool> |
| 00217 #endif |
| 00218 { |
| 00219 result_type |
| <a name="l00220"></a><a class="code" href="structFilesOnlyFilterPredicate.html#a0">00220</a> <a class="code" href="structDirectoryFilterPredicate.html#a0">operator()</a>(<font class="keyword">const</font> argument_type& theFindData)<font class="keyword"> const</font> |
| 00221 <font class="keyword"> </font>{ |
| 00222 <a class="code" href="structDirectoryFilterPredicate.html">DirectoryFilterPredicate</a> theDirectoryPredicate; |
| 00223 |
| 00224 <font class="keywordflow">return</font> !theDirectoryPredicate(theFindData); |
| 00225 |
| 00226 } |
| 00227 }; |
| 00228 |
| 00229 |
| 00230 |
| 00231 <font class="keyword">template</font><<font class="keyword">class </font>OutputIteratorType, |
| 00232 <font class="keyword">class </font>FilterPredicateType, |
| 00233 <font class="keyword">class </font>StringType, |
| 00234 <font class="keyword">class </font>StringConversionFunction> |
| 00235 <font class="keywordtype">void</font> |
| <a name="l00236"></a><a class="code" href="DirectoryEnumerator_8hpp.html#a2">00236</a> <a class="code" href="DirectoryEnumerator_8hpp.html#a3">EnumerateDirectory</a>( |
| 00237 MemoryManager& theMemoryManager, |
| 00238 <font class="keyword">const</font> StringType& theFullSearchSpec, |
| 00239 OutputIteratorType theOutputIterator, |
| 00240 FilterPredicateType theFilterPredicate, |
| 00241 StringConversionFunction theConversionFunction, |
| 00242 #<font class="keywordflow">if</font> defined(XALAN_TEMPLATE_FUNCTION_NO_DEFAULT_PARAMETERS) |
| 00243 <font class="keywordtype">bool</font> fIncludeSelfAndParent) |
| 00244 <font class="preprocessor">#else</font> |
| 00245 <font class="preprocessor"></font> <font class="keywordtype">bool</font> fIncludeSelfAndParent = <font class="keyword">false</font>) |
| 00246 <font class="preprocessor">#endif</font> |
| 00247 <font class="preprocessor"></font>{ |
| 00248 <font class="preprocessor">#if defined(_MSC_VER)</font> |
| 00249 <font class="preprocessor"></font> FindFileStruct theFindData; |
| 00250 |
| 00251 <font class="preprocessor"> #ifdef _WIN64</font> |
| 00252 <font class="preprocessor"></font> <font class="keyword">typedef</font> intptr_t theHandleType; |
| 00253 <font class="preprocessor"> #else</font> |
| 00254 <font class="preprocessor"></font> <font class="keyword">typedef</font> <font class="keywordtype">long</font> theHandleType; |
| 00255 <font class="preprocessor"> #endif</font> |
| 00256 <font class="preprocessor"></font> |
| 00257 <font class="preprocessor">#pragma warning(push)</font> |
| 00258 <font class="preprocessor"></font><font class="preprocessor">#pragma warning(disable: 4244)</font> |
| 00259 <font class="preprocessor"></font> theHandleType theSearchHandle = |
| 00260 _wfindfirst( |
| 00261 const_cast<wchar_t*>(theConversionFunction(theFullSearchSpec)), |
| 00262 &theFindData); |
| 00263 <font class="preprocessor">#pragma warning(pop)</font> |
| 00264 <font class="preprocessor"></font> |
| 00265 <font class="keywordflow">if</font> (theSearchHandle != -1) |
| 00266 { |
| 00267 |
| 00268 <font class="keywordflow">try</font> |
| 00269 { |
| 00270 <font class="keywordflow">do</font> |
| 00271 { |
| 00272 <font class="keywordflow">if</font> ((fIncludeSelfAndParent == <font class="keyword">true</font> || theFindData.isSelfOrParent() == <font class="keyword">false</font>) && |
| 00273 theFilterPredicate(theFindData) == <font class="keyword">true</font>) |
| 00274 { |
| 00275 *theOutputIterator = StringType(theFindData.getName(), theMemoryManager); |
| 00276 } |
| 00277 } |
| 00278 <font class="keywordflow">while</font>(_wfindnext(theSearchHandle, |
| 00279 &theFindData) == 0); |
| 00280 } |
| 00281 <font class="keywordflow">catch</font>(...) |
| 00282 { |
| 00283 _findclose(theSearchHandle); |
| 00284 |
| 00285 <font class="keywordflow">throw</font>; |
| 00286 } |
| 00287 |
| 00288 _findclose(theSearchHandle); |
| 00289 } |
| 00290 |
| 00291 |
| 00292 <font class="preprocessor">#else </font> |
| 00293 <font class="preprocessor"></font> |
| 00294 CharVectorType theTargetVector(theMemoryManager); |
| 00295 |
| 00296 <a class="code" href="XalanDOMString_8hpp.html#a19">TranscodeToLocalCodePage</a>(theFullSearchSpec, theTargetVector, <font class="keyword">false</font>); |
| 00297 |
| 00298 <font class="keyword">const</font> CharVectorType::size_type theSize = theTargetVector.size(); |
| 00299 <font class="keywordtype">int</font> indexSuffix=0, indexName=0; |
| 00300 <font class="keywordtype">bool</font> target_Dir = <font class="keyword">false</font>; |
| 00301 |
| 00302 <font class="keywordflow">if</font> (theSize > 0) |
| 00303 { |
| 00304 <font class="keywordflow">if</font> (theTargetVector.back() == <font class="charliteral">'*'</font>) |
| 00305 { |
| 00306 target_Dir = <font class="keyword">true</font>; |
| 00307 theTargetVector.pop_back(); |
| 00308 |
| 00309 <font class="keywordflow">if</font> (theSize == 1) |
| 00310 { |
| 00311 theTargetVector.push_back(<font class="charliteral">'.'</font>); |
| 00312 } |
| 00313 |
| 00314 } |
| 00315 <font class="keywordflow">else</font> |
| 00316 { |
| 00317 target_Dir = <font class="keyword">false</font>; |
| 00318 |
| 00319 <font class="keywordflow">while</font>(theTargetVector.back() != <font class="charliteral">'*'</font>) |
| 00320 { |
| 00321 theTargetVector.pop_back(); |
| 00322 indexSuffix++; |
| 00323 } |
| 00324 |
| 00325 theTargetVector.pop_back(); |
| 00326 <font class="keywordflow">while</font>(theTargetVector.back() != <font class="charliteral">'/'</font>) |
| 00327 { |
| 00328 theTargetVector.pop_back(); |
| 00329 indexName++; |
| 00330 } |
| 00331 } |
| 00332 |
| 00333 theTargetVector.push_back(<font class="charliteral">'\0'</font>); |
| 00334 |
| 00335 <font class="keyword">const</font> <font class="keywordtype">char</font>* <font class="keyword">const</font> theSpec = <a class="code" href="DOMStringHelper_8hpp.html#a6">c_str</a>(theTargetVector); |
| 00336 assert(theSpec != 0); |
| 00337 |
| 00338 <a class="code" href="classXalanDOMString.html">XalanDOMString</a> theName(theMemoryManager); |
| 00339 <a class="code" href="classXalanDOMString.html">XalanDOMString</a> theSuffix(theMemoryManager); |
| 00340 <font class="keywordflow">if</font> ( !target_Dir ) |
| 00341 { |
| 00342 <font class="preprocessor">#if defined(XALAN_STRICT_ANSI_HEADERS)</font> |
| 00343 <font class="preprocessor"></font> <font class="keyword">using</font> std::strlen; |
| 00344 <font class="preprocessor">#endif</font> |
| 00345 <font class="preprocessor"></font> |
| 00346 <font class="keywordtype">int</font> lenSpec = strlen(theSpec); |
| 00347 theFullSearchSpec.substr(theName, lenSpec, indexName); |
| 00348 theFullSearchSpec.substr(theSuffix, lenSpec+indexName+1, indexSuffix); |
| 00349 } |
| 00350 |
| 00351 DIR* <font class="keyword">const</font> theDirectory = opendir(theSpec); |
| 00352 |
| 00353 <font class="keywordflow">if</font> (theDirectory != 0) |
| 00354 { |
| 00355 chdir(theSpec); |
| 00356 <font class="keywordflow">try</font> |
| 00357 { |
| 00358 <font class="keyword">const</font> FindFileStruct* theEntry = |
| 00359 (FindFileStruct*)readdir(theDirectory); |
| 00360 |
| 00361 <font class="keywordflow">while</font>(theEntry != 0) |
| 00362 { |
| 00363 <font class="keywordflow">if</font> ((fIncludeSelfAndParent == <font class="keyword">true</font> || theEntry->isSelfOrParent() == <font class="keyword">false</font>)) |
| 00364 { |
| 00365 <font class="keywordflow">if</font> (theFilterPredicate(*theEntry) == <font class="keyword">true</font>) |
| 00366 { |
| 00367 <font class="keywordflow">if</font>( target_Dir ) |
| 00368 { |
| 00369 *theOutputIterator = StringType(theEntry->getName(), theMemoryManager); |
| 00370 } |
| 00371 <font class="keywordflow">else</font> |
| 00372 { |
| 00373 <a class="code" href="classXalanDOMString.html">XalanDOMString</a> Getname(theEntry->getName(), theMemoryManager); |
| 00374 <font class="keywordtype">int</font> Check_1 = Getname.<a class="code" href="classXalanDOMString.html#a64">compare</a>(theName); |
| 00375 <a class="code" href="classXalanDOMString.html">XalanDOMString</a> GetnameSuffix(theMemoryManager); |
| 00376 Getname.<a class="code" href="classXalanDOMString.html#a63">substr</a>(GetnameSuffix, Getname.<a class="code" href="classXalanDOMString.html#a19">size</a>() -indexSuffix, indexSuffix); |
| 00377 <font class="keywordtype">int</font> Check_2 = GetnameSuffix.<a class="code" href="classXalanDOMString.html#a64">compare</a>(theSuffix); |
| 00378 <font class="keywordflow">if</font> ( Check_1 == 1 && (!Check_2) ) |
| 00379 { |
| 00380 *theOutputIterator = StringType(theEntry->getName(), theMemoryManager); |
| 00381 } |
| 00382 } |
| 00383 } |
| 00384 } |
| 00385 theEntry = (FindFileStruct*)readdir(theDirectory); |
| 00386 } <font class="comment">//while</font> |
| 00387 }<font class="comment">//try</font> |
| 00388 |
| 00389 <font class="keywordflow">catch</font>(...) |
| 00390 { |
| 00391 closedir(theDirectory); |
| 00392 |
| 00393 <font class="keywordflow">throw</font>; |
| 00394 } |
| 00395 <font class="keywordflow">if</font>( target_Dir ) |
| 00396 chdir(<font class="stringliteral">".."</font>); |
| 00397 <font class="keywordflow">else</font> |
| 00398 chdir(<font class="stringliteral">"../.."</font>); |
| 00399 closedir(theDirectory); |
| 00400 } |
| 00401 } |
| 00402 |
| 00403 <font class="preprocessor">#endif</font> |
| 00404 <font class="preprocessor"></font>} |
| 00405 |
| 00406 |
| 00407 |
| 00408 <font class="keyword">template</font><<font class="keyword">class </font>OutputIteratorType, |
| 00409 <font class="keyword">class </font>FilterPredicateType, |
| 00410 <font class="keyword">class </font>StringType, |
| 00411 <font class="keyword">class </font>StringConversionFunction> |
| 00412 <font class="keywordtype">void</font> |
| <a name="l00413"></a><a class="code" href="DirectoryEnumerator_8hpp.html#a3">00413</a> <a class="code" href="DirectoryEnumerator_8hpp.html#a3">EnumerateDirectory</a>( |
| 00414 MemoryManager& theMemoryManager, |
| 00415 <font class="keyword">const</font> StringType& theDirectory, |
| 00416 <font class="keyword">const</font> StringType& theSearchSpec, |
| 00417 OutputIteratorType theOutputIterator, |
| 00418 FilterPredicateType theFilterPredicate, |
| 00419 StringConversionFunction theConversionFunction, |
| 00420 #<font class="keywordflow">if</font> defined(XALAN_TEMPLATE_FUNCTION_NO_DEFAULT_PARAMETERS) |
| 00421 <font class="keywordtype">bool</font> fIncludeSelfAndParent) |
| 00422 <font class="preprocessor">#else</font> |
| 00423 <font class="preprocessor"></font> <font class="keywordtype">bool</font> fIncludeSelfAndParent = <font class="keyword">false</font>) |
| 00424 <font class="preprocessor">#endif</font> |
| 00425 <font class="preprocessor"></font>{ |
| 00426 StringType theFullSearchSpec(theDirectory, theMemoryManager); |
| 00427 |
| 00428 theFullSearchSpec += theSearchSpec; |
| 00429 |
| 00430 <a class="code" href="DirectoryEnumerator_8hpp.html#a3">EnumerateDirectory</a>( |
| 00431 theMemoryManager, |
| 00432 theFullSearchSpec, |
| 00433 theOutputIterator, |
| 00434 theFilterPredicate, |
| 00435 theConversionFunction, |
| 00436 fIncludeSelfAndParent); |
| 00437 } |
| 00438 |
| 00439 |
| 00440 |
| 00441 <font class="preprocessor">#if defined(XALAN_NO_DEFAULT_TEMPLATE_ARGUMENTS)</font> |
| 00442 <font class="preprocessor"></font>template<class CollectionType, class StringType> |
| 00443 <font class="keyword">struct </font><a class="code" href="structDirectoryEnumeratorFunctor.html">DirectoryEnumeratorFunctor</a> |
| 00444 { |
| 00445 <a class="code" href="classXalanSet.html">CollectionType</a> |
| 00446 <a class="code" href="structDirectoryFilterPredicate.html#a0">operator()</a>(<font class="keyword">const</font> StringType& theDirectory)<font class="keyword"> const</font> |
| 00447 <font class="keyword"> </font>{ |
| 00448 <a class="code" href="classXalanSet.html">CollectionType</a> theCollection; |
| 00449 |
| 00450 <a class="code" href="structDirectoryFilterPredicate.html#a0">operator()</a>(theDirectory, |
| 00451 theCollection); |
| 00452 |
| 00453 <font class="keywordflow">return</font> theCollection; |
| 00454 } |
| 00455 |
| 00456 <font class="keywordtype">void</font> |
| 00457 <a class="code" href="structDirectoryFilterPredicate.html#a0">operator()</a>( |
| 00458 <font class="keyword">const</font> StringType&, |
| 00459 <font class="keyword">const</font> <a class="code" href="classXalanSet.html">CollectionType</a>&)<font class="keyword"> const</font> |
| 00460 <font class="keyword"> </font>{ |
| 00461 } |
| 00462 }; |
| 00463 <font class="preprocessor">#else</font> |
| 00464 <font class="preprocessor"></font><font class="keyword">template</font><<font class="keyword">class </font><a class="code" href="classXalanSet.html">CollectionType</a>, |
| 00465 <font class="keyword">class </font>StringType = <a class="code" href="classXalanDOMString.html">XalanDOMString</a>, |
| 00466 <font class="keyword">class </font>FilterPredicateType = <a class="code" href="structFilesOnlyFilterPredicate.html">FilesOnlyFilterPredicate</a>, |
| 00467 <font class="keyword">class </font>StringConversionFunction = <a class="code" href="structc__wstr__functor.html">c_wstr_functor</a>> |
| 00468 <font class="preprocessor">#if defined(XALAN_NO_STD_NAMESPACE)</font> |
| 00469 <font class="preprocessor"></font><font class="keyword">struct </font><a class="code" href="structDirectoryEnumeratorFunctor.html">DirectoryEnumeratorFunctor</a> : <font class="keyword">public</font> unary_function<StringType, CollectionType> |
| 00470 #else |
| <a name="l00471"></a><a class="code" href="structDirectoryEnumeratorFunctor.html">00471</a> struct <a class="code" href="structDirectoryEnumeratorFunctor.html">DirectoryEnumeratorFunctor</a> : <font class="keyword">public</font> std::unary_function<StringType, CollectionType> |
| 00472 #endif |
| 00473 { |
| 00474 <font class="preprocessor">#if defined(XALAN_NO_STD_NAMESPACE)</font> |
| 00475 <font class="preprocessor"></font> <font class="keyword">typedef</font> unary_function<StringType, CollectionType> <a class="code" href="classstd_1_1unary__function.html">BaseClassType</a>; |
| 00476 <font class="preprocessor">#else</font> |
| <a name="l00477"></a><a class="code" href="structDirectoryEnumeratorFunctor.html#s0">00477</a> <font class="preprocessor"></font> <font class="keyword">typedef</font> <a class="code" href="classstd_1_1unary__function.html">std::unary_function<StringType, CollectionType></a> <a class="code" href="classstd_1_1unary__function.html">BaseClassType</a>; |
| 00478 <font class="preprocessor">#endif</font> |
| 00479 <font class="preprocessor"></font> |
| <a name="l00480"></a><a class="code" href="structDirectoryEnumeratorFunctor.html#s1">00480</a> <font class="keyword">typedef</font> <font class="keyword">typename</font> BaseClassType::result_type result_type; |
| <a name="l00481"></a><a class="code" href="structDirectoryEnumeratorFunctor.html#s2">00481</a> <font class="keyword">typedef</font> <font class="keyword">typename</font> BaseClassType::argument_type argument_type; |
| 00482 |
| 00483 <font class="keyword">explicit</font> |
| <a name="l00484"></a><a class="code" href="structDirectoryEnumeratorFunctor.html#a0">00484</a> <a class="code" href="structDirectoryEnumeratorFunctor.html#a0">DirectoryEnumeratorFunctor</a>( |
| 00485 MemoryManager& theMemoryManager, |
| 00486 <font class="keywordtype">bool</font> fIncludeSelfAndParent = <font class="keyword">false</font>) : |
| 00487 m_includeSelfAndParent(fIncludeSelfAndParent), |
| 00488 m_memoryManager(theMemoryManager) |
| 00489 { |
| 00490 } |
| 00491 |
| 00492 <font class="keywordtype">void</font> |
| <a name="l00493"></a><a class="code" href="structDirectoryEnumeratorFunctor.html#a1">00493</a> <a class="code" href="structDirectoryEnumeratorFunctor.html#a1">operator()</a>( |
| 00494 <font class="keyword">const</font> argument_type& theFullSearchSpec, |
| 00495 <a class="code" href="classXalanSet.html">CollectionType</a>& theCollection)<font class="keyword"> const</font> |
| 00496 <font class="keyword"> </font>{ |
| 00497 XALAN_USING_STD(back_inserter) |
| 00498 |
| 00499 <a class="code" href="DirectoryEnumerator_8hpp.html#a3">EnumerateDirectory</a>( |
| 00500 m_memoryManager, |
| 00501 theFullSearchSpec, |
| 00502 XALAN_STD_QUALIFIER back_inserter(theCollection), |
| 00503 m_filterPredicate, |
| 00504 m_conversionFunction, |
| 00505 m_includeSelfAndParent); |
| 00506 } |
| 00507 |
| 00508 result_type |
| <a name="l00509"></a><a class="code" href="structDirectoryEnumeratorFunctor.html#a2">00509</a> <a class="code" href="structDirectoryEnumeratorFunctor.html#a1">operator()</a>(<font class="keyword">const</font> argument_type& theFullSearchSpec)<font class="keyword"> const</font> |
| 00510 <font class="keyword"> </font>{ |
| 00511 result_type theCollection; |
| 00512 |
| 00513 <a class="code" href="structDirectoryEnumeratorFunctor.html#a1">operator()</a>( |
| 00514 theFullSearchSpec, |
| 00515 theCollection); |
| 00516 |
| 00517 <font class="keywordflow">return</font> theCollection; |
| 00518 } |
| 00519 |
| 00520 <font class="keywordtype">void</font> |
| <a name="l00521"></a><a class="code" href="structDirectoryEnumeratorFunctor.html#a3">00521</a> <a class="code" href="structDirectoryEnumeratorFunctor.html#a1">operator()</a>( |
| 00522 <font class="keyword">const</font> argument_type& theDirectory, |
| 00523 <font class="keyword">const</font> argument_type& theSearchSpec, |
| 00524 <a class="code" href="classXalanSet.html">CollectionType</a>& theCollection)<font class="keyword"> const</font> |
| 00525 <font class="keyword"> </font>{ |
| 00526 <a class="code" href="DirectoryEnumerator_8hpp.html#a3">EnumerateDirectory</a>( |
| 00527 m_memoryManager, |
| 00528 theDirectory, |
| 00529 theSearchSpec, |
| 00530 XALAN_STD_QUALIFIER back_inserter(theCollection), |
| 00531 m_filterPredicate, |
| 00532 m_conversionFunction, |
| 00533 m_includeSelfAndParent); |
| 00534 } |
| 00535 |
| 00536 result_type |
| <a name="l00537"></a><a class="code" href="structDirectoryEnumeratorFunctor.html#a4">00537</a> <a class="code" href="structDirectoryEnumeratorFunctor.html#a1">operator()</a>( |
| 00538 <font class="keyword">const</font> argument_type& theDirectory, |
| 00539 <font class="keyword">const</font> argument_type& theSearchSpec)<font class="keyword"> const</font> |
| 00540 <font class="keyword"> </font>{ |
| 00541 result_type theCollection; |
| 00542 |
| 00543 <a class="code" href="structDirectoryEnumeratorFunctor.html#a1">operator()</a>( |
| 00544 theDirectory, |
| 00545 theSearchSpec, |
| 00546 theCollection); |
| 00547 |
| 00548 <font class="keywordflow">return</font> theCollection; |
| 00549 } |
| 00550 |
| 00551 <font class="keyword">private</font>: |
| 00552 |
| 00553 FilterPredicateType m_filterPredicate; |
| 00554 |
| 00555 StringConversionFunction m_conversionFunction; |
| 00556 |
| 00557 <font class="keyword">const</font> <font class="keywordtype">bool</font> m_includeSelfAndParent; |
| 00558 |
| 00559 MemoryManager& m_memoryManager; |
| 00560 }; |
| 00561 <font class="preprocessor">#endif</font> |
| 00562 <font class="preprocessor"></font> |
| 00563 |
| 00564 |
| 00565 XALAN_CPP_NAMESPACE_END |
| 00566 |
| 00567 |
| 00568 |
| 00569 <font class="preprocessor">#endif // DIRECTORY_ENUMERATOR_HEADER_GUARD_1357924680</font> |
| </font></pre></div><p align="center"><a href="diagramnotes.html">Interpreting class diagrams</a></p>
|
| <p><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
|
| <i><A href="http://www.stack.nl/~dimitri/doxygen/">Doxygen</A> and
|
| <A href="http://www.research.att.com/sw/tools/graphviz/">GraphViz</A> are used to generate this API documentation from the Xalan-C header files.</I></FONT></p>
|
|
|
| <TABLE border="0" cellpadding="0" cellspacing="0" width="820"><TR><TD bgcolor="#0086b2"><IMG height="1" src="../resources/dot.gif" width="1" alt="dot"></TD></TR></TABLE>
|
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="80%">
|
| <TR>
|
| <TD WIDTH="80%" VALIGN="TOP">
|
| <P ALIGN="CENTER"><B>Xalan-C++ XSLT Processor Version 1.10</B><BR>
|
| Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.</i></p>
|
| </TD>
|
| </TR>
|
| <TR>
|
| <TD WIDTH="100%">
|
| <P ALIGN="CENTER"><IMG SRC="ApacheLogo.jpg" WIDTH="387" HEIGHT="100" ALIGN="BOTTOM" BORDER="0" ALT="Apache Logo">
|
| </TD>
|
| </TR>
|
| </TABLE>
|