Markopy
Utilizing Markov Models for brute forcing attacks
threadSharedListHandler.cpp
Go to the documentation of this file.
1 /** @file threadSharedListHandler.cpp
2  * @brief Thread-safe wrapper for std::ifstream
3  * @authors Ata Hakçıl
4  *
5  * @copydoc Markov::API::Concurrency::ThreadSharedListHandler
6  *
7  */
8 
10 
11 
13  this->listfile;
14  this->listfile.open(filename, std::ios_base::binary);
15 }
16 
17 
18 bool Markov::API::Concurrency::ThreadSharedListHandler::next(std::string* line){
19  bool res = false;
20  this->mlock.lock();
21  res = (std::getline(this->listfile,*line,'\n'))? true : false;
22  this->mlock.unlock();
23 
24  return res;
25 }