24 lines
350 B
C++
24 lines
350 B
C++
|
|
#include "distrib.h"
|
|
#include <fstream>
|
|
#include <string>
|
|
using namespace std;
|
|
|
|
int distrib::readHostFile(const char * filename)
|
|
{
|
|
ifstream ifs(filename);
|
|
|
|
if ( ! ifs.is_open() )
|
|
return 1;
|
|
|
|
string host;
|
|
while ( ! ifs.eof() )
|
|
{
|
|
ifs >> host;
|
|
m_hosts.push_back(host);
|
|
}
|
|
|
|
ifs.close();
|
|
return 0;
|
|
}
|