rllib  1
rlhistoryreader.h
Go to the documentation of this file.
00001 /***************************************************************************
00002                        rlhistoryreader.h  -  description
00003                              -------------------
00004     begin                : Wed Dec 06 2006
00005     copyright            : (C) 2006 by Rainer Lehrig
00006     email                : lehrig@t-online.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This library is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as        *
00013  *   published by the Free Software Foundation                             *
00014  *                                                                         *
00015  ***************************************************************************/
00016 #ifndef _RL_HISTORY_READER_H_
00017 #define _RL_HISTORY_READER_H_
00018 
00019 #include "rldefine.h"
00020 #include "rltime.h"
00021 #include <stdio.h>
00022 
00023 typedef struct _rlHistoryReaderLine_
00024 {
00025   _rlHistoryReaderLine_ *next;
00026   char *line;
00027 }rlHistoryReaderLine;
00028 
00078 
00082 
00086 class rlHistoryReader
00087 {
00088 public:
00089   rlHistoryReader();
00090   virtual ~rlHistoryReader();
00091   int read(const char *csvName, rlTime *start, rlTime *end);
00092   const char *firstLine();
00093   const char *nextLine();
00094   int clean();
00095   int cat(const char *csvName, FILE *fout);
00096   int debug;
00097 private:
00098   int openFile();
00099   int pushLineToMemory(const char *line);
00100   rlHistoryReaderLine *first_line,*current_line;
00101   rlTime time;
00102   FILE *fin;
00103   int current_file;
00104   char *csv_name, *csv_file_name;
00105 };
00106 #endif