USGS

Isis 3.0 Object Programmers' Reference

Home

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 }