dmpapplication.h
1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**************************************************************************
* file: dmpapplication.h
* Author: wanzhongping
* Date: 2021-02-20 15:55:28
* Email: zhongpingw@chinadci.com
* copyright: 广州城市信息研究所有限公司
***************************************************************************/
#ifndef __dmpapplication_h__
#define __dmpapplication_h__
#include "dmap_core.h"
#include <boost/filesystem.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string/trim_all.hpp>
#include <string>
class CORE_EXPORT DmpApplication
{
public:
~DmpApplication();
static DmpApplication& Instance();
static void Init();
static bool CreateDatabase();
static std::string ResolvePkgPath();
static std::string ApplicationDirPath();
static bool SearchFile(const boost::filesystem::path &dir, const std::string file_name, boost::filesystem::path &path);
static bool IsRunningFromBuildDir();
static std::string DMapSettingsDirPath();
static std::string prefix_path();
static void set_prefix_path(const std::string &prefix_path);
static void set_plugin_path(const std::string &plugin_path);
static void set_pkg_data_path( const std::string &pkg_data_path);
static std::string libexec_path();
static std::string plugin_path();
static std::string pkg_data_path();
static std::string library_path();
static std::string build_output_path();
private:
DmpApplication();
static std::string prefix_path_;
static std::string libexec_path_;
static std::string library_path_;
static std::string plugin_path_;
static std::string build_source_path_;
static std::string build_output_path_;
static std::string pkg_data_path_;
static bool running_from_build_dir_;
static bool initialized_;
};
#endif //__dmpapplication_h__