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