nedutil.h

Go to the documentation of this file.
00001 //==========================================================================
00002 // nedutil.h - part of
00003 //
00004 //                     OMNeT++/OMNEST
00005 //            Discrete System Simulation in C++
00006 //
00007 // Contents:
00008 //   misc util functions
00009 //
00010 //==========================================================================
00011 
00012 /*--------------------------------------------------------------*
00013   Copyright (C) 2002-2008 Andras Varga
00014   Copyright (C) 2006-2008 OpenSim Ltd.
00015 
00016   This file is distributed WITHOUT ANY WARRANTY. See the file
00017   `license' for details on this and other legal matters.
00018 *--------------------------------------------------------------*/
00019 
00020 
00021 #ifndef __NEDUTIL_H
00022 #define __NEDUTIL_H
00023 
00024 #include <string>
00025 #include "nedelement.h"
00026 
00027 NAMESPACE_BEGIN
00028 
00029 //FIXME split to several files
00030 
00031 class DisplayString;
00032 class PropertyElement;
00033 class LiteralElement;
00034 
00038 class NEDXML_API DisplayStringUtil
00039 {
00040   private:
00041     static void parseDisplayString(const char *s, DisplayString& ds);
00042   public:
00043     static std::string upgradeBackgroundDisplayString(const char *s);
00044     static std::string upgradeSubmoduleDisplayString(const char *s);
00045     static std::string upgradeConnectionDisplayString(const char *s);
00046     static std::string toOldBackgroundDisplayString(const char *s);
00047     static std::string toOldSubmoduleDisplayString(const char *s);
00048     static std::string toOldConnectionDisplayString(const char *s);
00049 };
00050 
00051 class NEDXML_API NEDElementUtil
00052 {
00053   public:
00056     static const char *getLocalStringProperty(NEDElement *parent, const char *name);
00057     static bool getLocalBoolProperty(NEDElement *parent, const char *name);
00058     static PropertyElement *getLocalProperty(NEDElement *parent, const char *name);
00059     static LiteralElement *getTheOnlyValueFrom(PropertyElement *property);
00060     static bool propertyAsBool(PropertyElement *property);
00061     static const char *propertyAsString(PropertyElement *property);
00063 
00067     static int compare(NEDElement *node1, NEDElement *node2);
00069     static int compareTree(NEDElement *node1, NEDElement *node2);
00071 
00074     static bool isNEDType(NEDElement *node);
00076 };
00077 
00078 NAMESPACE_END
00079 
00080 
00081 #endif
00082 
Generated on Tue Dec 2 11:16:31 2014 for OMNeT++ NEDXML by  doxygen 1.6.3