nedutil.h Source File

NEDXML API: nedutil.h Source File
NEDXML API
nedutil.h
1//==========================================================================
2// nedutil.h - part of
3//
4// OMNeT++/OMNEST
5// Discrete System Simulation in C++
6//
7// Contents:
8// misc util functions
9//
10//==========================================================================
11
12/*--------------------------------------------------------------*
13 Copyright (C) 2002-2017 Andras Varga
14 Copyright (C) 2006-2017 OpenSim Ltd.
15
16 This file is distributed WITHOUT ANY WARRANTY. See the file
17 `license' for details on this and other legal matters.
18*--------------------------------------------------------------*/
19
20
21#ifndef __OMNETPP_NEDXML_NEDUTIL_H
22#define __OMNETPP_NEDXML_NEDUTIL_H
23
24#include <string>
25#include "astnode.h"
26
27namespace omnetpp {
28namespace nedxml {
29
30class PropertyElement;
31class LiteralElement;
32
38class NEDXML_API ASTNodeUtil
39{
40 public:
43 static const char *getLocalStringProperty(ASTNode *parent, const char *name);
44 static bool getLocalBoolProperty(ASTNode *parent, const char *name);
45 static PropertyElement *getLocalProperty(ASTNode *parent, const char *name);
46 static LiteralElement *getTheOnlyValueFrom(PropertyElement *property);
47 static bool propertyAsBool(PropertyElement *property);
48 static const char *propertyAsString(PropertyElement *property);
50
53
54 static int compare(ASTNode *node1, ASTNode *node2);
56 static int compareTree(ASTNode *node1, ASTNode *node2);
58};
59
60} // namespace nedxml
61} // namespace omnetpp
62
63
64#endif
65
Various utilities for the ASTNode tree.
Definition nedutil.h:39
static int compare(ASTNode *node1, ASTNode *node2)
static int compareTree(ASTNode *node1, ASTNode *node2)
Definition astnode.h:88