Index: tools/gn/lib_file.cc |
diff --git a/tools/gn/lib_file.cc b/tools/gn/lib_file.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..86db0f2e40ca091f4ac4dff0d581eb8e7522d13c |
--- /dev/null |
+++ b/tools/gn/lib_file.cc |
@@ -0,0 +1,33 @@ |
+// 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.
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "tools/gn/lib_file.h" |
+ |
+#include "base/logging.h" |
+ |
+LibFile::LibFile() { |
+} |
+ |
+LibFile::LibFile(const SourceFile& source_file) |
+ : source_file_(source_file) { |
+} |
+ |
+LibFile::LibFile(const base::StringPiece& lib_name) |
+ : name_(lib_name.data(), lib_name.size()) { |
+ DCHECK(!lib_name.empty()); |
+} |
+ |
+void LibFile::swap(LibFile& other) { |
+ name_.swap(other.name_); |
+ source_file_.swap(other.source_file_); |
+} |
+ |
+const std::string& LibFile::value() const { |
+ return is_source_file() ? source_file_.value() : name_; |
+} |
+ |
+const SourceFile& LibFile::source_file() const { |
+ DCHECK(is_source_file()); |
+ return source_file_; |
+} |