File: TXMLfile.h

package info (click to toggle)
gentle 1.9+cvs20100605+dfsg1-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 12,224 kB
  • sloc: cpp: 41,569; ansic: 3,978; sh: 1,420; makefile: 240
file content (40 lines) | stat: -rw-r--r-- 1,434 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/** \file
	\brief The TXMLfile class
*/
#ifndef _TXMLFILE_H_
#define _TXMLFILE_H_

#include "main.h"

class TVector ;
class TiXmlNode ;
class TVectorItem ;
class TiXmlDocument ;

/// This class is a wrapper around the tinyxml software, specialized for GenBankXML format
class TXMLfile
    {
    public :
    TXMLfile () ; ///< Constructor
    ~TXMLfile () {} ; ///< Dummy destructor
	
    void load ( wxString file ) ; ///< Load XML from file
    void parse ( wxString text ) ; ///< Pass XML as string
    bool success () { return _success ; } ///< Errors during parsing?
    int countVectors () ; ///< How many vectors were made from the XML?
    TVector *getVector ( int a ) ; ///< Returns pointer to one of the vectors
    
    private :
    void analyze ( TiXmlDocument &doc ) ; ///< Parse single/multiple sequences
    void readGBSeq ( TiXmlNode *base ) ; ///< The actual parser
    wxString t ( TiXmlText *txt ) ; ///< Safe text conversion
    wxString t ( const char *txt ) ; ///< Safe text conversion
    void readGBqualifiers ( TVectorItem &i , TiXmlNode *n ) ; ///< Part of the parser
    void readGBintervals ( vector <TVectorItem> &vi , const TVectorItem &i , TiXmlNode *n ) ; ///< Part of the parser
    wxString get_sub_desc ( TiXmlNode *base , int depth = 0 ) ;
    bool _success ; ///< Internal success marker
    wxArrayTVector _v ; ///< The generated vectors
    } ;

#endif