DeltaQt  Version 0.2.0 End user documentation
A C++/Qt library for parsing DELTA (DEscription Language for TAxonomy) files
F:/Code/DeltaQt/DeltaQt/deltadirectives.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 DELTADIRECTIVES_H
00020 #define DELTADIRECTIVES_H
00021 
00022 #include <QString>
00023 
00024 class DeltaDirectives
00025 {
00026 public:
00027     typedef enum
00028     {
00029         SHOW,
00030         CHARLIST,
00031         CHARTYPES,
00032         CHARNOTES,
00033         CHARIMAGES,
00034         ITEMDESCS,
00035         TAXONIMAGES,
00036         IMPLICITVALUES,
00037         DEPENDENTCHARS,
00038         MANDATORYCHARS,
00039         COMMENT,
00040 
00041         PSEUDO_UNKNOWN,         // Not a Delta Directive (used internally)
00042         PSEUDO_NONE             // Not a Delta Directive (used internally)
00043     } DirectiveId;
00044 
00045     /* Bitwise enum */
00046     typedef enum
00047     {
00049         IsDeltaStd2005          =   1,
00050 
00051         // Implemented by CSIRO DELTA suite of programs as of 2011
00052         IsCSIRODeltaImplemented =   2,
00053 
00054         // Implemented/recognised by this implementation and parsed
00055         IsParsed                =   4,
00056 
00057         // Recognised by this implementation stored only (not parsed)
00058         IsStoredOnly            =   8,
00059 
00060         /* The "directive" is used within this implementation only.
00061          * E.g. it is an ID used for parsing, error checking, etc
00062          */
00063         IsInteralUseOnly        =   16
00064     } Flags;
00065 
00066     typedef struct
00067     {
00068         DirectiveId id;
00069         QString controlPhrase;
00070         unsigned flags;
00071     } Def;
00072 
00073     DeltaDirectives();
00074 
00075     static QString abbrevName(void);
00076 
00077     static unsigned count(void);
00078 
00079     static bool isKnown(const Def* directive);
00080     static bool isKnown(QString str);
00081     static bool isPsuedoDirective(const Def* directive);
00082 
00083     static const Def* def(DirectiveId id);
00084     static const Def* def(QString str);
00085 
00086     static const Def* pseudoDef(DirectiveId id);
00087 
00088 private:
00089     static const DeltaDirectives::Def m_directives[];
00090     static const DeltaDirectives::Def m_pseudoDirectives[];
00091 
00092 };
00093 
00094 #endif // DELTADIRECTIVES_H
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines