OMNeT++ NEDXML 6.1
Discrete Event Simulation Library
opp_msgtool.h
Go to the documentation of this file.
1 //=========================================================================
2 // OPP_MSGTOOL.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_MSGTOOL_H
16 #define __OMNETPP_NEDXML_MSGTOOL_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 MsgFileElement;
27 
31 class MsgTool
32 {
33  protected:
34  bool opt_verbose = false;
35  protected:
36  // utility methods
37  std::vector<std::string> expandMsgFolder(const char *fname);
38  std::vector<std::string> expandFileArg(const char *arg);
39  bool fileLooksLikeXml(const char *filename);
40  MsgFileElement *parseMsgFile(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 generateMsgFile(const char *filename, MsgFileElement *tree);
45  void generateMsgFiles(FilesElement *tree);
46  void generateXmlFile(const char *filename, ASTNode *tree, bool srcloc);
47  void generateDependencies(const char *depsfile, const char *msgfile, const char *hfile, const char *ccfile, const std::set<std::string>& dependencies, bool wantPhonytargets);
48  void renameFileToBak(const char *fname);
49 
50  // commands
51  void helpCommand(int argc, char **argv);
52  void printHelpPage(const std::string& page);
53  void convertCommand(int argc, char **argv);
54  void prettyprintCommand(int argc, char **argv);
55  void validateCommand(int argc, char **argv);
56  void generateCppCommand(int argc, char **argv);
57  public:
58  int main(int argc, char **argv);
59 };
60 
61 } // namespace nedxml
62 } // namespace omnetpp
63 
64 #endif
omnetpp::nedxml::MsgTool::prettyprintCommand
void prettyprintCommand(int argc, char **argv)
omnetpp::nedxml::MsgTool::expandMsgFolder
std::vector< std::string > expandMsgFolder(const char *fname)
omnetpp::nedxml::MsgTool::helpCommand
void helpCommand(int argc, char **argv)
omnetpp::nedxml::MsgTool::generateMsgFiles
void generateMsgFiles(FilesElement *tree)
omnetpp::nedxml::MsgTool::main
int main(int argc, char **argv)
omnetpp::nedxml::MsgTool::convertCommand
void convertCommand(int argc, char **argv)
omnetpp::nedxml::MsgTool::parseXmlFile
ASTNode * parseXmlFile(const char *filename)
omnetpp::nedxml::MsgTool::generateXmlFile
void generateXmlFile(const char *filename, ASTNode *tree, bool srcloc)
omnetpp::nedxml::MsgTool::opt_verbose
bool opt_verbose
Definition: opp_msgtool.h:34
omnetpp
Definition: astbuilder.h:25
omnetpp::nedxml::MsgTool::validateCommand
void validateCommand(int argc, char **argv)
omnetpp::nedxml::MsgTool::renameFileToBak
void renameFileToBak(const char *fname)
omnetpp::nedxml::MsgTool::expandFileArg
std::vector< std::string > expandFileArg(const char *arg)
omnetpp::nedxml::ASTNode
Definition: astnode.h:87
omnetpp::nedxml::MsgTool::generateMsgFile
void generateMsgFile(const char *filename, MsgFileElement *tree)
omnetpp::nedxml::MsgTool::generateDependencies
void generateDependencies(const char *depsfile, const char *msgfile, const char *hfile, const char *ccfile, const std::set< std::string > &dependencies, bool wantPhonytargets)
omnetpp::nedxml::MsgTool::wrapIntoFilesElement
FilesElement * wrapIntoFilesElement(ASTNode *tree)
omnetpp::nedxml::MsgTool
Definition: opp_msgtool.h:31
omnetpp::nedxml::MsgTool::printHelpPage
void printHelpPage(const std::string &page)
omnetpp::nedxml::MsgTool::fileLooksLikeXml
bool fileLooksLikeXml(const char *filename)
omnetpp::nedxml::MsgTool::generateCppCommand
void generateCppCommand(int argc, char **argv)
nedxmldefs.h
omnetpp::nedxml::MsgTool::parseMsgFile
MsgFileElement * parseMsgFile(const char *fname, bool opt_storesrc)
omnetpp::nedxml::MsgTool::moveChildren
void moveChildren(ASTNode *source, ASTNode *target)