Changeset 18953


Ignore:
Timestamp:
03/05/18 16:30:25 (7 years ago)
Author:
tbretz
Message:
Implemented a specialized template for Entry::Get in case of a string, otherwise only the first word is returned; added id and comment to the Column to keep more details which are difficult to access later
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mcore/fits.h

    r18594 r18953  
    8585            return t;
    8686        }
     87
     88        /* Specialization needs to be outside namespace-scope, see below
     89        template<>
     90            std::string fits::Entry::Get<std::string>() const
     91        {
     92            return value;
     93        }*/
    8794    };
    8895
     
    101108        struct Column
    102109        {
     110            size_t id;
    103111            size_t offset;
    104112            size_t num;
     
    107115            char   type;
    108116            std::string unit;
     117            std::string comment;
    109118            Compression_t comp;
    110119        };
     
    287296                const std::string unit = Get<std::string>("TUNIT"+num, "");
    288297                const std::string comp = Get<std::string>("ZCTYP"+num, "");
     298                const std::string comm = Get<std::string>("TCOMM"+num, "");
    289299
    290300                Compression_t compress = kCompUnknown;
     
    331341                }
    332342
    333                 const Table::Column col = { bytes, size_t(n), size, n*size, type, unit, compress};
     343                const Table::Column col = { i, bytes, size_t(n), size, n*size, type, unit, comm, compress };
    334344
    335345                cols[id] = col;
     
    10451055};
    10461056
    1047 #endif
     1057template<>
     1058std::string fits::Entry::Get<std::string>() const
     1059{
     1060    return value;
     1061}
     1062
     1063#endif
Note: See TracChangeset for help on using the changeset viewer.