OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimKeyword.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: David Burken
6 //
7 // Description:
8 //
9 // Contains class definition for Keyword.h
10 //*******************************************************************
11 // $Id: ossimKeyword.cpp 9963 2006-11-28 21:11:01Z gpotts $
12 
13 #include <iostream>
15 
17  :
18  theKey(""),
19  theDesc(""),
20  theValue("")
21 {}
22 
23 ossimKeyword::ossimKeyword(const char* key, const char* description)
24  :
25  theKey(key),
26  theDesc(description),
27  theValue("")
28 {}
29 
31  const char* description,
32  const char* value)
33  :
34  theKey(key),
35  theDesc(description),
36  theValue(value)
37 {}
38 
40  :
41  theKey(src.key()),
42  theDesc(src.description()),
43  theValue(src.value())
44 {}
45 
47 {}
48 
49 ossimKeyword::operator const char*() const
50 {
51  return theKey.c_str();
52 }
53 
54 const char* ossimKeyword::key() const
55 {
56  return theKey.c_str();
57 }
58 
59 const char* ossimKeyword::description() const
60 {
61  return theDesc.c_str();
62 }
63 
64 const char* ossimKeyword::value() const
65 {
66  return theValue.c_str();
67 }
68 
70 {
71  return theKey;
72 }
73 
75 {
76  return theDesc;
77 }
78 
80 {
81  return theValue;
82 }
83 
84 void ossimKeyword::setValue(const char* val)
85 {
86  theValue = val;
87 }
88 
90 {
91  theValue = val;
92 }
93 
94 void ossimKeyword::setDescription(const char* desc)
95 {
96  theDesc = desc;
97 }
98 
100 {
101  theDesc = desc;
102 }
103 
105 {
106  if (this != &kw)
107  {
108  theKey = kw.key();
109  theDesc = kw.description();
110  theValue = kw.value();
111  }
112 
113  return *this;
114 }
115 
117 {
118  os << "\n key = " << kw.key()
119  << "\n desc = " << kw.description()
120  << "\n value = " << kw.value()
121  << std::endl;
122  return os;
123 }
ossimString theKey
Definition: ossimKeyword.h:45
const char * description() const
ossimString valueString() const
const char * value() const
void setValue(const char *val)
void setDescription(const char *desc)
ossimString theValue
Definition: ossimKeyword.h:47
ossimString keyString() const
std::ostream & operator<<(std::ostream &os, const ossimKeyword &kw)
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
ossimString theDesc
Definition: ossimKeyword.h:46
const ossimKeyword & operator=(const ossimKeyword &kw)
ossimString descriptionString() const
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
const char * key() const