fedithead  Richard J. Mathar
Fitsheaderkeywordbatcheditor
 All Classes Files Functions Variables Macros
FEditHead.h
Go to the documentation of this file.
1 #ifndef FEDITHEAD_H
2 #define FEDITHEAD_H
3 /*
4 * MPIA - GEIRS project
5 *
6 * "$Header: https://svn.mpia.de/gulli/geirs/src/branches/rjm/FEditHead.h 709 2013-10-29 19:43:10Z mathar $"
7 *
8 */
9 
10 #include "config.h"
11 #include <string>
12 #include <vector>
13 
17 #include <CCfits/CCfits>
18 
19 using namespace std ;
20 using namespace CCfits ;
21 
41 class FEditHead : public FITS {
42 
43 public:
44 
45  FEditHead(char *fitsname, char *fitstpl) ;
46  FEditHead(char *fitsname, const vector<string> fitstpl) ;
47  FEditHead(const char *gstream, int glines, int bitpix, int naxis, long* naxes, char fitstpl[], const char *fname) ;
48  FEditHead(const char *gstream, int glines, int bitpix, int naxis, long* naxes, const vector<string> fitstpl, const char *fname) ;
49  FEditHead(const char *gstream, char *fname, int glines= -1) ;
50 
51  ~FEditHead() ;
52 
53  void exec(const bool verbose) ;
54 
57  String cfgFil ;
58 
59  char * allLines(int maxLines) ;
60 
64  char *buffer ;
65 
66 #ifdef FEDITHEAD_KEEP_FLAG
67 
70  bool keepDtor ;
71 #endif
72 
73 protected:
74 
82  vector<string> tplLins ;
83 
84  vector<string> scanTpl(const char *fitstpl, const bool raw80=false) const ;
85  vector<string> scanTpl(const string fitstpl, const bool raw80=false) const ;
86  vector<string> scanTpl(const vector<string>fitstpl, const bool raw80=false) const ;
87 
88  static string trimws(const string & instring) ;
89 
90  static char * parse_template(const string & instring) ;
91 
92  static int templateAnal(char * card, char keyname[], char keyval[], char cmt[], char dtyp[]) ;
93 
94  static vector<string> splitColon(const string & instring) ;
95  static vector<string> splitColon(const string & instring, const string & delim) ;
96 
97  void readStream(const char *gstream, int glines, const bool restr=false) ;
98 
99  static bool addHduCard(HDU & hdu, char *card, const bool verbose = false) ;
100 private:
101 
102 } ; /* FEditHead */
103 
104 #endif /* FEDITHEAD_H */