OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimVpfDatabaseHeaderTableValidator.cpp
Go to the documentation of this file.
1 //-----------------------------------------------------------------
2 // License: LGPL
3 //
4 // See LICENSE.txt file in the top level directory for more details.
5 //-----------------------------------------------------------------
8 
10 {
11 }
12 
14 {
15  // make sure the table is not null
16  if(&aTable == NULL)
17  {
18  return false;
19  }
20 
21  // and make sure that the table is not closed
22  if(aTable.isClosed())
23  {
24  return false;
25  }
26 
27  // get the table data defined in vpf_util/vpftable.h"
28  const vpf_table_type* data = aTable.getVpfTableData();
29 
30  if(!data)
31  {
32  return false;
33  }
34 
35  // if the file is not open then we can't validate
36  if(!data->fp)
37  {
38  return false;
39  }
40 
41  // The way that we will validate is to see if the columns of a dht
42  // exist. if the column didn't exist then the position
43  // will be negative
44  long column = table_pos("ID", *data);
45  if(column < 0)
46  {
47  return false;
48  }
49  column = table_pos("VPF_VERSION", *data);
50  if(column < 0)
51  {
52  return false;
53  }
54  column = table_pos("DATABASE_NAME", *data);
55  if(column < 0)
56  {
57  return false;
58  }
59  column = table_pos("DATABASE_DESC", *data);
60  if(column < 0)
61  {
62  return false;
63  }
64  column = table_pos("MEDIA_STANDARD", *data);
65  if(column < 0)
66  {
67  return false;
68  }
69  column = table_pos("ORIGINATOR", *data);
70  if(column < 0)
71  {
72  return false;
73  }
74  column = table_pos("ADDRESSEE", *data);
75  if(column < 0)
76  {
77  return false;
78  }
79  column = table_pos("MEDIA_VOLUMES", *data);
80  if(column < 0)
81  {
82  return false;
83  }
84  column = table_pos("SEQ_NUMBERS", *data);
85  if(column < 0)
86  {
87  return false;
88  }
89  column = table_pos("NUM_DATA_SETS", *data);
90  if(column < 0)
91  {
92  return false;
93  }
94  column = table_pos("SECURITY_CLASS", *data);
95  if(column < 0)
96  {
97  return false;
98  }
99  column = table_pos("DOWNGRADING", *data);
100  if(column < 0)
101  {
102  return false;
103  }
104  column = table_pos("DOWNGRADE_DATE", *data);
105  if(column < 0)
106  {
107  return false;
108  }
109  column = table_pos("RELEASABILITY", *data);
110  if(column < 0)
111  {
112  return false;
113  }
114  column = table_pos("TRANSMITTAL_ID", *data);
115  if(column < 0)
116  {
117  return false;
118  }
119  column = table_pos("EDITION_NUMBER", *data);
120  if(column < 0)
121  {
122  return false;
123  }
124  column = table_pos("EDITION_DATE", *data);
125  if(column < 0)
126  {
127  return false;
128  }
129 
130  return true;
131 
132 }
ossim_int32 table_pos(const char *field_name, vpf_table_type table)
virtual bool isClosed() const
vpf_table_type * getVpfTableData()
Definition: ossimVpfTable.h:61
virtual bool isValid(ossimVpfTable &aTable) const