Remove boost dependency
[platform/core/appfw/app-installers.git] / src / pkg_initdb / option_checker.h
1 // Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by an apache-2.0 license that can be
3 // found in the LICENSE file.
4
5 #ifndef PKG_INITDB_OPTION_CHECKER_H_
6 #define PKG_INITDB_OPTION_CHECKER_H_
7
8 #include <string>
9 #include <iostream>
10 #include <vector>
11
12 class OptionChecker {
13  public:
14   OptionChecker() :
15       partial_rw_(false),
16       ro_only_(false), rw_only_(false), keep_db_(false),
17       recover_db_(false), uid_(-1) {}
18
19   bool Init(int argc, char* argv[]);
20
21   bool GetKeepDb();
22   bool IsGlobal();
23   bool IsRWOnly();
24   bool IsROOnly();
25   bool IsPartialRW();
26   uid_t GetUid();
27   std::vector<std::string> GetParams(
28       bool is_preload, const std::string& pkgid);
29
30  private:
31   bool ValidateOptions();
32
33   bool partial_rw_;
34   bool ro_only_;
35   bool rw_only_;
36   bool keep_db_;
37   bool recover_db_;
38   uid_t uid_;
39 };
40
41 #endif  // PKG_INITDB_OPTION_CHECKER_H_