OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | |
tfarina
2015/12/17 18:52:44
no (c)
agrieve
2015/12/17 19:33:34
Done.
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "tools/gn/lib_file.h" | |
6 | |
7 #include "base/logging.h" | |
8 | |
9 LibFile::LibFile() { | |
10 } | |
11 | |
12 LibFile::LibFile(const SourceFile& source_file) | |
13 : source_file_(source_file) { | |
14 } | |
15 | |
16 LibFile::LibFile(const base::StringPiece& lib_name) | |
17 : name_(lib_name.data(), lib_name.size()) { | |
18 DCHECK(!lib_name.empty()); | |
19 } | |
20 | |
21 void LibFile::swap(LibFile& other) { | |
22 name_.swap(other.name_); | |
23 source_file_.swap(other.source_file_); | |
24 } | |
25 | |
26 const std::string& LibFile::value() const { | |
27 return is_source_file() ? source_file_.value() : name_; | |
28 } | |
29 | |
30 const SourceFile& LibFile::source_file() const { | |
31 DCHECK(is_source_file()); | |
32 return source_file_; | |
33 } | |
OLD | NEW |