source: liacs/da/opdr2a/leestekst.cc@ 29

Last change on this file since 29 was 2, checked in by Rick van der Zwet, 15 years ago

Initial import of data of old repository ('data') worth keeping (e.g. tracking
means of URL access statistics)

File size: 2.3 KB
Line 
1#include "leestekst.h"
2bool sf32(ifstream&sv18,char*sv82,int sv83){int sv66;char sv16;sv66=0;
3sv16=sv18.get();while((!sv18.eof())&&(sv66<sv83-1)&&(sv16!=sc1))
4{sv82[sv66]=sv16;sv66++;sv16=sv18.get();}sv82[sv66]=sc2;
5if((sv66>0)||(!sv18.eof()))return true;else return false;}
6bool sf33(char*sv86,int sv87,char*sv82,int&sv89){int sv90,sv88;bool sv85,sv84;
7sv90=strlen(sv82);sv85=false;while(!sv85&&(sv89<=sv90-sv87)){sv84=true;sv88=0;
8while(sv84&&(sv88<sv87)){if(sv86[sv88]==sv82[sv89+sv88])sv88++;else sv84=false;}
9if(sv84)sv85=true;else sv89++;}return sv85;}
10int sf34(ifstream&sv18,char*sv86,int sv87,char*sv82,int sv83,int&sv92,int&sv89)
11{bool sv85,sv42;sv85=sf33(sv86,sv87,sv82,sv89);
12while(!sv85&&(sv42=sf32(sv18,sv82,sv83))){sv92++;sv89=0;
13sv85=sf33(sv86,sv87,sv82,sv89);}return sv85;}bool sf35(char*sv93){ifstream sv18;
14bool sv94;char sv16;sv18.open(sv93);if(sv18){sv16=sv18.get();if(!sv18.eof())
15sv94=true;else sv94=false;sv18.close();}else sv94=false;return sv94;}
16bool sf36(char*sv95,char*sv96){ifstream sv18;ofstream sv76;char sv16;
17sv18.open(sv96);if(sv18){sv76.open(sv95);sv16=sv18.get();while(!sv18.eof())
18{sv76.put(sv16);sv16=sv18.get();}sv76.close();sv18.close();return true;}else
19return false;}void sf37(char*sv93){ofstream sv76;sv76.open(sv93);sv76.close();}
20void sf2(ifstream&sv18){char sv16=' ';while((!sv18.eof())&&(sv16!=sc1))
21sv16=sv18.get();}void sf3(ifstream&sv18,char*sv19){int sv20,i;char sv17;
22sv20=strlen(sv19);for(i=0;i<sv20;i++)
23if((sv19[i]!=' ')&&(sv19[i]!='\t')&&(sv19[i]!='\r')&&(sv19[i]!='\n'))sv18>>sv17;
24}bool sf4(char*sv21,char*sv22){bool sv23;int sv24nr,sv25,sv26;
25ifstream sv27,sv28;sv27.open(sv21,ios::in);sv28.open(sv22,ios::in);if(!sv27)
26{cout<<"We konden "<<sv21<<" bij de controle niet openen\n";cout<<sc1;
27sv23=false;}else if(!sv28)
28{cout<<"We konden "<<sv22<<" bij de controle niet openen\n";cout<<sc1;
29sv23=false;}else{sv23=true;sv24nr=1;sv27>>sv25;sv28>>sv26;sf2(sv27);sf2(sv28);
30while((!sv27.eof())&&(!sv28.eof())&&sv23){if(sv25!=sv26)sv23=false;else
31{sv24nr++;sv27>>sv25;sv28>>sv26;sf2(sv27);sf2(sv28);}}if(!sv23)
32cout<<"Verschil in regel "<<sv24nr<<sc1;else if(!sv27.eof())
33{cout<<"Het uitvoerbestand is langer dan het controlebestand\n";sv23=false;}else
34if(!sv28.eof()){cout<<"Het controlebestand is langer dan het uitvoerbestand\n";
35sv23=false;}}if(sv27)sv27.close();if(sv28)sv28.close();return sv23;}
Note: See TracBrowser for help on using the repository browser.