[Release] wrt-installer_0.1.121
[platform/framework/web/wrt-installer.git] / src / misc / plugin_path.h
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 #ifndef PLUGIN_PATH_H
24 #define PLUGIN_PATH_H
25
26 #include <string>
27 #include <dpl/string.h>
28 #include <dpl/utils/path.h>
29
30 class PluginPath: public DPL::Utils::Path{
31 private:
32     std::string m_library;
33
34 public:
35     PluginPath(const DPL::Utils::Path& fullPath);
36     PluginPath(const std::string& fullPath);
37     PluginPath(const DPL::String& fullPath);
38     PluginPath();
39
40     //getMetafile() this function adds metafile to current path.
41     PluginPath getMetaFile() const;
42
43     //setLibraryCombinedName This function creates name for library by adding
44     //prefix and suffix to PluginPath object filename.
45     void setLibraryCombinedName(const std::string& prefix, const std::string& sufix)
46     {
47       this->m_library = prefix + this->Filename() + sufix;
48     }
49
50     //getLibraryName returns library name
51     const std::string& getLibraryName() const
52     {
53         return m_library;
54     }
55     //getLibraryPath returns full path to the library
56     const PluginPath getLibraryPath() const
57     {
58         return this->operator /(m_library);
59     }
60 };
61
62 #endif // PLUGIN_PATH_H