55cfd8a9a9ae3817decfee9a71ab4d9aaf6ab07f
[iec.git] / src / type3_AndroidCloud / anbox-master / src / anbox / application / launcher_storage.h
1 /*
2  * Copyright (C) 2016 Simon Fels <morphis@gravedo.de>
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 3, as published
6  * by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranties of
10  * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11  * PURPOSE.  See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along
14  * with this program.  If not, see <http://www.gnu.org/licenses/>.
15  *
16  */
17
18 #ifndef ANBOX_APPLICATION_LAUNCHER_STORAGE_H_
19 #define ANBOX_APPLICATION_LAUNCHER_STORAGE_H_
20
21 #include "anbox/application/database.h"
22 #include "anbox/android/intent.h"
23
24 #include <string>
25 #include <vector>
26
27 #include <boost/filesystem.hpp>
28 #include <boost/algorithm/string/predicate.hpp>
29
30 namespace anbox {
31 namespace application {
32 class LauncherStorage {
33  public:
34   LauncherStorage(const boost::filesystem::path &path);
35   ~LauncherStorage();
36
37   void reset();
38   void add_or_update(const Database::Item &item);
39   void remove(const Database::Item &item);
40
41  private:
42   std::string clean_package_name(const std::string &package_name);
43   boost::filesystem::path path_for_item(const std::string &package_name);
44   boost::filesystem::path path_for_item_icon(const std::string &package_name);
45
46   boost::filesystem::path path_;
47 };
48 }  // namespace application
49 }  // namespace anbox
50
51 #endif