Tizen 2.4.0 rev3 SDK Public Release
[framework/web/wrt-installer.git] / src / misc / plugin_path.cpp
1 /*
2  * Copyright (c) 2013 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  * @file    plugin_path_builder.cpp
18  * @author  Kamil Nować (k.nowac@partner.samgsung.com)
19  * @version
20  * @brief
21  */
22
23 #include <plugin_path.h>
24 #include <dpl/wrt-dao-ro/global_config.h>
25 #include <dlfcn.h>
26
27 using namespace DPL::Utils;
28
29 PluginPath::PluginPath(const Path& fullPath) : Path(fullPath.Fullpath())
30 {
31     setLibraryCombinedName(
32             WrtDB::GlobalConfig::GetPluginPrefix(),
33             WrtDB::GlobalConfig::GetPluginSuffix());
34 };
35 PluginPath::PluginPath(const std::string& fullPath) : Path(fullPath)
36 {
37     setLibraryCombinedName(
38             WrtDB::GlobalConfig::GetPluginPrefix(),
39             WrtDB::GlobalConfig::GetPluginSuffix());
40 };
41 PluginPath::PluginPath(const DPL::String& fullPath) : Path(fullPath)
42 {
43     setLibraryCombinedName(
44             WrtDB::GlobalConfig::GetPluginPrefix(),
45             WrtDB::GlobalConfig::GetPluginSuffix());
46 };
47 PluginPath::PluginPath(){}
48
49 PluginPath PluginPath::getMetaFile() const
50 {
51     PluginPath metaFile = *this;
52     return metaFile /= WrtDB::GlobalConfig::GetPluginMetafileName();
53 }