| OLD | NEW |
| 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 #ifndef TOOLS_GN_LABEL_PATTERN_H_ | 5 #ifndef TOOLS_GN_LABEL_PATTERN_H_ |
| 6 #define TOOLS_GN_LABEL_PATTERN_H_ | 6 #define TOOLS_GN_LABEL_PATTERN_H_ |
| 7 | 7 |
| 8 #include "base/strings/string_piece.h" | 8 #include "base/strings/string_piece.h" |
| 9 #include "tools/gn/label.h" | 9 #include "tools/gn/label.h" |
| 10 #include "tools/gn/source_dir.h" | 10 #include "tools/gn/source_dir.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 DIRECTORY, // Only targets in the file in the given directory. | 24 DIRECTORY, // Only targets in the file in the given directory. |
| 25 RECURSIVE_DIRECTORY // The given directory and any subdir. | 25 RECURSIVE_DIRECTORY // The given directory and any subdir. |
| 26 // (also indicates "public" when dir is empty). | 26 // (also indicates "public" when dir is empty). |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 LabelPattern(); | 29 LabelPattern(); |
| 30 LabelPattern(Type type, | 30 LabelPattern(Type type, |
| 31 const SourceDir& dir, | 31 const SourceDir& dir, |
| 32 const base::StringPiece& name, | 32 const base::StringPiece& name, |
| 33 const Label& toolchain_label); | 33 const Label& toolchain_label); |
| 34 LabelPattern(const LabelPattern& other); |
| 34 ~LabelPattern(); | 35 ~LabelPattern(); |
| 35 | 36 |
| 36 // Converts the given input string to a pattern. This does special stuff | 37 // Converts the given input string to a pattern. This does special stuff |
| 37 // to treat the pattern as a label. Sets the error on failure. | 38 // to treat the pattern as a label. Sets the error on failure. |
| 38 static LabelPattern GetPattern(const SourceDir& current_dir, | 39 static LabelPattern GetPattern(const SourceDir& current_dir, |
| 39 const Value& value, | 40 const Value& value, |
| 40 Err* err); | 41 Err* err); |
| 41 | 42 |
| 42 // Returns true if the given input string might match more than one thing. | 43 // Returns true if the given input string might match more than one thing. |
| 43 static bool HasWildcard(const std::string& str); | 44 static bool HasWildcard(const std::string& str); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 66 // Used when type_ == PRIVATE and PRIVATE_RECURSIVE. This specifies the | 67 // Used when type_ == PRIVATE and PRIVATE_RECURSIVE. This specifies the |
| 67 // directory that to which the pattern is private to. | 68 // directory that to which the pattern is private to. |
| 68 SourceDir dir_; | 69 SourceDir dir_; |
| 69 | 70 |
| 70 // Empty name means match everything. Otherwise the name must match | 71 // Empty name means match everything. Otherwise the name must match |
| 71 // exactly. | 72 // exactly. |
| 72 std::string name_; | 73 std::string name_; |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 #endif // TOOLS_GN_LABEL_PATTERN_H_ | 76 #endif // TOOLS_GN_LABEL_PATTERN_H_ |
| OLD | NEW |