6a39fc4506f3608d1f95b910a8dea52332ff312d
[platform/core/appfw/aul-1.git] / aul / app_info / directory_info.hh
1 /*
2  * Copyright (c) 2021 Samsung Electronics Co., Ltd. All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 #ifndef AUL_APP_INFO_DIRECTORY_INFO_HH
19 #define AUL_APP_INFO_DIRECTORY_INFO_HH
20
21 #include <string>
22
23 namespace aul {
24
25 class DirectoryInfo {
26  public:
27   static DirectoryInfo* Get(const std::string app_id, uid_t uid);
28   static DirectoryInfo* Get();
29
30   const std::string& GetRootPath() const;
31   const std::string& GetDataPath() const;
32   const std::string& GetCachePath() const;
33   const std::string& GetResourcePath() const;
34   const std::string& GetTepResourcePath() const;
35   const std::string& GetSharedDataPath() const;
36   const std::string& GetSharedResourcePath() const;
37   const std::string& GetSharedTrustedPath() const;
38
39  private:
40   class Builder {
41    public:
42     Builder& SetRootPath(std::string root_path);
43     Builder& SetDataPath(std::string data_path);
44     Builder& SetCachePath(std::string cache_path);
45     Builder& SetResourcePath(std::string resource_path);
46     Builder& SetTepResourcePath(std::string tep_resource_path);
47     Builder& SetSharedDataPath(std::string shared_data_path);
48     Builder& SetSharedResourcePath(std::string shared_resource_path);
49     Builder& SetSharedTrustedPath(std::string shared_trusted_path);
50
51     operator DirectoryInfo*();
52
53    private:
54     std::string root_path_;
55     std::string rw_path_;
56     std::string data_path_;
57     std::string cache_path_;
58     std::string resource_path_;
59     std::string tep_resource_path_;
60     std::string shared_data_path_;
61     std::string shared_resource_path_;
62     std::string shared_trusted_path_;
63   };
64
65   DirectoryInfo(std::string root_path,
66       std::string data_path,
67       std::string cache_path,
68       std::string resource_path,
69       std::string tep_resource_path,
70       std::string shared_data_path,
71       std::string shared_resource_path,
72       std::string shared_trusted_path);
73
74  private:
75   std::string root_path_;
76   std::string data_path_;
77   std::string cache_path_;
78   std::string resource_path_;
79   std::string tep_resource_path_;
80   std::string shared_data_path_;
81   std::string shared_resource_path_;
82   std::string shared_trusted_path_;
83 };
84
85 }  // namespace aul
86
87 #endif  // AUL_APP_INFO_DIRECTORY_INFO_HH