00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef XMLREADER_H
00021 #define XMLREADER_H
00022
00023
00024 #include <channelcolorslayout.h>
00025 #include "channelcolors.h"
00026 #include "generalinformation.h"
00027 #include "neuroscopevideoinfo.h"
00028 #include "tags.h"
00029 #include "fileinformation.h"
00030 #include "programinformation.h"
00031
00032
00033 #include <kurl.h>
00034
00035
00036 #include <qvaluelist.h>
00037
00038
00039 #include <stdlib.h>
00040 #include <stdio.h>
00041 #include <libxml/tree.h>
00042 #include <libxml/parser.h>
00043 #include <libxml/xpath.h>
00044 #include <libxml/xpathInternals.h>
00045
00046
00050 class XmlReader{
00051 public:
00052 XmlReader();
00053 ~XmlReader();
00054
00059 bool parseFile(const KURL& url);
00060
00062 void closeFile();
00063
00067 void getAcquisitionSystemInfo(QMap<QString,float>& acquisitionSystemInfo)const;
00068
00075 void getAnatomicalDescription(int nbChannels,QMap<int, QValueList<int> >& anatomicalGroups,QMap<QString, QMap<int,QString> >& attributes);
00076
00083 void getSpikeDescription(int nbChannels,QMap<int, QValueList<int> >& spikeGroups,QMap<int, QMap<QString,QString> >& information);
00084
00089 void getUnits(QMap< int,QValueList<QString> >& units)const;
00094 void getGeneralInformation(GeneralInformation& generalInformation)const;
00095
00099 void getVideoInfo(QMap<QString,float>& videoInformation)const;
00100
00105 int getLfpInformation()const;
00106
00107
00108
00113 void getFilesInformation(QValueList<FileInformation>& files)const;
00114
00115
00116
00120 void getChannelColors(QValueList<ChannelColors>& list)const;
00121
00126 float getScreenGain() const;
00127
00131 void getNeuroscopeVideoInfo(NeuroscopeVideoInfo& videoInfo) const;
00132
00136 void getChannelDefaultOffset(QMap<int,int>& channelDefaultOffsets)const;
00137
00143 int getNbSamples()const;
00144
00150 int getPeakSampleIndex()const;
00151
00152
00153
00157 void getProgramsInformation(QValueList<ProgramInformation>& programs) const;
00158
00162 void getProgramInformation(ProgramInformation& programInformation) const;
00163
00164 private:
00165 QString readVersion;
00166 xmlDocPtr doc;
00167 xmlXPathContextPtr xpathContex;
00168 };
00169
00170 #endif