Mercurial Hosting > traffic-intelligence
view c/utils.cpp @ 70:a52653dca25d
got track features to compile, updated paths to headers and libraries for OpenCV 2
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Sat, 13 Nov 2010 11:20:10 -0500 |
parents | ef0d7caf8e91 |
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; }