Isis 3 Programmer Reference
PvlSequence.cpp
Go to the documentation of this file.
1 
24 #include <sstream>
25 
26 #include <QString>
27 
28 #include "PvlSequence.h"
29 #include "Pvl.h"
30 #include "IString.h"
31 
32 namespace Isis {
42  for(int i = 0; i < key.size(); i++) {
43  this->operator+=(key[i]);
44  }
45  return *this;
46  }
47 
55  PvlSequence &PvlSequence::operator+=(const QString &array) {
56  std::stringstream str;
57  str << "temp = " << array;
58  Pvl pvl;
59  str >> pvl;
60  PvlKeyword &key = pvl["temp"];
61  std::vector<QString> temp;
62  for(int i = 0; i < key.size(); i++) {
63  temp.push_back(key[i]);
64  }
65  p_sequence.push_back(temp);
66  return *this;
67  }
68 
75  PvlSequence &PvlSequence::operator+=(std::vector<QString> &array) {
76  std::vector<QString> temp;
77  for(int i = 0; i < (int)array.size(); i++) {
78  temp.push_back(array[i]);
79  }
80  p_sequence.push_back(temp);
81  return *this;
82  }
83 
90  PvlSequence &PvlSequence::operator+=(std::vector<int> &array) {
91  std::vector<QString> temp;
92  for(int i = 0; i < (int)array.size(); i++) {
93  temp.push_back(toString(array[i]));
94  }
95  p_sequence.push_back(temp);
96  return *this;
97  }
98 
105  PvlSequence &PvlSequence::operator+=(std::vector<double> &array) {
106  std::vector<QString> temp;
107  for(int i = 0; i < (int)array.size(); i++) {
108  temp.push_back(toString(array[i]));
109  }
110  p_sequence.push_back(temp);
111  return *this;
112  }
113 }
Parse and return elements of a Pvl sequence.
Definition: PvlSequence.h:64
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:226
PvlSequence & operator=(PvlKeyword &key)
Load a sequence using a Pvl keyword.
Definition: PvlSequence.cpp:41
int size() const
Returns the number of values stored in this keyword.
Definition: PvlKeyword.h:141
A single keyword-value pair.
Definition: PvlKeyword.h:98
Container for cube-like labels.
Definition: Pvl.h:135
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
std::vector< std::vector< QString > > p_sequence
A vector of Strings that contains the values for the keyword.
Definition: PvlSequence.h:95
PvlSequence & operator+=(const QString &array)
Add a string array to the sequence.
Definition: PvlSequence.cpp:55