13 |
#include <stdlib.h> |
#include <stdlib.h> |
14 |
|
|
15 |
#include <cstring> |
#include <cstring> |
16 |
#include "util.h" |
#include "Util.h" |
17 |
|
|
18 |
using namespace std; |
using namespace std; |
19 |
|
|
403 |
ifstream in(filename.c_str()); |
ifstream in(filename.c_str()); |
404 |
if (in) |
if (in) |
405 |
{ |
{ |
406 |
char buffer[2048]; |
char buffer[4096]; |
407 |
in.read(buffer, 2047); |
in.read(buffer, 4095); |
408 |
buffer[ in.gcount() ] = 0; |
buffer[ in.gcount() ] = 0; |
409 |
str = string(buffer); |
str = string(buffer); |
410 |
in.close(); |
in.close(); |
411 |
} |
} |
412 |
else |
else |
413 |
{ |
{ |
414 |
string message = "Could no open "; |
string message = "Could not open "; |
415 |
message += filename; |
message += filename; |
416 |
throw std::runtime_error(message); |
throw std::runtime_error(message); |
417 |
} |
} |