| Flutter Impeller |

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
5 #include "impeller/golden_tests/working_directory.h"
6
7 #include "flutter/fml/paths.h"
8
9 namespace impeller {
10 namespace testing {
11
12 WorkingDirectory* WorkingDirectory::instance_ = nullptr;
13
14 WorkingDirectory::WorkingDirectory() {}
15
16 WorkingDirectory* WorkingDirectory::Instance() {
17 if (!instance_) {
18 instance_ = new WorkingDirectory();
19 }
20 return instance_;
21 }
22
23 std::string WorkingDirectory::GetFilenamePath(
24 const std::string& filename) const {
25 return fml::paths::JoinPaths({path_, filename});
26 }
27
28 void 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
impeller::testing::WorkingDirectory
Definition: working_directory.h:15
impeller::testing::WorkingDirectory::GetFilenamePath
std::string GetFilenamePath(const std::string &filename) const
Definition: working_directory.cc:23
impeller::testing::WorkingDirectory::SetPath
void SetPath(const std::string &path)
Definition: working_directory.cc:28
impeller::testing::WorkingDirectory::Instance
static WorkingDirectory * Instance()
Definition: working_directory.cc:16
impeller
Definition: allocation.cc:12
working_directory.h