src/loader.cpp File Reference

#include <cstdlib>
#include <cmath>
#include <cassert>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include "loader.h"

Include dependency graph for loader.cpp:

Go to the source code of this file.

Functions

void checkFile (const char *path)
std::istream & operator>> (std::istream &is, Course &c)


Function Documentation

void checkFile ( const char *  path  ) 

Definition at line 35 of file loader.cpp.

00035                                  {
00036   try {
00037     std::ifstream input(path);
00038     input.seekg(0, std::ios::end);
00039     if (input.tellg() < 1) {
00040       std::cerr << "Loader: The data file " << path << " has zero lenght" << std::endl; 
00041       std::abort();
00042     }
00043     input.close();
00044   } catch (...) { 
00045     std::cerr << "Loader: There was an error opening the data file " << path << std::endl;
00046     std::abort(); 
00047   }
00048 }

std::istream& operator>> ( std::istream &  is,
Course c 
)

Definition at line 51 of file loader.cpp.

References Udine::Course::lectures, Udine::Course::minWorkingDays, Udine::Course::name, Udine::Course::students, and Udine::Course::teacher.

00051                                                   {
00052   return is >> c.name >> c.teacher >> c.lectures >> c.minWorkingDays >> c.students;
00053 }


Generated on Mon May 11 18:56:45 2009 for MemosTimetabling by  doxygen 1.5.9