forked from ossimlabs/ossim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathossimInfoBase.cpp
More file actions
67 lines (57 loc) · 1.72 KB
/
Copy pathossimInfoBase.cpp
File metadata and controls
67 lines (57 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//----------------------------------------------------------------------------
//
// License: LGPL
//
// See LICENSE.txt file in the top level directory for more details.
//
// Author: David Burken
//
// Description: Base class for Info object.
//
//----------------------------------------------------------------------------
// $Id$
#include <ossim/support_data/ossimInfoBase.h>
#include <ossim/base/ossimKeywordlist.h>
#include <ossim/base/ossimStreamFactoryRegistry.h>
#include <sstream>
ossimInfoBase::ossimInfoBase()
: theOverviewFlag(true)
{}
ossimInfoBase::~ossimInfoBase()
{}
bool ossimInfoBase::open(const ossimFilename& file)
{
std::string connectionString = file.c_str();
std::shared_ptr<ossim::istream> str = ossim::StreamFactoryRegistry::instance()->
createIstream( file.c_str(), std::ios_base::in|std::ios_base::binary);
if(!str) return false;
return open(str, connectionString);
}
bool ossimInfoBase::open(std::shared_ptr<ossim::istream>& /* str */,
const std::string& /* connectionString */)
{
return false;
}
void ossimInfoBase::setProcessOverviewFlag(bool flag)
{
theOverviewFlag = flag;
}
bool ossimInfoBase::getProcessOverviewFlag() const
{
return theOverviewFlag;
}
bool ossimInfoBase::getKeywordlist(ossimKeywordlist& kwl)const
{
// Do a print to a memory stream.
std::ostringstream out;
print(out);
std::istringstream in(out.str());
// Give the result to the keyword list.
return kwl.parseStream(in);
}
bool ossimInfoBase::getKeywordlist(ossimKeywordlist& kwl,
ossim_uint32 /* entryIndex */ )const
{
// If this gets hit the specific info object does not support entry indexes.
return getKeywordlist( kwl );
}