OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimShapeDatabase.h
Go to the documentation of this file.
1 #ifndef ossimShapeDatabase_HEADER
2 #define ossimShapeDatabase_HEADER 1
3 
4 #include <iostream>
5 #include <shapefil.h>
6 
8 #include <ossim/base/ossimRtti.h>
11 
12 #include <ossim/base/ossimString.h>
13 
14 
16 {
17 public:
19 
21  int theWidth;
23  DBFFieldType theFieldType;
25 };
26 
28 {
29 
30 public:
31  bool getField(ossimShapeDatabaseField& result,
32  ossim_uint32 i);
33 
34  bool setField(const ossimShapeDatabaseField& field,
35  ossim_uint32 i);
36 
37  int getNumberOfFields()const;
38 
39  void setNumberOfFields(int n);
40 
41  ossim_int32 getFieldIdx(const ossimString& name,
42  bool caseInsensitive=true)const;
43 protected:
44  std::vector<ossimShapeDatabaseField> theFieldArray;
45 };
46 
48 {
49 public:
51  const ossimShapeDatabase& rhs);
52 
54  virtual ~ossimShapeDatabase();
55 
56  virtual bool open(const ossimFilename& file,
57  const ossimString& flags=ossimString("rb"));
58 
59  virtual void close();
60 
61  bool getRecord(ossimShapeDatabaseRecord& result);
62 
63  bool getRecord(ossimShapeDatabaseRecord& result,
64  int recordNumber);
65 
66  bool getNextRecord(ossimShapeDatabaseRecord& result);
67 
68  int getNumberOfRecords()const;
69 
70  bool isOpen()const;
71 
72  virtual DBFHandle getHandle();
73 
74  virtual const DBFHandle& getHandle()const;
75 
76  virtual std::ostream& print(std::ostream& out)const;
77 
78 protected:
79  DBFHandle theHandle;
81 
83 
85 };
86 
87 #endif
friend OSSIMDLLEXPORT std::ostream & operator<<(std::ostream &out, const ossimObject &obj)
virtual std::ostream & print(std::ostream &out) const
Generic print method.
os2<< "> n<< " > nendobj n
#define TYPE_DATA
Definition: ossimRtti.h:339
unsigned int ossim_uint32
#define OSSIM_PLUGINS_DLL
ossimString fieldTypeAsString() const
std::vector< ossimShapeDatabaseField > theFieldArray
ossimFilename theFilename
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
int ossim_int32