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

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

Issue 21114002: Add initial prototype for the GN meta-buildsystem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add owners and readme Created 7 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
« no previous file with comments | « tools/gn/operators.cc ('k') | tools/gn/output_stream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 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_OUTPUT_FILE_H_
6 #define TOOLS_GN_OUTPUT_FILE_H_
7
8 #include <string>
9
10 #include "tools/gn/build_settings.h"
11 #include "tools/gn/source_file.h"
12
13 // A simple wrapper around a string that indicates the string is a path
14 // relative to the output directory.
15 class OutputFile {
16 public:
17 OutputFile() : value_() {}
18 explicit OutputFile(const base::StringPiece& str)
19 : value_(str.data(), str.size()) {
20 }
21
22 std::string& value() { return value_; }
23 const std::string& value() const { return value_; }
24
25 // Converts to a SourceFile by prepending the build directory to the file.
26 SourceFile GetSourceFile(const BuildSettings* build_settings) const {
27 return SourceFile(build_settings->build_dir().value() + value_);
28 }
29
30 bool operator==(const OutputFile& other) const {
31 return value_ == other.value_;
32 }
33 bool operator!=(const OutputFile& other) const {
34 return value_ != other.value_;
35 }
36
37 private:
38 std::string value_;
39 };
40
41 #endif
OLDNEW
« no previous file with comments | « tools/gn/operators.cc ('k') | tools/gn/output_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698