Mercurial Hosting > traffic-intelligence
view c/utils.cpp @ 136:0f790de9437e
renamed Feature to Motion files and added code to test blob db
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Thu, 18 Aug 2011 22:25:21 -0400 |
parents | a52653dca25d |
children | b32947b002da |
line wrap: on
line source
#include "utils.hpp" #include <iostream> #include <fstream> using namespace std; void openWriteScientificPrecision(ofstream& out, const string& filename, const int& precision) { ::openWritePrecision(out, filename, precision); out.setf(ios::scientific); } void openWritePrecision(ofstream& out, const string& filename, const int& precision) { out.open(filename.c_str(), ios::binary); ::openCheck(out, filename, "openWritePrecision"); out.precision(precision); } bool openCheck(ifstream& f, const string& filename, const string& callingFunctionName) { if (!f.is_open()) { cerr << "Pb opening file " << filename << " in " << callingFunctionName << endl; return false; } else return true; } bool openCheck(ofstream& f, const string& filename, const string& callingFunctionName) { if (!f.is_open()) { cerr << "Pb opening file " << filename << " in " << callingFunctionName << endl; return false; } else return true; }