neddtdvalidatorbase.h

Go to the documentation of this file.
00001 //==========================================================================
00002 // neddtdvalidatorbase.h -
00003 //
00004 //                     OMNeT++/OMNEST
00005 //            Discrete System Simulation in C++
00006 //
00007 //==========================================================================
00008 
00009 /*--------------------------------------------------------------*
00010   Copyright (C) 2002-2008 Andras Varga
00011   Copyright (C) 2006-2008 OpenSim Ltd.
00012 
00013   This file is distributed WITHOUT ANY WARRANTY. See the file
00014   `license' for details on this and other legal matters.
00015 *--------------------------------------------------------------*/
00016 
00017 
00018 #ifndef __NEDDTDVALIDATORBASE_H
00019 #define __NEDDTDVALIDATORBASE_H
00020 
00021 #include "nedvalidator.h"
00022 
00023 NAMESPACE_BEGIN
00024 
00030 class NEDXML_API NEDDTDValidatorBase : public NEDValidatorBase
00031 {
00032   protected:
00033     struct Choice {
00034         int tags[20]; // array terminated by NED_NULL (increase size if needed)
00035         char mult;
00036     };
00037 
00038     // helper function
00039     void tryCheckChoice(NEDElement *node, NEDElement *&curchild, int tags[], char mult);
00040 
00043     void checkSequence(NEDElement *node, int tags[], char mult[]);
00044     void checkChoice(NEDElement *node, int tags[], char mult);
00045     void checkSeqOfChoices(NEDElement *node, Choice choices[], int n);
00046     void checkEmpty(NEDElement *node);
00047     void checkRequiredAttribute(NEDElement *node, const char *attr);
00048     void checkEnumeratedAttribute(NEDElement *node, const char *attr, const char *vals[], int n);
00049     void checkNameAttribute(NEDElement *node, const char *attr);
00050     void checkCommentAttribute(NEDElement *node, const char *attr);
00052   public:
00053     NEDDTDValidatorBase(NEDErrorStore *e) : NEDValidatorBase(e) {}
00054 };
00055 
00056 NAMESPACE_END
00057 
00058 
00059 #endif
00060 
Generated on Tue Dec 2 11:16:31 2014 for OMNeT++ NEDXML by  doxygen 1.6.3