1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
11 #include <anna/config/defines.hpp>
13 #include <anna/io/AbstractReader.hpp>
14 #include <anna/io/internal/sccs.hpp>
19 io::AbstractReader::AbstractReader() :
25 io::AbstractReader::AbstractReader(const char* filename) :
28 if((a_file = fopen(filename, "r")) == NULL)
29 a_ex = new RuntimeException(filename, errno, ANNA_FILE_LOCATION);
34 io::AbstractReader::AbstractReader(const std::string& filename) :
37 if((a_file = fopen(filename.c_str(), "r")) == NULL)
38 a_ex = new RuntimeException(filename, errno, ANNA_FILE_LOCATION);
44 io::AbstractReader::~AbstractReader() {
48 void io::AbstractReader::close()
59 void io::AbstractReader::open(const std::string& filename)
60 throw(RuntimeException) {
63 if((a_file = fopen(filename.c_str(), "r")) == NULL)
64 throw RuntimeException(filename, errno, ANNA_FILE_LOCATION);
67 void io::AbstractReader::verify()
68 throw(RuntimeException) {
73 string msg("io::AbstractReader | File: ");
75 msg += " | Cannot open";
76 throw RuntimeException(msg, ANNA_FILE_LOCATION);