1 #ifndef CubeAttribute_h
2 #define CubeAttribute_h
29 #include <QStringList>
73 QString msg =
"Invalid label attachment type [" + QString(labelType) +
"]";
87 QString temp = labelType.toUpper();
92 QString msg =
"Invalid label attachment type string [" + labelType +
"]";
194 QString upcaseAtt = attribute.toUpper();
196 if (attribute.contains(
"+")) {
198 "Individual attributes (for example, BSQ) cannot contain the '+' "
199 "character because that is used to denote the separation of individual "
206 bool (ChildClass::*tester)(QString)
const;
208 if ( (static_cast<const ChildClass *>(
this)->*tester)(upcaseAtt) ) {
211 QObject::tr(
"Attribute [%1] is ambiguous").arg(attribute),
221 QObject::tr(
"Attribute [%1] is not recognized").arg(attribute),
278 QStringList attributes = fileName.attributes().split(
"+", QString::SkipEmptyParts);
281 foreach (QString attribute, attributes)
299 QString upcaseAtt = attribute.toUpper();
300 if ( (static_cast<const ChildClass *>(
this)->*tester)(upcaseAtt) ) {
301 relevantAttributes.append(upcaseAtt);
305 return relevantAttributes;
320 void setAttribute(QString newValue,
bool (ChildClass::*tester)(QString)
const) {
324 while (it.hasNext()) {
325 QString &attribute = it.next();
327 QString upcaseAtt = attribute.toUpper();
328 if ( (static_cast<const ChildClass *>(
this)->*tester)(upcaseAtt) ) {
329 if (found || newValue ==
"") {
335 attribute = newValue;
343 if (!found && newValue !=
"") {
419 std::vector<QString>
bands()
const;
435 void setBands(
const std::vector<QString> &bands);
440 bool isBandRange(QString attribute)
const;
442 static QString
toString(
const std::vector<QString> &bands);
561 bool isByteOrder(QString attribute)
const;
562 bool isFileFormat(QString attribute)
const;
563 bool isLabelAttachment(QString attribute)
const;
564 bool isPixelType(QString attribute)
const;
565 bool isRange(QString attribute)
const;