Skip to content

Commit 08643f5

Browse files
Bruno De BelBruno De Bel
Bruno De Bel
authored and
Bruno De Bel
committed
Skip filename check: only file existence
1 parent bc1b06d commit 08643f5

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

project/verifyFile.cpp

+9-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "errorhandler.h"
44

55

6-
verifyFile::verifyFile(datafactory *dfverifiers,errorHandler *hError,std::string &pathdirectory,std::string TYPE)
6+
verifyFile::verifyFile(datafactory *dfverifiers,errorHandler *hError,std::string &pathdirectory,std::string TYPE,bool skipNamingTest)
77
{
88
File_Group *fg = dfverifiers->get<File_Group>(TYPE.c_str());
99
if ( fg != NULL ) {
@@ -16,12 +16,14 @@ verifyFile::verifyFile(datafactory *dfverifiers,errorHandler *hError,std::string
1616
// 1. get GROUPID
1717
// 2. find image with same GROUPID
1818
// 3. get the SEQ value from that image
19-
if (atoi(fname.substr(fname.length() - 9, 5).c_str()) != tf.seq)
20-
{
21-
char tmp[20];
22-
sprintf_s(tmp, "%05d", tf.seq);
23-
hError->getError(cat_sequenceIncorrect,"METS","FILESEC",tf.ref +" should end in " + std::string(tmp)/*+" "+fname*/,fname,tf.ref);
24-
//std::cout<<"DEBUG"<<fname.substr(fname.length() - 9, 5)<<std::endl;
19+
if (skipNamingTest){
20+
if (atoi(fname.substr(fname.length() - 9, 5).c_str()) != tf.seq)
21+
{
22+
char tmp[20];
23+
sprintf_s(tmp, "%05d", tf.seq);
24+
hError->getError(cat_sequenceIncorrect,"METS","FILESEC",tf.ref +" should end in " + std::string(tmp)/*+" "+fname*/,fname,tf.ref);
25+
//std::cout<<"DEBUG"<<fname.substr(fname.length() - 9, 5)<<std::endl;
26+
}
2527
}
2628
FILE *fp ;
2729
fopen_s(&fp,fname.c_str(), "r");

project/verifyFile.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//!verify if the PDF files exist and have the right sequence
1010
class verifyFile{
1111
public:
12-
verifyFile(datafactory *df,errorHandler *h,std::string &pathdirectory,std::string TYPE);
12+
verifyFile(datafactory *df,errorHandler *h,std::string &pathdirectory,std::string TYPE,bool skipNamingTest=true);
1313
};
1414

1515

0 commit comments

Comments
 (0)