Older gcc compiler (4.1) doesn't implicitly cast the integer value to a
streampos value. This caused compilation problems on Centos5. The explicit
cast eliminates this issue.
}
}
-std::ifstream::pos_type
+std::streampos
CSVFile::size() const {
std::ifstream fs(filename_.c_str());
bool ok = fs.good();
void
CSVFile::open() {
// If file doesn't exist or is empty, we have to create our own file.
- if (size() == 0) {
+ if (size() == static_cast<std::streampos>(0)) {
recreate();
} else {
void checkStreamStatusAndReset(const std::string& operation) const;
/// @brief Returns size of the CSV file.
- std::ifstream::pos_type size() const;
+ std::streampos size() const;
/// @brief CSV file name.
std::string filename_;