DeltaQt  Version 0.2.0 End user documentation
A C++/Qt library for parsing DELTA (DEscription Language for TAxonomy) files
F:/Code/DeltaQt/DeltaQt/deltaitem.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 DELTAITEM_H
00020 #define DELTAITEM_H
00021 
00022 #include <QString>
00023 #include <QList>
00024 #include "deltaattribute.h"
00025 
00026 class DeltaItem
00027 {
00028     friend class DeltaParserPhase2;
00029 
00030 public:
00031     DeltaItem();
00032     DeltaItem(const QString& name);
00033 
00034     inline const DeltaAttributeList* attrList(void) const
00035         { return &m_attributes; }
00036 
00037     QString name(void) const;
00038     QString comment(void) const;
00039 
00040     void addAttribute(const DeltaAttribute& attr);
00041     void setName(const QString& name);
00042     void setComment(const QString& comment);
00043 
00044     QString toDeltaString(int maxAttrPerLine = -1,
00045                           int maxLineLen = 76,
00046                           int indentLen = 0
00047                           ) const;
00048 
00049 protected:
00050     DeltaAttributeList* getAttrListNotConst(void);
00051 private:
00052     QString m_name;
00053     QString m_comment;
00054     DeltaAttributeList m_attributes;
00055 };
00056 
00057 typedef QList<DeltaItem> DeltaItemList;
00058 
00059 #endif // DELTAITEM_H
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines