static*/
| 53 | |
| 54 | |
| 55 | /*static*/ std::vector<std::string> stress_fixture::load_dictionary() |
| 56 | { |
| 57 | std::vector<std::string> arrString; |
| 58 | |
| 59 | std::ifstream s; |
| 60 | char const* filename = "./dictionary.txt"; |
| 61 | s.open( filename ); |
| 62 | if ( !s.is_open()) { |
| 63 | std::cerr << "WARNING: Cannot open test file " << filename << std::endl; |
| 64 | return arrString; |
| 65 | } |
| 66 | |
| 67 | std::string line; |
| 68 | std::getline( s, line ); |
| 69 | |
| 70 | arrString.reserve( std::stoul( line )); |
| 71 | |
| 72 | while ( !s.eof()) { |
| 73 | std::getline( s, line ); |
| 74 | if ( !line.empty()) |
| 75 | arrString.push_back( std::move( line )); |
| 76 | } |
| 77 | |
| 78 | s.close(); |
| 79 | |
| 80 | return arrString; |
| 81 | } |
| 82 | } // namespace |