46 PvlConstraints::PvlConstraints() {
55 PvlConstraints::PvlConstraints(
const QString &keyListFile) {
97 PvlConstraints::~PvlConstraints() {
108 int PvlConstraints::excludeSize()
const {
109 return (m_excludes.size());
120 int PvlConstraints::includeSize()
const {
121 return (m_includes.size());
134 int PvlConstraints::keyListSize()
const {
135 return (m_keylist.size());
151 void PvlConstraints::addExclude(
const QString &name) {
152 m_excludes.append(name);
167 void PvlConstraints::addInclude(
const QString &name) {
168 m_includes.append(name);
180 void PvlConstraints::addKeyToList(
const QString &name) {
181 m_keylist.append(name);
220 void PvlConstraints::addKeyToList(
const FileName &fileName) {
221 readKeyListFile(fileName);
236 bool PvlConstraints::isExcluded(
const QString &name)
const {
237 return (m_excludes.contains(name, Qt::CaseInsensitive));
251 bool PvlConstraints::isIncluded(
const QString &name)
const {
252 return (m_includes.contains(name, Qt::CaseInsensitive));
265 bool PvlConstraints::isKeyInList(
const QString &name)
const {
266 return (m_keylist.contains(name, Qt::CaseInsensitive));
321 void PvlConstraints::readKeyListFile(
const FileName &keyListFile) {
348 TextFile keyList(keyListFile.expanded());
349 QString keywordName =
"";
350 while (keyList.GetLine(keywordName)) {
351 addKeyToList(keywordName);
454 return (contains(key.toLower()));
488 const int index)
const {
506 const QString &value) {
518 insert(key.
name().toLower(), key);
532 const QString &value) {
550 for (
int i = 0; i < key.
size(); i++) {
551 kw.value().addValue(key[i]);
558 for (
int i = 1; i < key.
size(); i++) {
575 return (
bool (
remove(key.toLower())));
594 const int &index)
const {
597 QString mess =
"Keyword " + key +
" does not exist!";
600 if (index >= k.value().size()) {
601 QString mess =
"Index " +
toString(index) +
" does not exist for keyword " + key +
"!";
605 return (k.value()[index]);
622 const QString &defValue,
623 const int &index)
const {
625 if (end() == k || index >= k.value().size()) {
629 return (k.value()[index]);
680 QString mess =
"Keyword " + key +
" does not exist!";
700 while ( keys != other.end() ) {
721 for (
int i = 0 ; i < keyword.
size() ; i++) {
722 values << keyword[i];
754 bool isExcluded = constraints.
isExcluded(
object.name());
755 bool isIncluded = constraints.
isIncluded(
object.name());
767 else if ( isExcluded ) {
782 PvlObject::ConstPvlObjectIterator objs;
783 for (objs =
object.beginObject() ; objs !=
object.endObject() ; ++objs) {
810 PvlObject::ConstPvlGroupIterator group;
811 for (group =
object.beginGroup() ; group !=
object.endGroup() ; group++) {
853 else if ( isExcluded ) {
897 for (key = pvl.
begin() ; key != pvl.
end() ; ++key) {
906 for (key = pvl.
begin() ; key != pvl.
end() ; ++key) {