DeltaQt  Version 0.2.0 End user documentation
A C++/Qt library for parsing DELTA (DEscription Language for TAxonomy) files
F:/Code/DeltaQt/DeltaQt/deltavaluerange.h
Go to the documentation of this file.
00001 /*  Copyright 2012 Craig Robbins
00002 
00003     This file is part of DeltaQt.
00004 
00005     DeltaQt is free software: you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation, either version 3 of the License, or
00008     (at your option) any later version.
00009 
00010     DeltaQt is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with DeltaQt.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 
00019 #ifndef DELTAVALUERANGE_H
00020 #define DELTAVALUERANGE_H
00021 
00022 #include <QVariant>
00023 #include <QList>
00024 #include <QString>
00025 #include "annotatedvalue.h"
00026 #include "delimitedbuffer.h"
00027 
00028 
00029 class DeltaValueRange
00030 {
00031 public:
00032     DeltaValueRange();
00033 
00034     bool isValid(void) const;
00035     void clear(void);
00036 
00037     bool init(const QString& buff);
00038 
00039     QList<AnnotatedValue> getExpandedValueList(void) const;
00040     QList<int> getExpandedIntList(void) const;
00041 
00042     QString toDeltaString(void) const;
00043 
00044     inline int normalValueCount(void) const { return m_normalValues.count(); }
00045 
00046 protected:
00047     bool setPlacemarker(const QString& chunk);
00048     bool parseRangeChunk(const DelimitedBuffer& chunk,
00049                          const QString& comment);
00050     bool parseCompactedChunk(const DelimitedBuffer& chunk,
00051                              const QString& comment);
00052     bool parseChunkPart(const QString& chunk, const QString& comment);
00053     bool parseExtremePart(const QString& chunk, const QString& comment);
00054 private:
00055     bool m_isInitialised;
00056 
00057     AnnotatedValue m_rangeExtremeLow;
00058     AnnotatedValue m_rangeExtremeHigh;
00059     QList<AnnotatedValue> m_normalValues;
00060 
00061     char m_placemarker;
00062 };
00063 
00064 
00065 #endif // DELTAVALUERANGE_H
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines