[RTL]
[reactos.git] / reactos / tools / sysgen / RosFramework / Collections / RBuildSourceFileCollection.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4
5 namespace SysGen.RBuild.Framework
6 {
7 public class SourceCodePreferenceComparer : IComparer<RBuildSourceFile>
8 {
9 public int Compare(RBuildSourceFile x, RBuildSourceFile y)
10 {
11 if (x.First != y.First)
12 {
13 if (x.First)
14 return -1;
15 else
16 return 1;
17 }
18
19 if (x.Extension == y.Extension)
20 return 0;
21
22 if (x.IsWidl)
23 return -1;
24 else if (y.IsWidl)
25 return 1;
26
27 if (x.IsAssembler)
28 return 1;
29 else if (y.IsAssembler)
30 return -1;
31
32 if (x.IsNASM)
33 return 1;
34 else if (y.IsNASM)
35 return -1;
36
37 return 0;
38 }
39 }
40
41 public class RBuildSourceFileCollection : List<RBuildSourceFile>
42 {
43 public bool ContainsASM
44 {
45 get
46 {
47 foreach (RBuildSourceFile file in this)
48 {
49 if ((file.IsAssembler) || (file.IsNASM))
50 {
51 return true;
52 }
53 }
54
55 // This module does not contain C++ code
56 return false;
57 }
58 }
59 }
60 }