Log -> SecureLog
[apps/native/sample/ImageFeatureManager.git] / project / src / ImageFeatureAppEntry.cpp
1 //
2 // Tizen C++ SDK
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.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
8 //
9 //     http://www.tizenopensource.org/license
10 //
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.
16 //
17
18 /**
19  * This file contains the Tizen application entry point.
20  */
21 #include "ImageFeatureApp.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 OspMain(int argc, char *pArgv[]);
32
33 /**
34  * The entry function of Tizen application called by the operating system.
35  */
36 int
37 OspMain(int argc, char *pArgv[])
38 {
39     result r = E_SUCCESS;
40
41     AppSecureLog("Application started.");
42     ArrayList* pArgs = new ArrayList();
43     pArgs->Construct();
44     for (int i = 0; i < argc; i++)
45     {
46         pArgs->Add(*(new String(pArgv[i])));
47     }
48
49     r = Tizen::App::UiApp::Execute(ImageFeatureApp::CreateInstance, pArgs);
50     if (IsFailed(r))
51     {
52         AppSecureLogException("Application execution failed-[%s].", GetErrorMessage(r));
53         r &= 0x0000FFFF;
54     }
55
56     pArgs->RemoveAll(true);
57     delete pArgs;
58     AppSecureLog("Application finished.");
59
60     return static_cast<int>(r);
61 }
62 #ifdef __cplusplus
63 }
64 #endif // __cplusplus