1 // Copyright 2017 The Fuchsia 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 ZIRCON_SYSTEM_HOST_FIDL_INCLUDE_FIDL_SOURCE_MANAGER_H_ 6 #define ZIRCON_SYSTEM_HOST_FIDL_INCLUDE_FIDL_SOURCE_MANAGER_H_ 7 8 #include <memory> 9 #include <vector> 10 11 #include "fidl/source_file.h" 12 #include "string_view.h" 13 14 namespace fidl { 15 16 class SourceManager { 17 public: 18 // Returns whether the filename was successfully read. 19 bool CreateSource(StringView filename); 20 void AddSourceFile(std::unique_ptr<SourceFile> file); 21 sources()22 const std::vector<std::unique_ptr<SourceFile>>& sources() const { return sources_; } 23 24 private: 25 std::vector<std::unique_ptr<SourceFile>> sources_; 26 }; 27 28 } // namespace fidl 29 30 #endif // ZIRCON_SYSTEM_HOST_FIDL_INCLUDE_FIDL_SOURCE_MANAGER_H_ 31