nedutil.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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
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