OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimVpfLibraryAttributeTableValidator.cpp
Go to the documentation of this file.
3 
5 {
6  // make sure the table is not null
7  if(&aTable == NULL)
8  {
9  return false;
10  }
11 
12  // and make sure that the table is not closed
13  if(aTable.isClosed())
14  {
15  return false;
16  }
17 
18  // get the table data defined in vpf_util/vpftable.h"
19  const vpf_table_type* data = aTable.getVpfTableData();
20 
21  if(!data)
22  {
23  return false;
24  }
25  // if the file is not open then we can't validate
26  if(!data->fp)
27  {
28  return false;
29  }
30 
31  // The way that we will validate is to see if the columns of a dht
32  // exist. if the column didn't exist then the position
33  // will be negative
34  long column = table_pos("ID", *data);
35  if(column < 0)
36  {
37  return false;
38  }
39  column = table_pos("LIBRARY_NAME", *data);
40  if(column < 0)
41  {
42  return false;
43  }
44  column = table_pos("XMIN", *data);
45  if(column < 0)
46  {
47  return false;
48  }
49  column = table_pos("YMIN", *data);
50  if(column < 0)
51  {
52  return false;
53  }
54  column = table_pos("XMAX", *data);
55  if(column < 0)
56  {
57  return false;
58  }
59  column = table_pos("YMAX", *data);
60  if(column < 0)
61  {
62  return false;
63  }
64 
65  return true;
66 }
ossim_int32 table_pos(const char *field_name, vpf_table_type table)
virtual bool isClosed() const
virtual bool isValid(ossimVpfTable &aTable) const
vpf_table_type * getVpfTableData()
Definition: ossimVpfTable.h:61