| 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 namespace impeller {
11 namespace testing {
12
13 /// Keeps track of the global variable for the specified working
14 /// directory.
15 class WorkingDirectory {
16 public:
17 static WorkingDirectory* Instance();
18
19 std::string GetFilenamePath(const std::string& filename) const;
20
21 void SetPath(const std::string& path);
22
23 const std::string& GetPath() const { return path_; }
24
25 private:
26 WorkingDirectory(const WorkingDirectory&) = delete;
27
28 WorkingDirectory& operator=(const WorkingDirectory&) = delete;
29 WorkingDirectory();
30 static WorkingDirectory* instance_;
31 std::string path_;
32 bool did_set_ = false;
33 };
34
35 } // namespace testing
36 } // namespace impeller
37
38 #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:23
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::Instance
static WorkingDirectory * Instance()
Definition: working_directory.cc:16
impeller
Definition: aiks_blend_unittests.cc:18