Go to the documentation of this file.00001
00002
00003
00004
00005 #ifndef VIL_NITF2_HEADER_H
00006 #define VIL_NITF2_HEADER_H
00007
00008 #include "vil_nitf2_tagged_record.h"
00009 #include "vil_nitf2_classification.h"
00010 #include "vil_nitf2.h"
00011
00012 class vil_stream;
00013
00014
00015
00016
00017
00018 class vil_nitf2_header
00019 {
00020 public:
00021 vil_nitf2_header();
00022
00023 virtual ~vil_nitf2_header();
00024
00025 enum portion_type {
00026 enum_subheader,
00027 enum_data
00028 };
00029 enum section_type {
00030 enum_file_header = 0,
00031 enum_image_segments,
00032 enum_graphic_segments,
00033 enum_label_segments,
00034 enum_text_segments,
00035 enum_data_extension_segments,
00036 enum_reserved_extension_segments
00037 };
00038 static vcl_string section_num_tag(section_type sec);
00039 static vcl_string section_len_header_tag(section_type sec);
00040 static vcl_string section_len_data_tag(section_type sec);
00041
00042
00043 virtual bool read( vil_stream* stream );
00044
00045
00046
00047
00048 template< class T >
00049 bool get_property(vcl_string tag, T& out_value) const
00050 {
00051 if ( m_field_sequence_classification && m_field_sequence_classification->get_value(tag, out_value) ) return true;
00052 else if ( m_field_sequence2 && m_field_sequence2->get_value(tag, out_value) ) return true;
00053 else return m_field_sequence1.get_value(tag, out_value);
00054 }
00055
00056
00057
00058 template< class T >
00059 bool get_property(vcl_string tag, int i, T& out_value) const
00060 {
00061 if ( m_field_sequence_classification && m_field_sequence_classification->get_value(tag, i, out_value) ) return true;
00062 else if ( m_field_sequence2 && m_field_sequence2->get_value(tag, i, out_value) ) return true;
00063 else return m_field_sequence1.get_value(tag, i, out_value);
00064 }
00065
00066 vil_nitf2_classification::file_version file_version() const;
00067
00068
00069
00070 virtual vil_nitf2_field::field_tree* get_tree() const;
00071
00072 protected:
00073
00074 vil_nitf2_field_sequence m_field_sequence1;
00075 vil_nitf2_field_sequence* m_field_sequence2;
00076 vil_nitf2_field_sequence* m_field_sequence_classification;
00077
00078
00079 static vil_nitf2_field_definitions* get_field_definitions_1();
00080 static vil_nitf2_field_definitions* get_field_definitions_2( vil_nitf2_classification::file_version version );
00081
00082 private:
00083 static vil_nitf2_field_definitions* s_field_definitions_1;
00084 static vil_nitf2_field_definitions* s_field_definitions_21;
00085 static vil_nitf2_field_definitions* s_field_definitions_20;
00086
00087
00088
00089 friend void vil_nitf2::cleanup_static_members();
00090 };
00091
00092 #endif // VIL_NITF2_HEADER_H