Applied latest source code
[apps/native/preloaded/Installer.git] / InstallerService / src / InstallerServiceEntry.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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 /**
18  * This file contains the Tizen C++ application entry point.
19  */
20
21 #include "InstallerService.h"
22
23 using namespace Tizen::Base;
24 using namespace Tizen::Base::Collection;
25
26 #ifdef __cplusplus
27 extern "C"
28 {
29 #endif // __cplusplus
30
31 _EXPORT_ int
32 OspMain(int argc, char* pArgv[])
33 {
34         AppLog("Application started.");
35         ArrayList args(SingleObjectDeleter);
36         args.Construct();
37         for (int i = 0; i < argc; i++)
38         {
39                 args.Add(new (std::nothrow) String(pArgv[i]));
40         }
41
42         result r = Tizen::App::ServiceApp::Execute(InstallerServiceApp::CreateInstance, &args);
43         AppLogExceptionIf(IsFailed(r), "[%s] Application execution failed", GetErrorMessage(r));
44         AppLog("Application finished.");
45
46         return static_cast<int>(r);
47 }
48 #ifdef __cplusplus
49 }
50 #endif // __cplusplus