232 MemoryManager& theMemoryManager,
233 const StringType& theFullSearchSpec,
234 OutputIteratorType theOutputIterator,
235 FilterPredicateType theFilterPredicate,
236 StringConversionFunction theConversionFunction,
237#
if defined(XALAN_TEMPLATE_FUNCTION_NO_DEFAULT_PARAMETERS)
238 bool fIncludeSelfAndParent)
240 bool fIncludeSelfAndParent =
false)
247 typedef intptr_t theHandleType;
249 typedef long theHandleType;
253#pragma warning(disable: 4244)
254 theHandleType theSearchHandle =
256 reinterpret_cast<wchar_t*
>(
const_cast<XalanDOMChar*
>(theConversionFunction(theFullSearchSpec))),
260 if (theSearchHandle != -1)
267 if ((fIncludeSelfAndParent ==
true || theFindData.isSelfOrParent() ==
false) &&
268 theFilterPredicate(theFindData) ==
true)
270 *theOutputIterator = StringType(theFindData.getName(), theMemoryManager);
273 while(_wfindnext(theSearchHandle,
278 _findclose(theSearchHandle);
283 _findclose(theSearchHandle);
294 int indexSuffix=0, indexName=0;
295 bool target_Dir =
false;
299 if (theTargetVector.
back() ==
'*')
314 while(theTargetVector.
back() !=
'*')
321 while(theTargetVector.
back() !=
'/')
330 const char*
const theSpec =
c_str(theTargetVector);
331 assert(theSpec != 0);
339 int lenSpec = strlen(theSpec);
340 theFullSearchSpec.substr(theName, lenSpec, indexName);
341 theFullSearchSpec.substr(theSuffix, lenSpec+indexName+1, indexSuffix);
344 DIR*
const theDirectory = opendir(theSpec);
346 if (theDirectory != 0)
356 if ((fIncludeSelfAndParent ==
true || theEntry->isSelfOrParent() ==
false))
358 if (theFilterPredicate(*theEntry) ==
true)
362 *theOutputIterator = StringType(theEntry->getName(), theMemoryManager);
367 int Check_1 = Getname.
compare(theName);
369 Getname.
substr(GetnameSuffix, Getname.
size() -indexSuffix, indexSuffix);
370 int Check_2 = GetnameSuffix.
compare(theSuffix);
371 if ( Check_1 == 1 && (!Check_2) )
373 *theOutputIterator = StringType(theEntry->getName(), theMemoryManager);
384 closedir(theDirectory);
392 closedir(theDirectory);
407 MemoryManager& theMemoryManager,
408 const StringType& theDirectory,
409 const StringType& theSearchSpec,
410 OutputIteratorType theOutputIterator,
411 FilterPredicateType theFilterPredicate,
412 StringConversionFunction theConversionFunction,
413#
if defined(XALAN_TEMPLATE_FUNCTION_NO_DEFAULT_PARAMETERS)
414 bool fIncludeSelfAndParent)
416 bool fIncludeSelfAndParent =
false)
419 StringType theFullSearchSpec(theDirectory, theMemoryManager);
421 theFullSearchSpec += theSearchSpec;
428 theConversionFunction,
429 fIncludeSelfAndParent);
TranscodeToLocalCodePage(const XalanDOMChar *theSourceString, XalanDOMString::size_type theSourceStringLength, CharVectorType &targetVector, bool terminate=false)
Convert a XalanDOMChar string to C++ standard library vector, transcoding to the default local code p...
void EnumerateDirectory(MemoryManager &theMemoryManager, const StringType &theFullSearchSpec, OutputIteratorType theOutputIterator, FilterPredicateType theFilterPredicate, StringConversionFunction theConversionFunction, bool fIncludeSelfAndParent=false)