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 
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 
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 
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
std::string GetFilenamePath(const std::string &filename) const
void SetPath(const std::string &path)
static WorkingDirectory * Instance()