00001
00002
00003 #ifndef _JOINXMLDOC_H
00004 #define _JOINXMLDOC_H
00005
00006 #include "joingrps.h"
00007 #include "idreferl.h"
00008 #include "domid.h"
00009 #include "teiheader.h"
00010 #include "joinprolog.h"
00011 #include <string>
00012 #include <vector>
00013 #include <fstream>
00014
00017 class JoinXMLDoc:public IdRefErl {
00018 protected:
00019 DomId joinDom;
00020 JoinProlog prolog;
00021 JoinGrpS jGrpS;
00022
00023 public:
00024
00028 JoinXMLDoc(const DomId & domId);
00029
00033 JoinXMLDoc(const JoinXMLDoc & joinDoc);
00034
00036 virtual ~JoinXMLDoc();
00037
00042 JoinXMLDoc& operator=(const JoinXMLDoc & joinDoc);
00043
00047 DomId getDom() const;
00048
00052 void putDom ( const DomId & domId);
00053
00058 std::string getRefFitx(const DomId & domId) const;
00059
00064 std::vector <std::string> getRefFitx(const RefType & rt) const;
00065
00070 std::vector <DomId> getRefDom(const RefType & rt) const;
00071
00078 void addRefFitx(const RefType & rt, const DomId & d, const std::string & f, const bool system=true);
00079
00083 void removeRefFitx(const DomId & d);
00084
00088 void removeRefFitx(const std::string & fitx);
00089
00092 void begin();
00093
00096 void next();
00097
00101 bool ready() const;
00102
00106 JoinGrp current() const;
00107
00108
00109 std::vector<JoinGrpType> getJoinGrpTypes() const;
00110 JoinGrp getJoinGrp(const JoinGrpType &) const;
00111 void addJoinGrp(const JoinGrp &);
00112
00113
00114 void addJoin(const JoinGrpType &, const Join &);
00115 void removeJoin(const JoinGrpType &, const Join &);
00116
00120 unsigned size() const;
00121
00126 unsigned size(const JoinGrpType & jgt) const;
00127
00132 bool contains(const JoinId & joinId) const;
00133
00138 Join get(const JoinId & joinId) const;
00139
00145 Join get(const JoinGrpType& jgt, const unsigned pos) const;
00146
00147
00148
00149
00150
00151
00152
00153
00154
00159 std::vector<Join> find (const Id & id);
00160
00166 std::vector<Join> find (const TargetName & n, const Id & id);
00167
00174 std::vector<Id> find (const TargetName & n1, const Id & id1, const TargetName & nResult);
00175
00181 std::vector<Join> find (const unsigned int & pos, const Id & id);
00182
00189 std::vector<Id> find (const unsigned int & pos1, const Id & id, const unsigned int & pos2);
00190
00191
00192 private:
00193
00194 void writeDocument(XMLSimpleStruct*) const throw (char*);
00195 void readDocument(XMLSimpleStruct*) throw (char*);
00196
00197 };
00198 #endif //_JOINXMLDOC_H