opp_nedtool.h Source File

NEDXML API: opp_nedtool.h Source File
NEDXML API
opp_nedtool.h
1//=========================================================================
2// OPP_NEDTOOL.H - part of
3// OMNeT++/OMNEST
4// Discrete System Simulation in C++
5//
6//=========================================================================
7
8/*--------------------------------------------------------------*
9 Copyright (C) 2006-2019 OpenSim Ltd.
10
11 This file is distributed WITHOUT ANY WARRANTY. See the file
12 `license' for details on this and other legal matters.
13*--------------------------------------------------------------*/
14
15#ifndef __OMNETPP_NEDXML_NEDTOOL_H
16#define __OMNETPP_NEDXML_NEDTOOL_H
17
18#include <string>
19#include "nedxmldefs.h"
20
21namespace omnetpp {
22namespace nedxml {
23
24class ASTNode;
25class FilesElement;
26class NedFileElement;
27
32{
33 protected:
34 bool opt_verbose = false;
35 protected:
36 // utility methods
37 std::vector<std::string> expandNedFolder(const char *fname);
38 std::vector<std::string> expandFileArg(const char *arg);
39 bool fileLooksLikeXml(const char *filename);
40 NedFileElement *parseNedFile(const char *fname, bool opt_storesrc);
41 ASTNode *parseXmlFile(const char *filename);
42 FilesElement *wrapIntoFilesElement(ASTNode *tree);
43 void moveChildren(ASTNode *source, ASTNode *target);
44 void generateNedFile(const char *filename, NedFileElement *tree);
45 void generateNedFiles(FilesElement *tree);
46 void generateXmlFile(const char *filename, ASTNode *tree, bool srcloc);
47 void renameFileToBak(const char *fname);
48
49 // commands
50 void helpCommand(int argc, char **argv);
51 void printHelpPage(const std::string& page);
52 void convertCommand(int argc, char **argv);
53 void prettyprintCommand(int argc, char **argv);
54 void validateCommand(int argc, char **argv);
55 void generateCppCommand(int argc, char **argv);
56 public:
57 int main(int argc, char **argv);
58};
59
60} // namespace nedxml
61} // namespace omnetpp
62
63#endif
Definition astnode.h:88
Definition opp_nedtool.h:32