Flutter Impeller
working_directory.h
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 #ifndef FLUTTER_IMPELLER_GOLDEN_TESTS_WORKING_DIRECTORY_H_
6 #define FLUTTER_IMPELLER_GOLDEN_TESTS_WORKING_DIRECTORY_H_
7 
8 #include <string>
9 
10 #include "flutter/fml/macros.h"
11 
12 namespace impeller {
13 namespace testing {
14 
15 /// Keeps track of the global variable for the specified working
16 /// directory.
18  public:
19  static WorkingDirectory* Instance();
20 
21  std::string GetFilenamePath(const std::string& filename) const;
22 
23  void SetPath(const std::string& path);
24 
25  const std::string& GetPath() const { return path_; }
26 
27  private:
28  WorkingDirectory(const WorkingDirectory&) = delete;
29 
30  WorkingDirectory& operator=(const WorkingDirectory&) = delete;
32  static WorkingDirectory* instance_;
33  std::string path_;
34  bool did_set_ = false;
35 };
36 
37 } // namespace testing
38 } // namespace impeller
39 
40 #endif // FLUTTER_IMPELLER_GOLDEN_TESTS_WORKING_DIRECTORY_H_
impeller::testing::WorkingDirectory::SetPath
void SetPath(const std::string &path)
Definition: working_directory.cc:28
impeller::testing::WorkingDirectory::GetPath
const std::string & GetPath() const
Definition: working_directory.h:25
impeller::testing::WorkingDirectory
Definition: working_directory.h:17
impeller::testing::WorkingDirectory::GetFilenamePath
std::string GetFilenamePath(const std::string &filename) const
Definition: working_directory.cc:23
impeller::testing::WorkingDirectory::Instance
static WorkingDirectory * Instance()
Definition: working_directory.cc:16
impeller
Definition: aiks_blur_unittests.cc:20