OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
src
vec
ossimVpfLibraryAttributeTableValidator.cpp
Go to the documentation of this file.
1
#include <
ossim/vec/ossimVpfLibraryAttributeTableValidator.h
>
2
#include <
ossim/vec/ossimVpfTable.h
>
3
4
bool
ossimVpfLibraryAttributeTableValidator::isValid
(
ossimVpfTable
& aTable)
const
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
}
vpf_table_type::fp
FILE * fp
Definition:
vpftable.h:113
table_pos
ossim_int32 table_pos(const char *field_name, vpf_table_type table)
ossimVpfTable::isClosed
virtual bool isClosed() const
Definition:
ossimVpfTable.cpp:103
vpf_table_type
Definition:
vpftable.h:103
ossimVpfTable
Definition:
ossimVpfTable.h:22
ossimVpfLibraryAttributeTableValidator::isValid
virtual bool isValid(ossimVpfTable &aTable) const
Definition:
ossimVpfLibraryAttributeTableValidator.cpp:4
ossimVpfTable::getVpfTableData
vpf_table_type * getVpfTableData()
Definition:
ossimVpfTable.h:61
ossimVpfLibraryAttributeTableValidator.h
ossimVpfTable.h
Generated on Fri Aug 3 2018 08:46:54 for OSSIM - Open Source Software Image Map by
1.8.14