OMNeT++ NEDXML 6.1
Discrete Event Simulation Library
opp_nedtool.h
Go to the documentation of this file.
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 
21 namespace omnetpp {
22 namespace nedxml {
23 
24 class ASTNode;
25 class FilesElement;
26 class NedFileElement;
27 
31 class NedTool
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
omnetpp::nedxml::NedTool::prettyprintCommand
void prettyprintCommand(int argc, char **argv)
omnetpp::nedxml::NedTool::helpCommand
void helpCommand(int argc, char **argv)
omnetpp::nedxml::NedTool::generateNedFiles
void generateNedFiles(FilesElement *tree)
omnetpp::nedxml::NedTool::convertCommand
void convertCommand(int argc, char **argv)
omnetpp::nedxml::NedTool::expandNedFolder
std::vector< std::string > expandNedFolder(const char *fname)
omnetpp::nedxml::NedTool::parseXmlFile
ASTNode * parseXmlFile(const char *filename)
omnetpp::nedxml::NedTool::main
int main(int argc, char **argv)
omnetpp::nedxml::NedTool::generateXmlFile
void generateXmlFile(const char *filename, ASTNode *tree, bool srcloc)
omnetpp
Definition: astbuilder.h:25
omnetpp::nedxml::NedTool::validateCommand
void validateCommand(int argc, char **argv)
omnetpp::nedxml::NedTool::renameFileToBak
void renameFileToBak(const char *fname)
omnetpp::nedxml::NedTool::opt_verbose
bool opt_verbose
Definition: opp_nedtool.h:34
omnetpp::nedxml::NedTool::generateNedFile
void generateNedFile(const char *filename, NedFileElement *tree)
omnetpp::nedxml::NedTool::expandFileArg
std::vector< std::string > expandFileArg(const char *arg)
omnetpp::nedxml::NedTool::wrapIntoFilesElement
FilesElement * wrapIntoFilesElement(ASTNode *tree)
omnetpp::nedxml::ASTNode
Definition: astnode.h:87
omnetpp::nedxml::NedTool
Definition: opp_nedtool.h:31
omnetpp::nedxml::NedTool::printHelpPage
void printHelpPage(const std::string &page)
omnetpp::nedxml::NedTool::fileLooksLikeXml
bool fileLooksLikeXml(const char *filename)
nedxmldefs.h
omnetpp::nedxml::NedTool::moveChildren
void moveChildren(ASTNode *source, ASTNode *target)
omnetpp::nedxml::NedTool::generateCppCommand
void generateCppCommand(int argc, char **argv)
omnetpp::nedxml::NedTool::parseNedFile
NedFileElement * parseNedFile(const char *fname, bool opt_storesrc)