parse, but ignore, <? ?> tags - eliminated duplicate code ala FixSeparator() - fix...
[reactos.git] / reactos / tools / rbuild / rbuild.h
1 #ifndef __RBUILD_H
2 #define __RBUILD_H
3
4 #include "pch.h"
5
6 #include "ssprintf.h"
7 #include "exception.h"
8 #include "XML.h"
9
10 #ifdef WIN32
11 #define EXEPOSTFIX ".exe"
12 #define CSEP '\\'
13 #define CBAD_SEP '/'
14 #define SSEP "\\"
15 #define SBAD_SEP "/"
16 #else
17 #define EXEPOSTFIX
18 #define CSEP '/'
19 #define CBAD_SEP '\\'
20 #define SSEP "/"
21 #define SBAD_SEP "\\"
22 #endif
23
24 class Project;
25 class Module;
26 class File;
27 class Library;
28
29 class Project
30 {
31 public:
32 std::string name;
33 std::string makefile;
34 std::vector<Module*> modules;
35
36 Project ();
37 Project ( const std::string& filename );
38 ~Project ();
39 void ProcessXML ( const XMLElement& e,
40 const std::string& path );
41 Module* LocateModule ( std::string name );
42 private:
43 void ReadXml ();
44 XMLFile xmlfile;
45 XMLElement* head;
46 };
47
48
49 enum ModuleType
50 {
51 BuildTool,
52 StaticLibrary,
53 KernelModeDLL
54 };
55
56 class Module
57 {
58 public:
59 Project* project;
60 const XMLElement& node;
61 std::string name;
62 std::string path;
63 ModuleType type;
64 std::vector<File*> files;
65 std::vector<Library*> libraries;
66
67 Module ( Project* project,
68 const XMLElement& moduleNode,
69 const std::string& moduleName,
70 const std::string& modulePath );
71 ~Module();
72 ModuleType GetModuleType (const XMLAttribute& attribute );
73 std::string GetPath ();
74 void ProcessXML ( const XMLElement& e, const std::string& path );
75 };
76
77
78 class File
79 {
80 public:
81 std::string name;
82
83 File ( const std::string& _name );
84 };
85
86
87 class Library
88 {
89 public:
90 std::string name;
91
92 Library ( const std::string& _name );
93 };
94
95 extern std::string
96 FixSeparator ( const std::string& s );
97
98 #endif /* __RBUILD_H */