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/TextReader.hpp>
14 #include <anna/io/internal/sccs.hpp>
19 io::TextReader::TextReader(const int maxLength) :
21 a_maxLength(maxLength) {
22 a_buffer = new char [maxLength];
26 io::TextReader::TextReader(const char* filename, const int maxLength) :
27 AbstractReader(filename),
28 a_maxLength(maxLength) {
29 a_buffer = new char [maxLength];
33 io::TextReader::TextReader(const std::string& filename, const int maxLength) :
34 AbstractReader(filename),
35 a_maxLength(maxLength) {
36 a_buffer = new char [maxLength];
41 io::TextReader::~TextReader() {
45 const char* io::TextReader::fetch()
46 throw(RuntimeException) {
48 char* result = fgets(a_buffer, a_maxLength - 1, a_file);
51 char* w = anna_strchr(result, '\n');