OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimFilenameProperty.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: Garrett Potts (gpotts@imagelinks.com)
6 //
7 //*************************************************************************
8 // $Id: ossimFilenameProperty.cpp 15833 2009-10-29 01:41:53Z eshirschorn $
10 
11 RTTI_DEF1(ossimFilenameProperty, "ossimFilenameProperty", ossimProperty);
12 
14  const ossimFilename& value,
15  const std::vector<ossimString>& filterList)
16  :ossimProperty(name),
17  theValue(value),
18  theFilterList(filterList),
19  theIoType(ossimFilenamePropertyIoType_NOT_SPECIFIED)
20 {
21 }
22 
24  :ossimProperty(rhs),
25  theValue(rhs.theValue),
26  theFilterList(rhs.theFilterList),
27  theIoType(rhs.theIoType)
28 {
29 }
30 
32 {
33 }
34 
36 {
37  return new ossimFilenameProperty(*this);
38 }
39 
41 {
42  valueResult = theValue;
43 }
44 
46 {
47  theValue = value;
48 
49  return true;
50 }
51 
53 {
54  assign(rhs);
55 
56  return *this;
57 }
58 
60 {
62  theValue = rhs.valueToString();
63 
64  const ossimFilenameProperty* rhsPtr = dynamic_cast<const ossimFilenameProperty*>(&rhs);
65  if(rhsPtr)
66  {
67  theFilterList = rhsPtr->theFilterList;
68  theIoType = rhsPtr->theIoType;
69  }
70 
71  return *this;
72 }
73 
75 {
76  theFilterList.clear();
77 }
78 
80 {
81  return (ossim_uint32)theFilterList.size();
82 }
83 
85  const ossimString& filterValue)
86 {
87  if(idx < getNumberOfFilters())
88  {
89  theFilterList[idx] = filterValue;
90  }
91 }
92 
94 {
95  if(idx < getNumberOfFilters())
96  {
97  return theFilterList[idx];
98  }
99 
100  return ossimString("");
101 }
102 
103 
105 {
106  ossimString result;
107  ossim_uint32 idx = 0;
108 
109  if(getNumberOfFilters() > 0)
110  {
111  for(idx = 0; idx < getNumberOfFilters()-1;++idx)
112  {
113  result += getFilter(idx);
114  result += separator;
115  }
116  result += getFilter(getNumberOfFilters()-1);
117  }
118 
119  return result;
120 }
121 
122 
123 const std::vector<ossimString>& ossimFilenameProperty::getFilterList()const
124 {
125  return theFilterList;
126 }
127 
129 {
130  theFilterList.push_back(filter);
131 }
132 
133 
135 {
136  theIoType = ioType;
137 }
138 
140 {
141  return theIoType;
142 }
143 
145 {
147 }
148 
150 {
152 }
virtual void valueToString(ossimString &valueResult) const =0
virtual const ossimProperty & assign(const ossimProperty &rhs)
ossimString getFilterListAsString(const ossimString &separator=ossimString("\)) const
virtual bool setValue(const ossimString &value)
ossimFilenamePropertyIoType theIoType
virtual const ossimProperty & assign(const ossimProperty &rhs)
virtual ossimString valueToString() const
ossimObject * dup() const
unsigned int ossim_uint32
ossimFilenameProperty(const ossimString &name=ossimString(""), const ossimFilename &value=ossimFilename(""), const std::vector< ossimString > &filterList=std::vector< ossimString >())
const std::vector< ossimString > & getFilterList() const
std::vector< ossimString > theFilterList
void setIoType(ossimFilenamePropertyIoType ioType)
void setFilter(ossim_uint32 idx, const ossimString &filterValue)
RTTI_DEF1(ossimFilenameProperty, "ossimFilenameProperty", ossimProperty)
ossimFilenamePropertyIoType getIoType() const
void addFilter(const ossimString &filter)
ossim_uint32 getNumberOfFilters() const
ossimString getFilter(ossim_uint32 idx) const
const ossimFilenameProperty & operator=(ossimFilenameProperty &rhs)