SILICON
Loading...
Searching...
No Matches
projectSession.cpp
Go to the documentation of this file.
1#include "projectSession.hpp"
2
3#include <ranges>
4
5namespace SILICON::ui {
6
7std::optional<std::string>
8ProjectSession::firstCircuitPath(const std::string_view excludedPath) const
9{
10 const auto& documents = projectContext.documents().getDocuments();
11 const auto circuit = std::ranges::find_if(documents, [excludedPath](const auto& d) {
12 return d.getType() == SILICON::project::DocumentType::Circuit
13 && d.getPath() != excludedPath;
14 });
15 if (circuit == documents.end())
16 return std::nullopt;
17 return circuit->getPath();
18}
19
20} // namespace SILICON::ui
SILICON::project::ProjectContext projectContext
std::optional< std::string > firstCircuitPath(std::string_view excludedPath={}) const