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

Side by Side Diff: tools/gn/substitution_list.h

Issue 429423002: Refactor GN source expansions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clang warning Created 6 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 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef TOOLS_GN_SUBSTUTITION_LIST_H
6 #define TOOLS_GN_SUBSTUTITION_LIST_H
7
8 #include <string>
9 #include <vector>
10
11 #include "tools/gn/substitution_pattern.h"
12
13 // Represents a list of strings with {{substitution_patterns}} in them.
14 class SubstitutionList {
15 public:
16 SubstitutionList();
17 ~SubstitutionList();
18
19 bool Parse(const Value& value, Err* err);
20 bool Parse(const std::vector<std::string>& values,
21 const ParseNode* origin,
22 Err* err);
23
24 // Makes a SubstitutionList from the given hardcoded patterns.
25 static SubstitutionList MakeForTest(
scottmg 2014/08/05 22:30:32 Seems like this doesn't need to be in-class.
brettw 2014/08/06 18:25:01 No, but it seems like the best place for it to me,
26 const char* a,
27 const char* b = NULL,
28 const char* c = NULL);
29
30 const std::vector<SubstitutionPattern>& list() const { return list_; }
31
32 // Returns a list of all substitution types used by the patterns in thist
33 // list, with the exception of LITERAL.
34 const std::vector<SubstitutionType>& required_types() const {
35 return required_types_;
36 }
37
38 private:
39 void FillRequiredTypes();
40
41 std::vector<SubstitutionPattern> list_;
42
43 std::vector<SubstitutionType> required_types_;
44 };
45
46 #endif // TOOLS_GN_SUBSTUTITION_LIST_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698