fixed compile error and added header for runtime_error

This commit is contained in:
jerry 2014-05-06 19:23:40 +00:00
parent 9621cba99e
commit 2797e9a719
1 changed files with 3 additions and 2 deletions

View File

@ -20,6 +20,7 @@
#include <fstream> #include <fstream>
#include <sstream> #include <sstream>
#include <stdexcept>
using namespace std; using namespace std;
@ -123,10 +124,10 @@ CDragInformation::stringToNum(CString& str)
CString CString
CDragInformation::getFileSize(CString& filename) CDragInformation::getFileSize(CString& filename)
{ {
std::fstream file(filename, ios::in|ios::binary); std::fstream file(filename.c_str(), ios::in|ios::binary);
if (!file.is_open()) { if (!file.is_open()) {
throw runtime_error("failed to get file size"); throw std::runtime_error("failed to get file size");
} }
// check file size // check file size