OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Protected Attributes | List of all members
ossimWmsGetMap Class Reference

#include <ossimWms.h>

Inheritance diagram for ossimWmsGetMap:
ossimReferenced

Public Member Functions

 ossimWmsGetMap ()
 
virtual bool read (ossimRefPtr< ossimXmlNode > node)
 
ossimWmsStringListTypegetFormatTypes ()
 
const ossimWmsStringListTypegetFormatTypes () const
 
bool hasFormats () const
 
bool hasFormat (const ossimString &format, bool caseSensitive=true) const
 Will do an exact compare on the input format. More...
 
bool containsFormat (const ossimString &format, bool caseSensitive=true) const
 Will not do an exact compare but instead will test if the passed in string is contained within the formats. More...
 
void clearFields ()
 
const ossimStringgetUrl () const
 
const ossimStringgetPostUrl () const
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 

Protected Attributes

ossimString theUrl
 
ossimString thePostUrl
 
ossimWmsStringListType theFormatTypes
 

Additional Inherited Members

- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Detailed Description

Definition at line 20 of file ossimWms.h.

Constructor & Destructor Documentation

◆ ossimWmsGetMap()

ossimWmsGetMap::ossimWmsGetMap ( )
inline

Definition at line 23 of file ossimWms.h.

24  {
25  clearFields();
26  }
void clearFields()
Definition: ossimWms.h:52

Member Function Documentation

◆ clearFields()

void ossimWmsGetMap::clearFields ( )
inline

Definition at line 52 of file ossimWms.h.

Referenced by read().

53  {
54  theUrl = "";
55  thePostUrl = "";
56  theFormatTypes.clear();
57  }
ossimWmsStringListType theFormatTypes
Definition: ossimWms.h:69
ossimString theUrl
Definition: ossimWms.h:67
ossimString thePostUrl
Definition: ossimWms.h:68

◆ containsFormat()

bool ossimWmsGetMap::containsFormat ( const ossimString format,
bool  caseSensitive = true 
) const

Will not do an exact compare but instead will test if the passed in string is contained within the formats.

You can also specify case sensitive.

Definition at line 89 of file ossimWms.cpp.

References ossimString::contains(), ossimString::downcase(), and theFormatTypes.

90 {
91  if(theFormatTypes.empty()) return false;
92  ossimString tempFormat = format;
93  if(!caseSensitive) tempFormat = tempFormat.downcase();
94 
95  ossim_uint32 idx = 0;
96  for(idx = 0; idx < theFormatTypes.size();++idx)
97  {
98  ossimString temp = theFormatTypes[idx];
99  if(!caseSensitive)
100  {
101  temp = temp.downcase();
102  }
103  if(temp.contains(tempFormat))
104  {
105  return true;
106  }
107  }
108 
109  return false;
110 }
ossimWmsStringListType theFormatTypes
Definition: ossimWms.h:69
bool contains(char aChar) const
Definition: ossimString.h:58
unsigned int ossim_uint32
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48

◆ getFormatTypes() [1/2]

ossimWmsStringListType& ossimWmsGetMap::getFormatTypes ( )
inline

Definition at line 29 of file ossimWms.h.

30  {
31  return theFormatTypes;
32  }
ossimWmsStringListType theFormatTypes
Definition: ossimWms.h:69

◆ getFormatTypes() [2/2]

const ossimWmsStringListType& ossimWmsGetMap::getFormatTypes ( ) const
inline

Definition at line 33 of file ossimWms.h.

34  {
35  return theFormatTypes;
36  }
ossimWmsStringListType theFormatTypes
Definition: ossimWms.h:69

◆ getPostUrl()

const ossimString& ossimWmsGetMap::getPostUrl ( ) const
inline

Definition at line 62 of file ossimWms.h.

63  {
64  return thePostUrl;
65  }
ossimString thePostUrl
Definition: ossimWms.h:68

◆ getUrl()

const ossimString& ossimWmsGetMap::getUrl ( ) const
inline

Definition at line 58 of file ossimWms.h.

59  {
60  return theUrl;
61  }
ossimString theUrl
Definition: ossimWms.h:67

◆ hasFormat()

bool ossimWmsGetMap::hasFormat ( const ossimString format,
bool  caseSensitive = true 
) const

Will do an exact compare on the input format.

You can also specify if you want case sensitive compares

Definition at line 66 of file ossimWms.cpp.

References ossimString::downcase(), and theFormatTypes.

67 {
68  if(theFormatTypes.empty()) return false;
69  ossimString tempFormat = format;
70  if(!caseSensitive) tempFormat = tempFormat.downcase();
71 
72  ossim_uint32 idx = 0;
73  for(idx = 0; idx < theFormatTypes.size();++idx)
74  {
75  ossimString temp = theFormatTypes[idx];
76  if(!caseSensitive)
77  {
78  temp = temp.downcase();
79  }
80  if(temp==tempFormat)
81  {
82  return true;
83  }
84  }
85 
86  return false;
87 }
ossimWmsStringListType theFormatTypes
Definition: ossimWms.h:69
unsigned int ossim_uint32
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48

◆ hasFormats()

bool ossimWmsGetMap::hasFormats ( ) const
inline

Definition at line 37 of file ossimWms.h.

38  {
39  return theFormatTypes.size() > 0;
40  }
ossimWmsStringListType theFormatTypes
Definition: ossimWms.h:69

◆ read()

bool ossimWmsGetMap::read ( ossimRefPtr< ossimXmlNode node)
virtual

Definition at line 10 of file ossimWms.cpp.

References clearFields(), ossim::convertHtmlSpecialCharactersToNormalCharacter(), ossimString::empty(), ossimXmlNode::findFirstNode(), ossimXmlNode::getAttributeValue(), ossimXmlNode::getChildNodes(), theFormatTypes, theUrl, ossimString::trim(), and ossimRefPtr< T >::valid().

Referenced by ossimWmsRequest::read().

11 {
12  clearFields();
13  const vector<ossimRefPtr<ossimXmlNode> >& childNodes = node->getChildNodes();
14  ossim_uint32 idx = 0;
15 
16  for(idx = 0; idx < childNodes.size();++idx)
17  {
18  if(childNodes[idx]->getTag() == "Format")
19  {
20  ossimString text = childNodes[idx]->getText();
21  text = text.trim();
22  if(!text.empty())
23  {
24  theFormatTypes.push_back(text);
25  }
26  else
27  {
28  const vector<ossimRefPtr<ossimXmlNode> >& childFormatNodes = childNodes[idx]->getChildNodes();
29  if(childFormatNodes.size())
30  {
31  ossim_uint32 childIdx = 0;
32  for(childIdx = 0; childIdx < childFormatNodes.size();++childIdx)
33  {
34  text = childFormatNodes[childIdx]->getTag();
35  text = text.trim();
36  if(!text.empty())
37  {
38  theFormatTypes.push_back(text);
39  }
40  }
41  }
42  }
43  }
44  else if(childNodes[idx]->getTag() == "DCPType")
45  {
46  ossimRefPtr<ossimXmlNode> node = childNodes[idx]->findFirstNode("HTTP/Get/OnlineResource");
47  if(node.valid())
48  {
49  node->getAttributeValue(theUrl, "xlink:href");
50  }
51  else
52  {
53  node = childNodes[idx]->findFirstNode("HTTP/Get");
54  if(node.valid())
55  {
56  node->getAttributeValue(theUrl, "onlineResource");
58  }
59  }
60  }
61  }
62 
63  return true;
64 }
ossimWmsStringListType theFormatTypes
Definition: ossimWms.h:69
bool valid() const
Definition: ossimRefPtr.h:75
const ossimXmlNode::ChildListType & getChildNodes() const
const ossimRefPtr< ossimXmlNode > & findFirstNode(const ossimString &rel_xpath) const
OSSIM_DLL std::string convertHtmlSpecialCharactersToNormalCharacter(const std::string &src)
bool getAttributeValue(ossimString &value, const ossimString &name) const
ossimString theUrl
Definition: ossimWms.h:67
unsigned int ossim_uint32
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
void clearFields()
Definition: ossimWms.h:52
bool empty() const
Definition: ossimString.h:411

Member Data Documentation

◆ theFormatTypes

ossimWmsStringListType ossimWmsGetMap::theFormatTypes
protected

Definition at line 69 of file ossimWms.h.

Referenced by containsFormat(), hasFormat(), and read().

◆ thePostUrl

ossimString ossimWmsGetMap::thePostUrl
protected

Definition at line 68 of file ossimWms.h.

◆ theUrl

ossimString ossimWmsGetMap::theUrl
protected

Definition at line 67 of file ossimWms.h.

Referenced by read().


The documentation for this class was generated from the following files: