MinitScript  0.9.31 PRE-BETA
Generator.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <utility>
5 #include <vector>
6 
9 
10 using std::pair;
11 using std::string;
12 using std::vector;
13 
14 /**
15  * MinitScript generator
16  * @author Andreas Drewke
17  */
19 public:
20 
21  /**
22  * Generate main CPP file
23  * @param scriptURI script URI
24  * @param className script class name
25  * @param mainURI main C++ file URI
26  * @param useLibrary use library
27  * @param nativeOnly native only
28  */
29  static void generateMain(
30  const string& scriptURI,
31  const string& className,
32  const string& mainURI,
33  bool useLibrary,
34  bool nativeOnly
35  );
36 
37  /**
38  * Generate library CPP file
39  * @param scriptClassPairs script class pairs
40  * @param libraryURI library URI
41  * @param nativeOnly native only
42  */
43  static void generateLibrary(
44  const vector<pair<string, string>>& scriptClassPairs,
45  const string& libraryURI,
46  bool nativeOnly
47  );
48 
49  /**
50  * Generate Makefile
51  * @param srcPath source path
52  * @param makefileURI makefile URI
53  * @param library library
54  * @param basePath base path
55  * @param excludePaths exclude paths
56  */
57  static void generateMakefile(const string& srcPath, const string& makefileURI, bool library, const string& basePath = string(), const vector<string>& excludePaths = {});
58 
59  /**
60  * Generate NMakefile
61  * @param srcPath source path
62  * @param makefileURI makefile URI
63  * @param library library
64  * @param basePath base path
65  * @param excludePaths exclude paths
66  */
67  static void generateNMakefile(const string& srcPath, const string& makefileURI, bool library, const string& basePath = string(), const vector<string>& excludePaths = {});
68 
69 private:
70 
71  /**
72  * Scan path
73  * @param path path
74  * @param sourceFiles source files
75  * @param mainSourceFiles main source files
76  */
77  static void scanPath(const string& path, vector<string>& sourceFiles, vector<string>& mainSourceFiles);
78 
79 };
MinitScript generator.
Definition: Generator.h:18
static void generateLibrary(const vector< pair< string, string >> &scriptClassPairs, const string &libraryURI, bool nativeOnly)
Generate library CPP file.
Definition: Generator.cpp:55
static void generateNMakefile(const string &srcPath, const string &makefileURI, bool library, const string &basePath=string(), const vector< string > &excludePaths={})
Generate NMakefile.
Definition: Generator.cpp:140
static void generateMakefile(const string &srcPath, const string &makefileURI, bool library, const string &basePath=string(), const vector< string > &excludePaths={})
Generate Makefile.
Definition: Generator.cpp:85
static void scanPath(const string &path, vector< string > &sourceFiles, vector< string > &mainSourceFiles)
Scan path.
Definition: Generator.cpp:223
static void generateMain(const string &scriptURI, const string &className, const string &mainURI, bool useLibrary, bool nativeOnly)
Generate main CPP file.
Definition: Generator.cpp:26