Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "tiedostonluku.hh"
- #include <fstream>
- #include <string>
- #include <vector>
- using namespace std;
- bool lue_tehtavatiedosto(ifstream& virta){
- regex reg(
- "[[:space:]]*"
- "([[:alpha:]_]+)"
- "[[:space:]]*"
- ":"
- "[[:space:]]*"
- "([[:alpha:]_]+)"
- "[[:space:]]*"
- );
- smatch tulos;
- string rivi;
- if (not getline(virta, rivi)){
- return true;
- }
- else{
- if ( regex_match(rivi, tulos, reg) ){
- return true;
- }
- else {
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement