@@ -111,7 +111,7 @@ void docCache::add( const string& dir, const string& f ){
111111}
112112
113113void docCache::fill ( const string& alto_cache, const list<xmlNode*>& blocks ){
114- for ( const auto & it : blocks ){
114+ for ( const auto * it : blocks ){
115115 string alt = TiCC::getAttribute ( it, " alto" );
116116 if ( !alt.empty () ){
117117 add ( alto_cache, alt );
@@ -267,14 +267,14 @@ void addStr( folia::Paragraph *par, UnicodeString& txt,
267267}
268268
269269void createFile ( folia::FoliaElement *text,
270- xmlDoc *alt_doc,
270+ const xmlDoc *alt_doc,
271271 const string& altoFile,
272272 const list<xmlNode*>& textblocks,
273273 bool do_strings ){
274- xmlNode *root = xmlDocGetRootElement ( alt_doc );
275- xmlNode *keepPart1 = 0 ;
274+ const xmlNode *root = xmlDocGetRootElement ( alt_doc );
275+ const xmlNode *keepPart1 = 0 ;
276276 set<string> ids;
277- for ( const auto & block : textblocks ){
277+ for ( const auto * block : textblocks ){
278278 string id = TiCC::getAttribute ( block, " ID" );
279279 if ( ids.find (id) != ids.end () ){
280280 if ( verbose ){
@@ -415,7 +415,7 @@ void processBlocks( folia::FoliaElement *text,
415415 bool do_strings ){
416416 for ( const auto & it : blocks ){
417417 string alt = TiCC::getAttribute ( it, " alto" );
418- xmlDoc *alt_doc = cache.find ( alt );
418+ const xmlDoc *alt_doc = cache.find ( alt );
419419 if ( alt_doc ){
420420 list<xmlNode*> texts = TiCC::FindNodes ( it, " dcx:TextBlock" );
421421 createFile ( text, alt_doc, alt, texts, do_strings );
@@ -464,7 +464,7 @@ void processArticle( const string& f,
464464 }
465465 outName += docid + " .folia.xml" ;
466466 folia::Document doc ( " xml:id='" + docid + " '" );
467- folia::processor *proc = add_provenance ( doc, " FoLiA-alto" , command );
467+ const folia::processor *proc = add_provenance ( doc, " FoLiA-alto" , command );
468468 processor_id = proc->id ();
469469 folia::KWargs args;
470470 args[" processor" ] = processor_id;
@@ -572,7 +572,7 @@ bool download( const string& alto_cache,
572572 }
573573 }
574574 unordered_map<string,string> ref_file_map;
575- for ( const auto & res : resources ){
575+ for ( const auto * res : resources ){
576576 string ref = TiCC::getAttribute ( res, " ref" );
577577 if ( ref.find ( " :alto" ) != string::npos ){
578578 string id;
@@ -832,7 +832,7 @@ void solveArtAlto( const string& alto_cache,
832832 }
833833 else {
834834 unordered_set<string> article_names;
835- for ( const auto & it : items ){
835+ for ( const auto * it : items ){
836836 string art_id = TiCC::getAttribute ( it, " article_id" );
837837 if ( art_id.empty () ){
838838#pragma omp critical
@@ -964,7 +964,7 @@ void solveBook( const string& altoFile,
964964 docid = prefix + docid;
965965 string outName = outDir + docid + " .folia.xml" ;
966966 folia::Document doc ( " xml:id='" + docid + " '" );
967- folia::processor *proc = add_provenance ( doc, " FoLiA-alto" , command );
967+ const folia::processor *proc = add_provenance ( doc, " FoLiA-alto" , command );
968968 processor_id = proc->id ();
969969 folia::KWargs proc_args;
970970 proc_args[" processor" ] = processor_id;
@@ -987,9 +987,9 @@ void solveBook( const string& altoFile,
987987 xmlFreeDoc ( xmldoc );
988988 return ;
989989 }
990- xmlNode *keepPart1 = 0 ;
990+ const xmlNode *keepPart1 = 0 ;
991991 set<string> ids;
992- for ( auto const & block : textblocks ){
992+ for ( auto const * block : textblocks ){
993993 string id = TiCC::getAttribute ( block, " ID" );
994994 if ( ids.find (id) != ids.end () ){
995995 if ( verbose ){
@@ -1184,7 +1184,7 @@ void solveBookAlto( const string& alto_cache,
11841184 else {
11851185 cout << " Downloaded files " << endl;
11861186 list<xmlNode*> meta = TiCC::FindNodes ( didl, " //didl:Item/didl:Component" );
1187- for ( const auto & m : meta ){
1187+ for ( const auto * m : meta ){
11881188 string id = TiCC::getAttribute ( m, " identifier" );
11891189 if ( !id.empty () ){
11901190 const auto it = downloaded_files.find ( id );
@@ -1256,7 +1256,7 @@ void solveDirectAlto( const string& full_file,
12561256 string outName = outDir + docid + " .folia.xml" ;
12571257 list<xmlNode*> texts = TiCC::FindNodes ( xmldoc, " //*:TextBlock" );
12581258 folia::Document doc ( " xml:id='" + docid + " '" );
1259- folia::processor *proc = add_provenance ( doc, " FoLiA-alto" , command );
1259+ const folia::processor *proc = add_provenance ( doc, " FoLiA-alto" , command );
12601260 processor_id = proc->id ();
12611261 folia::KWargs args;
12621262 args[" processor" ] = processor_id;
@@ -1322,7 +1322,7 @@ void usage(){
13221322 cerr << " \t -V or --version\t show version " << endl;
13231323}
13241324
1325- int main ( int argc, char *argv[] ){
1325+ int main ( int argc, const char *argv[] ){
13261326 TiCC::CL_Options opts;
13271327 try {
13281328 opts.add_short_options ( " vVt:O:h" );
0 commit comments