Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
working_directory.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter 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
6
7#include "flutter/fml/paths.h"
8
9namespace impeller {
10namespace testing {
11
12WorkingDirectory* WorkingDirectory::instance_ = nullptr;
13
14WorkingDirectory::WorkingDirectory() {}
15
17 if (!instance_) {
18 instance_ = new WorkingDirectory();
19 }
20 return instance_;
21}
22
24 const std::string& filename) const {
25 return fml::paths::JoinPaths({path_, filename});
26}
27
28void WorkingDirectory::SetPath(const std::string& path) {
29 FML_CHECK(did_set_ == false);
30 path_ = path;
31 did_set_ = true;
32}
33
34} // namespace testing
35} // namespace impeller
std::string GetFilenamePath(const std::string &filename) const
void SetPath(const std::string &path)
static WorkingDirectory * Instance()
#define FML_CHECK(condition)
Definition logging.h:85
std::string JoinPaths(std::initializer_list< std::string > components)
Definition paths.cc:14