1 // Copyright 2015 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 #include "gn/lib_file.h" 6 7 #include "base/logging.h" 8 LibFile(const SourceFile & source_file)9LibFile::LibFile(const SourceFile& source_file) : source_file_(source_file) {} 10 LibFile(std::string_view lib_name)11LibFile::LibFile(std::string_view lib_name) 12 : name_(lib_name.data(), lib_name.size()) { 13 DCHECK(!lib_name.empty()); 14 } 15 value() const16const std::string& LibFile::value() const { 17 return is_source_file() ? source_file_.value() : name_; 18 } 19 source_file() const20const SourceFile& LibFile::source_file() const { 21 DCHECK(is_source_file()); 22 return source_file_; 23 } 24