44 std::string
const& placeholderDirectory,
45 std::string
const& outputDirectory )
55 std::vector< std::string > validBaseFilenames;
56 DIR* directoryPointer( opendir( inputDirectory.c_str() ) );
57 if( NULL == directoryPointer )
59 throw std::runtime_error(
"Could not read directory!" );
61 std::string currentFile;
62 struct dirent* structPointer( readdir( directoryPointer ) );
63 while( NULL != structPointer )
65 currentFile.assign( structPointer->d_name );
66 structPointer = readdir( directoryPointer );
67 if( ( 0 == currentFile.compare(
"." ) )
69 ( 0 == currentFile.compare(
".." ) )
79 validBaseFilenames.push_back( currentFile.substr( 0,
91 std::vector< std::string >
const& baseFilenames,
92 std::string
const inputDirectory,
93 std::string placeholderDirectory,
94 std::string outputDirectory )
105 if( placeholderDirectory.empty() )
107 placeholderDirectory.assign( inputDirectory );
113 if( outputDirectory.empty() )
115 outputDirectory.assign( inputDirectory );
121 for( std::vector< std::string >::const_iterator
122 whichBaseFilename( baseFilenames.begin() );
123 baseFilenames.end() > whichBaseFilename;
124 ++whichBaseFilename )