CCfits 2.7

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List

KeywordCreator.h

    00001 //  Astrophysics Science Division,
    00002 //  NASA/ Goddard Space Flight Center
    00003 //  HEASARC
    00004 //  http://heasarc.gsfc.nasa.gov
    00005 //  e-mail: ccfits@legacy.gsfc.nasa.gov
    00006 //
    00007 //  Original author: Ben Dorman
    00008
    00009 #ifndef KEYWORDCREATOR_H
    00010 #define KEYWORDCREATOR_H 1
    00011
    00012 // KeyData
    00013 #include "KeyData.h"
    00014 // FitsError
    00015 #include "FitsError.h"
    00016
    00017 namespace CCfits {
    00018   class HDU;
    00019
    00020 } // namespace CCfits
    00021
    00022
    00023 namespace CCfits {
    00024
    00025
    00026
    00027   class KeywordCreator
    00028   {
    00029
    00030     public:
    00031         KeywordCreator (HDU* p);
    00032         virtual ~KeywordCreator();
    00033
    00034         virtual Keyword* MakeKeyword (const String& keyName, const String& comment = String(""), bool isLongStr = false) = 0;
    00035         static Keyword* getKeyword (const String& keyName, HDU* p);
    00036         //  Additional Public Declarations
    00037         virtual void reset ();
    00038         virtual Keyword* createKeyword (const String& keyName, const String& comment = String(""), bool isLongStr = false);
    00039         //  This version of getKeyword is for reading a keyword
    00040         //  in with a specified type.
    00041         static Keyword* getKeyword (const String& keyName, ValueType keyType, HDU* p);
    00042         static Keyword* getKeyword (int keyNumber, HDU* p);
    00043         // If calling function already has the keyword name, it can send it in as the
    00044         //   3rd argument and the function will make use of it.  Otherwise leave it
    00045         //   empty and the function will just extract the keyword name from the card.
    00046         //   This function does not take ownership of the memory allocated to card.
    00047         static Keyword* getKeywordFromCard(char* card, HDU* p, const String& keyName=string(""));
    00048
    00049       // Additional Public Declarations
    00050
    00051     protected:
    00052         HDU* forHDU ();
    00053
    00054       // Additional Protected Declarations
    00055
    00056     private:
    00057         KeywordCreator(const KeywordCreator &right);
    00058         KeywordCreator & operator=(const KeywordCreator &right);
    00059
    00060         static Keyword* parseRecord (const String& name, const String& valueString, const String& comment, HDU* hdu, bool isLongStr = false);
    00061         static bool isContinued (const String& value);
    00062         static void getLongValueString (HDU* p, const String& keyName, String& value, String& comment);
    00063
    00064       // Additional Private Declarations
    00065
    00066     private: //## implementation
    00067       // Data Members for Class Attributes
    00068         Keyword *m_keyword;
    00069
    00070       // Data Members for Associations
    00071         HDU* m_forHDU;
    00072
    00073       // Additional Implementation Declarations
    00074
    00075   };
    00076
    00077   // Class CCfits::KeywordCreator
    00078
    00079   inline void KeywordCreator::reset ()
    00080   {
    00081     m_keyword=0;
    00082
    00083   }
    00084
    00085   inline HDU* KeywordCreator::forHDU ()
    00086   {
    00087     return m_forHDU;
    00088   }
    00089
    00090 } // namespace CCfits
    00091
    00092
    00093 #endif