Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ifstream ifs;
- ifs.open("image_server.conf");
- if(!ifs){
- cerr << "failed to open config file";
- exit(1);
- }
- string line, info;
- while(ifs.eof() == false){
- getline(ifs,line);
- info = line.substr(line.find("="+1));
- if(line.substr(0,line.find("=")) == "LISTEN_PORT")
- LISTEN_PORT = atoi(info.c_str());
- else if(line.substr(0,line.find("=")) == "IMAGE_SAVE_DIR")
- IMAGE_SAVE_DIR = info;
- else if(line.substr(0,line.find("=")) == "LOG_FILE")
- LOG_FILE = info;
- }
- ifs.close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement