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

Side by Side Diff: tools/gn/source_file_type.cc

Issue 1933323002: GN: Add common header extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "tools/gn/source_file_type.h" 5 #include "tools/gn/source_file_type.h"
6 6
7 #include "tools/gn/filesystem_utils.h" 7 #include "tools/gn/filesystem_utils.h"
8 #include "tools/gn/source_file.h" 8 #include "tools/gn/source_file.h"
9 9
10 SourceFileType GetSourceFileType(const SourceFile& file) { 10 SourceFileType GetSourceFileType(const SourceFile& file) {
11 base::StringPiece extension = FindExtension(&file.value()); 11 base::StringPiece extension = FindExtension(&file.value());
12 if (extension == "cc" || extension == "cpp" || extension == "cxx") 12 if (extension == "cc" || extension == "cpp" || extension == "cxx")
13 return SOURCE_CPP; 13 return SOURCE_CPP;
14 if (extension == "h") 14 if (extension == "h" || extension == "hpp" || extension == "hxx" ||
15 extension == "hh")
15 return SOURCE_H; 16 return SOURCE_H;
16 if (extension == "c") 17 if (extension == "c")
17 return SOURCE_C; 18 return SOURCE_C;
18 if (extension == "m") 19 if (extension == "m")
19 return SOURCE_M; 20 return SOURCE_M;
20 if (extension == "mm") 21 if (extension == "mm")
21 return SOURCE_MM; 22 return SOURCE_MM;
22 if (extension == "rc") 23 if (extension == "rc")
23 return SOURCE_RC; 24 return SOURCE_RC;
24 if (extension == "S" || extension == "s" || extension == "asm") 25 if (extension == "S" || extension == "s" || extension == "asm")
25 return SOURCE_S; 26 return SOURCE_S;
26 if (extension == "o" || extension == "obj") 27 if (extension == "o" || extension == "obj")
27 return SOURCE_O; 28 return SOURCE_O;
28 if (extension == "def") 29 if (extension == "def")
29 return SOURCE_DEF; 30 return SOURCE_DEF;
30 31
31 return SOURCE_UNKNOWN; 32 return SOURCE_UNKNOWN;
32 } 33 }
33 34
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698