{
std::string tmpString;
int i,ii,sizeFilenames = Filenames.size();
+ int j,sizeFileEnd = bbGetInputFileEnd().size();
+ int okEraseElement;
+
+//Selecting just the files in the FileEnd List
+ if (bbGetInputFileEnd().size()!=0)
+ {
+ for (i=sizeFilenames-1; i>=0; i--)
+ {
+ okEraseElement=0;
+ for (j=0; j<sizeFileEnd; j++)
+ {
+ std::string tmp=Filenames[i].substr( (Filenames[i].length()) - (bbGetInputFileEnd()[j]).length() ) ;
+ if (bbGetInputFileEnd()[j].compare( tmp )==0 )
+ {
+ okEraseElement++;
+ } // if FileEnd
+ } // for j
+
+ if (okEraseElement==0)
+ {
+ Filenames.erase( Filenames.begin()+i );
+ }
+ } // for i
+ } // if FileEnd !=0
+
+ sizeFilenames = Filenames.size();
// Cleanning paths with spaces
for (i=0; i<sizeFilenames; i++)
{
tmpString=Filenames[i];
+
std::string::size_type spacePosition = tmpString.find_first_of(' ');
if (spacePosition != std::string::npos)
{
} // if spacePosition
}
+
// Alphabetical order
for (i=0; i<sizeFilenames; i++)
{
unsigned int lenghtBasePath = basePath.length();
for (i=0; i<sizeFilenames; i++)
{
-
SimpleFilenames.push_back( Filenames[i].substr( lenghtBasePath ) );
} // for i
BBTK_DECLARE_INPUT(In,std::string);
BBTK_DECLARE_INPUT(Recursive,bool);
BBTK_DECLARE_INPUT(Type,int);
+ BBTK_DECLARE_INPUT(FileEnd,std::vector<std::string>);
BBTK_DECLARE_OUTPUT(Out,std::vector<std::string>);
BBTK_DECLARE_OUTPUT(OutSimple,std::vector<std::string>);
BBTK_PROCESS(Process);
BBTK_INPUT(FilesFromDirectory,In,"Directory Name",std::string,"");
BBTK_INPUT(FilesFromDirectory,Recursive,"Recursive directory exploration",bool,"");
BBTK_INPUT(FilesFromDirectory,Type,"0=files 1=All_directories 2=last_directories (0 default)",int,"");
+ BBTK_INPUT(FilesFromDirectory,FileEnd,"Select just the files with this end file name",std::vector<std::string>,"");
BBTK_OUTPUT(FilesFromDirectory,Out,"FullPathNames of the files",std::vector<std::string>,"");
BBTK_OUTPUT(FilesFromDirectory,OutSimple,"Simple Full PathNames of the files",std::vector<std::string>,"");