qse  0.5.4
Public Types | Public Slots | Public Member Functions | Private Attributes | List of all members
QseFileReader Class Reference

#include <qsefilereader.h>

Inheritance diagram for QseFileReader:
Inheritance graph

Public Types

typedef QObject inherited
 

Public Slots

void openFile (QString fileName)
 
void appendFile (QString fileName)
 
void timerRoutine ()
 

Public Member Functions

 QseFileReader (const QString &name, QObject *parent=0)
 
 ~QseFileReader ()
 
QseInputFileinputFile ()
 

Private Attributes

QTimer * m_Timer
 
QString m_Name
 
QseInputFilem_Data
 
bool m_Abort
 
bool m_Restart
 
QStringList m_FileNames
 
int m_Changed
 

Detailed Description

Definition at line 13 of file qsefilereader.h.

Member Typedef Documentation

typedef QObject QseFileReader::inherited

Definition at line 21 of file qsefilereader.h.

Constructor & Destructor Documentation

QseFileReader::QseFileReader ( const QString &  name,
QObject *  parent = 0 
)

Definition at line 11 of file qsefilereader.cpp.

References m_Data, m_Name, m_Timer, and timerRoutine().

12  : inherited(parent),
13  m_Timer(NULL),
14  m_Name(name),
15  m_Data(NULL),
16  m_Abort(false),
17  m_Restart(false),
18  m_Changed(false)
19 {
20  m_Data = new QseInputFile(m_Name);
21 
22  m_Timer = new QTimer(this);
23 
24  connect(m_Timer, SIGNAL(timeout()), this, SLOT(timerRoutine()));
25 
26  m_Timer -> start(500);
27 }
QseInputFile * m_Data
Definition: qsefilereader.h:33
QString m_Name
Definition: qsefilereader.h:32
QTimer * m_Timer
Definition: qsefilereader.h:31
QObject inherited
Definition: qsefilereader.h:21
QseFileReader::~QseFileReader ( )

Definition at line 29 of file qsefilereader.cpp.

30 {
31 }

Member Function Documentation

void QseFileReader::appendFile ( QString  fileName)
slot

Definition at line 40 of file qsefilereader.cpp.

References m_FileNames.

41 {
42  m_FileNames.append(fileName);
43 }
QStringList m_FileNames
Definition: qsefilereader.h:36
QseInputFile * QseFileReader::inputFile ( )

Definition at line 80 of file qsefilereader.cpp.

References m_Data.

Referenced by QseDataFlow::QseDataFlow().

81 {
82  return m_Data;
83 }
QseInputFile * m_Data
Definition: qsefilereader.h:33
void QseFileReader::openFile ( QString  fileName)
slot

Definition at line 33 of file qsefilereader.cpp.

References m_FileNames, and m_Restart.

34 {
35  m_FileNames.clear();
36  m_FileNames.append(fileName);
37  m_Restart = true;
38 }
QStringList m_FileNames
Definition: qsefilereader.h:36
void QseFileReader::timerRoutine ( )
slot

Definition at line 45 of file qsefilereader.cpp.

References QseDataSet::emitOperationCompleted(), m_Abort, m_Changed, m_Data, m_FileNames, and m_Restart.

Referenced by QseFileReader().

46 {
47  forever {
48  int atend = m_Data -> atEnd();
49  int nfiles = m_FileNames.size();
50 
51  if (m_Abort) return;
52 
53  if (m_Restart || atend) {
54  if (m_Restart) {
55  m_Data -> clear();
56  m_Restart = false;
57  m_Changed = true;
58  }
59 
60  if (nfiles) {
61  QString nextFile = m_FileNames.takeFirst();
62 // printf("next data file\n");
63 
64  m_Data -> nextDataFile(nextFile);
65  m_Changed = true;
66  } else {
67  if (m_Changed) {
69  m_Changed = false;
70  }
71  return;
72  }
73  } else if (!atend) {
74  m_Data -> nextInputLine();
75  m_Changed = true;
76  }
77  }
78 }
QseInputFile * m_Data
Definition: qsefilereader.h:33
QStringList m_FileNames
Definition: qsefilereader.h:36
void emitOperationCompleted()
Definition: qsedataset.cpp:38

Member Data Documentation

bool QseFileReader::m_Abort
private

Definition at line 34 of file qsefilereader.h.

Referenced by timerRoutine().

int QseFileReader::m_Changed
private

Definition at line 37 of file qsefilereader.h.

Referenced by timerRoutine().

QseInputFile* QseFileReader::m_Data
private

Definition at line 33 of file qsefilereader.h.

Referenced by inputFile(), QseFileReader(), and timerRoutine().

QStringList QseFileReader::m_FileNames
private

Definition at line 36 of file qsefilereader.h.

Referenced by appendFile(), openFile(), and timerRoutine().

QString QseFileReader::m_Name
private

Definition at line 32 of file qsefilereader.h.

Referenced by QseFileReader().

bool QseFileReader::m_Restart
private

Definition at line 35 of file qsefilereader.h.

Referenced by openFile(), and timerRoutine().

QTimer* QseFileReader::m_Timer
private

Definition at line 31 of file qsefilereader.h.

Referenced by QseFileReader().


The documentation for this class was generated from the following files: