00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef KEYWORDCREATOR_H
00013 #define KEYWORDCREATOR_H 1
00014
00015
00016 #include "FitsError.h"
00017
00018 #include "KeyData.h"
00019
00020 namespace CCfits {
00021 class HDU;
00022
00023 }
00024
00025
00026 namespace CCfits {
00027
00028
00029
00030 class KeywordCreator
00031 {
00032
00033 public:
00034 KeywordCreator (HDU* p);
00035 virtual ~KeywordCreator();
00036
00037 virtual Keyword* MakeKeyword (const String& keyName, const String& comment = String("")) = 0;
00038 static Keyword* getKeyword (const String& keyName, HDU* p);
00039
00040 virtual void reset ();
00041 virtual Keyword* createKeyword (const String& keyName, const String& comment = String(""));
00042
00043
00044 static Keyword* getKeyword (const String& keyName, ValueType keyType, HDU* p);
00045 static Keyword* getKeyword (int keyNumber, HDU* p);
00046
00047
00048
00049 protected:
00050 HDU* forHDU ();
00051
00052
00053
00054 private:
00055 KeywordCreator(const KeywordCreator &right);
00056 KeywordCreator & operator=(const KeywordCreator &right);
00057
00058 static Keyword* parseRecord (const String& name, const String& valueString, const String& comment, HDU* hdu);
00059 static bool isContinued (const String& value);
00060 static void getLongValueString (HDU* p, const String& keyName, String& value);
00061
00062
00063
00064 private:
00065
00066 Keyword *m_keyword;
00067
00068
00069 HDU* m_forHDU;
00070
00071
00072
00073 };
00074
00075
00076
00077 inline void KeywordCreator::reset ()
00078 {
00079 m_keyword=0;
00080
00081 }
00082
00083 inline HDU* KeywordCreator::forHDU ()
00084 {
00085 return m_forHDU;
00086 }
00087
00088 }
00089
00090
00091 #endif