Évan Laverdure
/
APP4
routeur done
Fork of APP4 by
Diff: readfile.cpp
- Revision:
- 3:350f07072089
- Parent:
- 2:7515831bb5f5
- Child:
- 4:aac38b016952
diff -r 7515831bb5f5 -r 350f07072089 readfile.cpp --- a/readfile.cpp Mon Feb 24 14:08:10 2014 +0000 +++ b/readfile.cpp Mon Feb 24 15:40:33 2014 +0000 @@ -3,7 +3,30 @@ ReadFile::ReadFile() {} -void ReadFile::setConfigCoord(Coordinateur *coord, const string filename) +bool ReadFile::setConfigCoord(Coordinateur *coord, const string filename) +{ + string line; + ifstream myfile(filename.c_str()); + if (myfile.is_open()) + { + while (getline(myfile,line)) + { + if (line[0] != "#") + { + if (line.find("PANID") != string::npos) + ://coord->setPanID(line.substr( + } + } + + myfile.close(); + + return true; + } + + return false; +} + +bool ReadFile::setConfigRouteur(Routeur *rout, const string filename) { string line; ifstream myfile(filename.c_str()); @@ -14,19 +37,9 @@ } myfile.close(); - } -} - -void ReadFile::setConfigRouteur(Routeur *rout, const string filename) -{ - string line; - ifstream myfile(filename.c_str()); - if (myfile.is_open()) - { - while (getline(myfile,line)) - { - } - myfile.close(); + return true; } + + return false; } \ No newline at end of file