Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: visual_studio/NativeClientVSAddIn/NaCl.Build.CPPTasks/DependencyParser.cs

Issue 10831030: NaCl settings and completed install scripts. (Closed) Base URL: https://nativeclient-sdk.googlecode.com/svn/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5
6 using System.IO;
7
8 namespace NaCl.Build.CPPTasks
9 {
10 class DependencyParser
11 {
12 private static char[] elementEndings = new char[] { ' ', '\n', '\\' };
13 private List<string> m_dependencies;
14 public List<String> Dependencies
15 {
16 get
17 {
18 return m_dependencies;
19 }
20 }
21
22 public DependencyParser(string filename)
23 {
24 m_dependencies = new List<string>();
25
26 using (StreamReader reader = new StreamReader(filename, Encoding.ASC II))
27 {
28 while (!reader.EndOfStream)
29 {
30 string str = reader.ReadLine();
31 ParseLine(str);
32 }
33 reader.Close();
34 }
35 }
36
37 private void ParseLine(string line)
38 {
39 string[] paths = line.Split(elementEndings, StringSplitOptions.Remov eEmptyEntries);
40
41 foreach (string path in paths)
42 {
43 // ignore the source object file
44 // assumes .o file is only possible file ending with 'o'
45 if (path.ElementAt(path.Length - 1) != 'o' && path.ElementAt(pat h.Length - 1) != ':')
46 {
47 string newDependency = GCCUtilities.Convert_Path_Posix_To_Wi ndows(path);
48 m_dependencies.Add(newDependency);
49 }
50 }
51 }
52 }
53 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698