2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 * @file InstallerUtil.h
19 * @brief This is the header file for the %InstallerUtil class.
21 * This header file contains the declarations of the %InstallerUtil class.
23 #ifndef _INSTALLER_UTIL_H_
24 #define _INSTALLER_UTIL_H_
26 #include <FAppTypes.h>
28 namespace Tizen { namespace Base
33 namespace Tizen { namespace Base { namespace Collection
39 * @class InstallerUtil
40 * @brief This class represents the class of InstallerUtil.
43 * This class represents the class of InstallerUtil.
50 virtual ~InstallerUtil(void);
52 static bool Remove(const Tizen::Base::String& filePath);
53 static bool Copy(const Tizen::Base::String& srcFilePath, const Tizen::Base::String& destFilePath);
54 static bool CopyDirectory(const Tizen::Base::String& srcFilePath, const Tizen::Base::String& destFilePath);
55 static bool IsSymlink(const Tizen::Base::String& filePath);
56 static bool GetRealPath(const Tizen::Base::String& filePath, Tizen::Base::String& realPath);
58 static bool CreateSymlink(const Tizen::Base::String& oldPath, const Tizen::Base::String& newPath);
59 static bool ChangeMode(const Tizen::Base::String& filePath, int mode);
60 static bool ChangeOwner(const Tizen::Base::String& filePath);
61 static bool ChangeDirectoryPermission(const Tizen::Base::String& filePath, int mode, bool appOwner);
63 static bool IsDrmFile(const Tizen::Base::String& path);
64 static bool DecryptPackage(const Tizen::Base::String& packagePath);
66 static Tizen::Base::String GetCategory(int categoryType);
67 static int GetCategoryType(char* pCategory);
69 static bool CreateSymlinkForAppDirectory(const Tizen::Base::String& inPath, Tizen::Base::String& outPath);
70 static bool CreateInfoFile(const Tizen::Base::String& filePath, const Tizen::Base::String* pContext);
72 static bool DumpLog(const char* pBuf);
73 static bool DumpLogData(char *pData, int dataLen);
75 static bool CreateLog(const Tizen::Base::String& logFile);
76 static bool AppendLog(const char* pFunction, int lineNumber, bool fatal, const char* pFormat, ...);
77 static bool PrintLog(const Tizen::Base::String& logFile);
78 static bool GetRdsList(const Tizen::App::PackageId& packageId,
79 Tizen::Base::Collection::IList* pDeletedList,
80 Tizen::Base::Collection::IList* pAddedList,
81 Tizen::Base::Collection::IList* pModifiedList);
83 static const char* GetInstallerOperationString(int operation);
86 static char LogChangeHexToStr(int hex);
87 InstallerUtil(const InstallerUtil& value);
88 InstallerUtil& operator =(const InstallerUtil& source);
94 #endif // _INSTALLER_UTIL_H_