*
* @{
*/
+
#if (defined(_APP_LOG) || defined(_OSP_DEBUG_) || defined(_DEBUG)) && defined(_SECURE_LOG)
#define AppSecureLog(...) AppLogInternal(__PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
+#define AppSecureLogDebug(...) AppLogDebugInternal(__PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
#define AppSecureLogException(...) AppLogExceptionInternal(__PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
#define AppSecureLogTag(tag, ...) AppLogTagInternal(tag, __PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
+#define AppSecureLogDebugTag(tag, ...) AppLogDebugTagInternal(tag, __PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
#define AppSecureLogExceptionTag(tag, ...) AppLogExceptionTagInternal(tag, __PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
#else
/**
-* This macro is to protect informative log messages which needs to keep security.
-* It allows display of informative log messages if compiled with "_SECURE_LOG" definition.
-* Otherwise, it will be removed in the compile time.
-*
-* @since 2.1
-*
-* @param[in] ... The message to display
-*
-* The following example demonstrates how to use the AppSecureLog macro.
-*
-* @code
-* bool
-* MyEngine::Init(int value)
-* {
-* AppSecureLog("User ID : 'JoneDoe'");
-*
-* return true;
-* }
-* @endcode
-* @hideinitializer
-*/
+ * This macro is to protect informative log messages which needs to keep security.
+ * It allows display of informative log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, it will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in] ... The message to display
+ *
+ * The following example demonstrates how to use the AppSecureLog macro.
+ *
+ * @code
+ * bool
+ * MyEngine::Init(int value)
+ * {
+ * AppSecureLog("User ID : 'JoneDoe'");
+ *
+ * return true;
+ * }
+ * @endcode
+ * @hideinitializer
+ */
#define AppSecureLog(...)
/**
-* This macro is to protect exception log messages which needs to keep security.
-* It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
-* Otherwise, it will be removed in the compile time.
-*
-* @since 2.1
-*
-* @param[in] ... The message to display
-*
-* The following example demonstrates how to use the AppSecureLogException macro.
-*
-* @code
-* bool
-* MyEngine::Init(int value)
-* {
-* //...
-* if (something_wrong)
-* {
-* AppSecureLogException("User ID : 'JoneDoe' mismatch.");
-*
-* return false;
-* }
-* //...
-*
-* return true;
-* }
-* @endcode
-* @hideinitializer
-*/
+ * This macro is to protect debug log messages which needs to keep security.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, it will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in] ... The message to display
+ *
+ * The following example demonstrates how to use the AppSecureLogDebug macro.
+ *
+ * @code
+ * bool
+ * MyEngine::Init(int value)
+ * {
+ * //...
+ * if (something_wrong)
+ * {
+ * AppSecureLogDebug("User ID : 'JoneDoe' mismatch.");
+ *
+ * return false;
+ * }
+ * //...
+ *
+ * return true;
+ * }
+ * @endcode
+ * @hideinitializer
+ */
+#define AppSecureLogDebug(...)
+
+/**
+ * This macro is to protect exception log messages which needs to keep security.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, it will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in] ... The message to display
+ *
+ * The following example demonstrates how to use the AppSecureLogException macro.
+ *
+ * @code
+ * bool
+ * MyEngine::Init(int value)
+ * {
+ * //...
+ * if (something_wrong)
+ * {
+ * AppSecureLogException("User ID : 'JoneDoe' mismatch.");
+ *
+ * return false;
+ * }
+ * //...
+ *
+ * return true;
+ * }
+ * @endcode
+ * @hideinitializer
+ */
#define AppSecureLogException(...)
/**
-* This macro is to protect informative log messages which needs to keep security, with a tag.
-* It allows display of informative log messages if compiled with "_SECURE_LOG" definition.
-* Otherwise, it will be removed in the compile time.
-*
-* @since 2.1
-*
-* @param[in] tag The user defined tag
-* @param[in] ... The message to display
-*
-* The following example demonstrates how to use the AppSecureLogTag macro.
-*
-* @code
-* bool
-* MyEngine::Init(int value)
-* {
-* AppSecureLogTag("MyTag", "User ID : 'JoneDoe'");
-*
-* return true;
-* }
-* @endcode
-* @hideinitializer
-*/
+ * This macro is to protect informative log messages which needs to keep security, with a tag.
+ * It allows display of informative log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, it will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in] tag The user defined tag
+ * @param[in] ... The message to display
+ *
+ * The following example demonstrates how to use the AppSecureLogTag macro.
+ *
+ * @code
+ * bool
+ * MyEngine::Init(int value)
+ * {
+ * AppSecureLogTag("MyTag", "User ID : 'JoneDoe'");
+ *
+ * return true;
+ * }
+ * @endcode
+ * @hideinitializer
+ */
#define AppSecureLogTag(tag, ...)
/**
-* This macro is to protect exception log messages which needs to keep security, with a tag.
-* It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
-* Otherwise, it will be removed in the compile time.
-*
-* @since 2.1
-*
-* @param[in] tag The user defined tag
-* @param[in] ... The message to display
-*
-* The following example demonstrates how to use the AppSecureLogExceptionTag macro.
-*
-* @code
-* bool
-* MyEngine::Init(int value)
-* {
-* AppSecureLogExceptionTag("MyTag", "User ID : 'JoneDoe' mismatch.");
-*
-* return true;
-* }
-* @endcode
-* @hideinitializer
-*/
+ * This macro is to protect debug log messages which needs to keep security, with a tag.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, it will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in] tag The user defined tag
+ * @param[in] ... The message to display
+ *
+ * The following example demonstrates how to use the AppSecureLogDebugTag macro.
+ *
+ * @code
+ * bool
+ * MyEngine::Init(int value)
+ * {
+ * AppSecureLogDebugTag("MyTag", "User ID : 'JoneDoe' mismatch.");
+ *
+ * return true;
+ * }
+ * @endcode
+ * @hideinitializer
+ */
+#define AppSecureLogDebugTag(tag, ...)
+
+/**
+ * This macro is to protect exception log messages which needs to keep security, with a tag.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, it will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in] tag The user defined tag
+ * @param[in] ... The message to display
+ *
+ * The following example demonstrates how to use the AppSecureLogExceptionTag macro.
+ *
+ * @code
+ * bool
+ * MyEngine::Init(int value)
+ * {
+ * AppSecureLogExceptionTag("MyTag", "User ID : 'JoneDoe' mismatch.");
+ *
+ * return true;
+ * }
+ * @endcode
+ * @hideinitializer
+ */
#define AppSecureLogExceptionTag(tag, ...)
#endif
+
+/**
+ * If the condition is @c false, it prints a message, evaluates a cleanup expression,
+ * and goes to <tt>CATCH</tt>.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] expr Expressions that are evaluated before going to CATCH label
+ * @param[in] ... The message to display
+ *
+ * The following example demonstrates how to use the SecureTry macro.
+ *
+ * @code
+ * result
+ * MyClass::DoSomething(const String* passwd)
+ * {
+ * result r = E_SUCCESS;
+ *
+ * // Do something...
+ *
+ * // If password is wrong, print "[E_INVALID_ARG] The password '1234' is wrong." to the console
+ * // execute the expression "r = E_INVALID_ARG", and move to CATCH
+ * SecureTryCatch(*passwd != refPasswd, r = E_INVALID_ARG, "[E_INVALID_ARG] The password '%ls' is wrong.", passwd->GetPointer());
+ *
+ * SetLastResult(E_SUCCESS);
+ *
+ * return E_SUCCESS;// execute the expression "r = E_INVALID_ARG", and move to CATCH
+ *
+ * CATCH:
+ * SetLastResult(r);
+ * // Do something
+ *
+ * return r;
+ * }
+ * @endcode
+ * @hideinitializer
+ */
+#define SecureTryCatch(condition, expr, ...) \
+ if (!(condition)) { \
+ AppSecureLogException(__VA_ARGS__); \
+ expr; \
+ goto CATCH; \
+ } \
+ else {;}
+
+/**
+ * If the condition is @c false, it prints a message, sets the last result, evaluates a cleanup expression
+ * and goes to <tt>CATCH</tt>.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] expr Expressions that are evaluated before going to CATCH label
+ * @param[in] r The last result to set
+ * @param[in] ... The message to display
+ * @hideinitializer
+ */
+#define SecureTryCatchResult(condition, expr, r, ...) \
+ if (!(condition)) { \
+ SetLastResult(r); \
+ AppSecureLogException(__VA_ARGS__); \
+ expr; \
+ goto CATCH; \
+ } \
+ else {;}
+
+/**
+ * If the condition is @c false, it prints a message, sets the last result, evaluates a cleanup expression
+ * and goes to label.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] expr Expressions that are evaluated before going to catchLabel
+ * @param[in] catchLabel The label for goto operation
+ * @param[in] r The last result to set
+ * @param[in] ... The message to display
+ * @hideinitializer
+ */
+#define SecureTryCatchLabelResult(condition, expr, catchLabel, r, ...) \
+ if (!(condition)) { \
+ SetLastResult(r); \
+ AppSecureLogException(__VA_ARGS__); \
+ expr; \
+ goto catchLabel; \
+ } \
+ else {;}
+
+/**
+ * If the condition is @c false, the message is printed and a value is returned.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] returnValue The value to return when the condition is @c false
+ * @param[in] ... The message to display
+ * @hideinitializer
+ */
+#define SecureTryReturn(condition, returnValue, ...) \
+ if (!(condition)) { \
+ AppSecureLogException(__VA_ARGS__); \
+ return returnValue; \
+ } \
+ else {;}
+
+/**
+ * If the condition is @c false, the message is printed, sets the last result and a value is returned.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] returnValue The value to return when the condition is @c false
+ * @param[in] r The last result to set
+ * @param[in] ... The message to display
+ * @hideinitializer
+ */
+#define SecureTryReturnResult(condition, returnValue, r, ...) \
+ if (!(condition)) { \
+ SetLastResult(r); \
+ AppSecureLogException(__VA_ARGS__); \
+ return returnValue; \
+ } \
+ else {;}
+
+/**
+ * If the condition is @c false, the message is printed, sets the last result and no value is returned.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] r The last result to set
+ * @param[in] ... The message to display
+ * @hideinitializer
+ */
+#define SecureTryReturnVoidResult(condition, r, ...) \
+ if (!(condition)) { \
+ SetLastResult(r); \
+ AppSecureLogException(__VA_ARGS__); \
+ return; \
+ } \
+ else {;}
+
+/**
+ * If the condition is @c false, the message is printed and no value is returned.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] ... The message to display
+ * @hideinitializer
+ */
+#define SecureTryReturnVoid(condition, ...) \
+ if (!(condition)) { \
+ AppSecureLogException(__VA_ARGS__); \
+ return; \
+ } \
+ else {;}
+
+/**
+ * If the condition is @c false, the message is printed.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] ... The message to display
+ * @hideinitializer
+ */
+#define SecureTryLog(condition, ...) \
+ if (!(condition)) { \
+ AppSecureLog(__VA_ARGS__); \
+ } \
+ else {;}
+
+/**
+ * If the condition is @c false, the informative log message is printed and a value is returned.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] returnValue The value to return when the condition is @c false
+ * @param[in] ... The message to display
+ * @hideinitializer
+ */
+#define SecureTryLogReturn(condition, returnValue, ...) \
+ if (!(condition)) { \
+ AppSecureLog(__VA_ARGS__); \
+ return returnValue; \
+ } \
+ else {;}
+
+// SecureTryTag Macros
+
+/**
+ * If the condition is @c false, it prints a message with a tag, evaluates a cleanup expression
+ * and goes to <tt>CATCH</tt>.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in] tag Used to identify the source of a log message
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] expr Expressions that are evaluated before going to CATCH label
+ * @param[in] ... The message to display
+ * @hideinitializer
+ */
+#define SecureTryCatchTag(tag, condition, expr, ...) \
+ if (!(condition)) { \
+ AppSecureLogExceptionTag(tag, __VA_ARGS__); \
+ expr; \
+ goto CATCH; \
+ } \
+ else {;}
+
+/**
+ * If the condition is @c false, it prints a message with a tag, sets the last result, evaluates a cleanup expression,
+ * and goes to <tt>CATCH</tt>.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in] tag Used to identify the source of a log message
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] expr Expressions that are evaluated before going to CATCH label
+ * @param[in] r The last result to set
+ * @param[in] ... The message to display
+ * @hideinitializer
+ */
+#define SecureTryCatchResultTag(tag, condition, expr, r, ...) \
+ if (!(condition)) { \
+ SetLastResult(r); \
+ AppSecureLogExceptionTag(tag, __VA_ARGS__); \
+ expr; \
+ goto CATCH; \
+ } \
+ else {;}
+
+/**
+ * If the condition is @c false, it prints a message with a tag, sets the last result, evaluates a cleanup expression
+ * and goes to label.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in] tag Used to identify the source of a log message
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] expr Expressions that are evaluated before going to catchLabel
+ * @param[in] catchLabel The label for goto operation
+ * @param[in] r The last result to set
+ * @param[in] ... The message to display
+ * @hideinitializer
+ */
+#define SecureTryCatchLabelResultTag(tag, condition, expr, catchLabel, r, ...) \
+ if (!(condition)) { \
+ SetLastResult(r); \
+ AppSecureLogExceptionTag(tag, __VA_ARGS__); \
+ expr; \
+ goto catchLabel; \
+ } \
+ else {;}
+
+/**
+ * If the condition is @c false, the message is printed with a tag and a value is returned.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in] tag Used to identify the source of a log message
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] returnValue The value to return when the condition is @c false
+ * @param[in] ... The message to display
+ * @hideinitializer
+ */
+#define SecureTryReturnTag(tag, condition, returnValue, ...) \
+ if (!(condition)) { \
+ AppSecureLogExceptionTag(tag, __VA_ARGS__); \
+ return returnValue; \
+ } \
+ else {;}
+
+/**
+ * If the condition is @c false, the message is printed with a tag, sets the last result and a value is returned.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in] tag Used to identify the source of a log message
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] returnValue The value to return when the condition is @c false
+ * @param[in] r The last result to set
+ * @param[in] ... The message to display
+ * @hideinitializer
+ */
+#define SecureTryReturnResultTag(tag, condition, returnValue, r, ...) \
+ if (!(condition)) { \
+ SetLastResult(r); \
+ AppSecureLogExceptionTag(tag, __VA_ARGS__); \
+ return returnValue; \
+ } \
+ else {;}
+
+/**
+ * If the condition is @c false, the message is printed with a tag, sets the last result and no value is returned.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in] tag Used to identify the source of a log message
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] r The last result to set
+ * @param[in] ... The message to display
+ * @hideinitializer
+ */
+#define SecureTryReturnVoidResultTag(tag, condition, r, ...) \
+ if (!(condition)) { \
+ SetLastResult(r); \
+ AppSecureLogExceptionTag(tag, __VA_ARGS__); \
+ return; \
+ } \
+ else {;}
+
+/**
+ * If the condition is @c false, the message is printed with a tag and no value is returned.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in] tag Used to identify the source of a log message
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] ... The message to display
+ * @hideinitializer
+ */
+#define SecureTryReturnVoidTag(tag, condition, ...) \
+ if (!(condition)) { \
+ AppSecureLogExceptionTag(tag, __VA_ARGS__); \
+ return; \
+ } \
+ else {;}
+
+/**
+ * If the condition is @c false, the message is printed with a tag.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in] tag Used to identify the source of a log message
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] ... The message to display
+ * @hideinitializer
+ */
+#define SecureTryLogTag(tag, condition, ...) \
+ if (!(condition)) { \
+ AppSecureLogTag(tag, __VA_ARGS__); \
+ } \
+ else {;}
+
+/**
+ * If the condition is @c false, the informative log message is printed with a tag and a value is returned.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in] tag Used to identify the source of a log message
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] returnValue The value to return when the condition is @c false
+ * @param[in] ... The message to display
+ * @hideinitializer
+ */
+#define SecureTryLogReturnTag(tag, condition, returnValue, ...) \
+ if (!(condition)) { \
+ AppSecureLogTag(tag, __VA_ARGS__); \
+ return returnValue; \
+ } \
+ else {;}
+
/** @} */
_OSP_EXPORT_ void AppLogInternal(const char* pFunction, int lineNumber, const char* pFormat, ...);
_OSP_EXPORT_ void AppLogDebugTagInternal(const char* pTag, const char* pFunction, int lineNumber, const char* pFormat, ...);
_OSP_EXPORT_ void AppLogExceptionTagInternal(const char* pTag, const char* pFunction, int lineNumber, const char* pFormat, ...);
-
#ifdef __cplusplus
}
#endif
* The following example demonstrates how to use the SysTryLog macro.
*
* @code
- * bool
+ * void
* MyEngine::Init(int value)
* {
* //...
*
* @code
* #define E_UNKNOWN_ERROR 1
- * bool
+ * result
* MyEngine::Init(int value)
* {
* //...
* SysTryReturnResult(NID, condition, E_UNKNOWN_ERROR, "An unexpected error has occurred.");
*
* //...
- * return true;
+ * return E_SUCCESS;
* }
* @endcode
* @hideinitializer
* The following example demonstrates how to use the SysTryReturnVoidResult macro.
*
* @code
- * bool
+ * void
* MyEngine::Init(int value)
* {
* //...
* SysTryReturnVoidResult(NID, condition, E_INVALID_ARG, "An unexpected error has occurred.");
*
* //...
- * return true;
+ * return;
* }
* @endcode
* @hideinitializer
#else
/**
-* This macro is to protect informative log messages which needs to keep security.
-* It allows display of informative log messages if compiled with "_SECURE_LOG" definition.
-* Otherwise, it will be removed in the compile time.
-* This system log macro is for the platform modules.
-*
-* @since 2.1
-*
-* @param[in] NID The Tizen namespace ID
-* @param[in] ... The message to display
-*
-* The following example demonstrates how to use the SysSecureLog macro.
-*
-* @code
-* bool
-* MyEngine::Init(int value)
-* {
-* SysSecureLog(NID, "User ID : 'JoneDoe'");
-*
-* return true;
-* }
-* @endcode
-* @hideinitializer
-*/
+ * This macro is to protect informative log messages which needs to keep security.
+ * It allows display of informative log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, it will be removed in the compile time.
+ * This system log macro is for the platform modules.
+ *
+ * @since 2.1
+ *
+ * @param[in] NID The Tizen namespace ID
+ * @param[in] ... The message to display
+ *
+ * The following example demonstrates how to use the SysSecureLog macro.
+ *
+ * @code
+ * bool
+ * MyEngine::Init(int value)
+ * {
+ * SysSecureLog(NID, "User ID : 'JoneDoe'");
+ *
+ * return true;
+ * }
+ * @endcode
+ * @hideinitializer
+ */
#define SysSecureLog(NID, ...)
/**
-* This macro is to protect exception log messages which needs to keep security, and sets the last result.
-* It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
-* Otherwise, it will be removed in the compile time.
-* This system log macro is for the platform modules.
-*
-* @since 2.1
-*
-* @param[in] NID The Tizen namespace ID
-* @param[in] r The last result to set
-* @param[in] ... The message to display
-*
-* The following example demonstrates how to use the SysSecureLogException macro.
-*
-* @code
-* bool
-* MyEngine::Init(int value)
-* {
-* //...
-* if (something_wrong)
-* {
-* SysSecureLogException(NID, E_INVALID_ARG, "User ID : 'JoneDoe' mismatch.");
-*
-* return false;
-* }
-* //...
-*
-* return true;
-* }
-* @endcode
-* @hideinitializer
-*/
-#define SysSecureLogException(NID, r,...)
-
-/**
-* This macro is to protect informative log messages which needs to keep security, with a tag.
-* It allows display of informative log messages if compiled with "_SECURE_LOG" definition.
-* Otherwise, it will be removed in the compile time.
-* This system log macro is for the platform modules.
-*
-* @since 2.1
-*
-* @param[in] NID The Tizen namespace ID
-* @param[in] tag The user defined tag
-* @param[in] ... The message to display
-*
-* The following example demonstrates how to use the SysSecureLogTag macro.
-*
-* @code
-* bool
-* MyEngine::Init(int value)
-* {
-* SysSecureLogTag(NID, "MyTag", "User ID : 'JoneDoe'");
-*
-* return true;
-* }
-* @endcode
-* @hideinitializer
-*/
+ * This macro is to protect exception log messages which needs to keep security, and sets the last result.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ * This system log macro is for the platform modules.
+ *
+ * @since 2.1
+ *
+ * @param[in] NID The Tizen namespace ID
+ * @param[in] r The last result to set
+ * @param[in] ... The message to display
+ *
+ * The following example demonstrates how to use the SysSecureLogException macro.
+ *
+ * @code
+ * bool
+ * MyEngine::Init(int value)
+ * {
+ * //...
+ * if (something_wrong)
+ * {
+ * SysSecureLogException(NID, E_INVALID_ARG, "User ID : 'JoneDoe' mismatch.");
+ *
+ * return false;
+ * }
+ * //...
+ *
+ * return true;
+ * }
+ * @endcode
+ * @hideinitializer
+ */
+#define SysSecureLogException(NID, r,...) SetLastResult(r);
+
+/**
+ * This macro is to protect informative log messages which needs to keep security, with a tag.
+ * It allows display of informative log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, it will be removed in the compile time.
+ * This system log macro is for the platform modules.
+ *
+ * @since 2.1
+ *
+ * @param[in] NID The Tizen namespace ID
+ * @param[in] tag The user defined tag
+ * @param[in] ... The message to display
+ *
+ * The following example demonstrates how to use the SysSecureLogTag macro.
+ *
+ * @code
+ * bool
+ * MyEngine::Init(int value)
+ * {
+ * SysSecureLogTag(NID, "MyTag", "User ID : 'JoneDoe'");
+ *
+ * return true;
+ * }
+ * @endcode
+ * @hideinitializer
+ */
#define SysSecureLogTag(NID, tag, ...)
/**
-* This macro is to protect exception log messages which needs to keep security, with a tag and sets the last result.
-* It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
-* Otherwise, it will be removed in the compile time.
-* This system log macro is for the platform modules.
-*
-* @since 2.1
-*
-* @param[in] NID The Tizen namespace ID
-* @param[in] tag The user defined tag
-* @param[in] r The last result to set
-* @param[in] ... The message to display
-*
-* The following example demonstrates how to use the SysSecureLogExceptionTag macro.
-*
-* @code
-* bool
-* MyEngine::Init(int value)
-* {
-* SysSecureLogExceptionTag(NID, "MyTag", E_INVALID_ARG, "User ID : 'JoneDoe' mismatch.");
-*
-* return true;
-* }
-* @endcode
-* @hideinitializer
-*/
-#define SysSecureLogExceptionTag(NID, tag, r, ...)
+ * This macro is to protect exception log messages which needs to keep security, with a tag and sets the last result.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ * This system log macro is for the platform modules.
+ *
+ * @since 2.1
+ *
+ * @param[in] NID The Tizen namespace ID
+ * @param[in] tag The user defined tag
+ * @param[in] r The last result to set
+ * @param[in] ... The message to display
+ *
+ * The following example demonstrates how to use the SysSecureLogExceptionTag macro.
+ *
+ * @code
+ * bool
+ * MyEngine::Init(int value)
+ * {
+ * SysSecureLogExceptionTag(NID, "MyTag", E_INVALID_ARG, "User ID : 'JoneDoe' mismatch.");
+ *
+ * return true;
+ * }
+ * @endcode
+ * @hideinitializer
+ */
+#define SysSecureLogExceptionTag(NID, tag, r, ...) SetLastResult(r);
+
+#endif
+
+/**
+ * This macro allows display of informative log message with a tag, when the condition is @c false.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ * This system log macro is for the platform modules.
+ *
+ * @since 2.1
+ *
+ * @param[in] NID The Tizen namespace
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] ... The message to display
+ *
+ * The following example demonstrates how to use the SysSecureTry macro.
+ *
+ * @code
+ * bool
+ * MyEngine::Init(int value)
+ * {
+ * //...
+ *
+ * SysSecureTryLog(NID, condition, "Password mismatch : %s", password );
+ *
+ * //...
+ * }
+ * @endcode
+ * @hideinitializer
+ */
+#define SysSecureTryLog(NID, condition, ...) \
+ do \
+ { \
+ if (unlikely(!(condition))) { \
+ SysSecureLog(NID, __VA_ARGS__); \
+ } \
+ } while (0);
+
+/**
+ * This macro allows display of informative log message, when the condition is @c false.
+ * Executes statements and goes to label.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ * This system log macro is for the platform modules.
+ *
+ * @since 2.1
+ *
+ * @param[in] NID The Tizen namespace
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] expr Expressions that are evaluated before going to CATCH label
+ * @param[in] ... The message to display
+ * @hideinitializer
+ */
+#define SysSecureTryLogCatch(NID, condition, expr, ...) \
+ do \
+ { \
+ if (unlikely(!(condition))) { \
+ SysSecureLog(NID, __VA_ARGS__); \
+ expr; \
+ goto CATCH; \
+ } \
+ } while (0);
+
+/**
+ * This macro allows display of informative log message and returns returnValue, when the condition is @c false.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ * This system log macro is for the platform modules.
+ *
+ * @since 2.1
+ *
+ * @param[in] NID The Tizen namespace
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] returnValue The value to return when the condition is @c false
+ * @param[in] ... The message to display
+ * @hideinitializer
+ */
+#define SysSecureTryLogReturn(NID, condition, returnValue, ...) \
+ do \
+ { \
+ if (unlikely(!(condition))) { \
+ SysSecureLog(NID, __VA_ARGS__); \
+ return returnValue; \
+ } \
+ } while (0);
+/**
+ * This macro allows display of exception log message with a tag and sets the last result, when the condition is @c false.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ * This system log macro is for the platform modules.
+ *
+ * @since 2.1
+ *
+ * @param[in] NID The Tizen namespace
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] returnValue The value to return when the condition is @c false
+ * @param[in] r The last result to set
+ * @param[in] ... The message to display
+ * @hideinitializer
+ */
+#define SysSecureTryReturn(NID, condition, returnValue, r, ...) \
+ do \
+ { \
+ if (unlikely(!(condition))) { \
+ SysSecureLogException(NID, r, __VA_ARGS__); \
+ return returnValue; \
+ } \
+ } while (0);
+
+#if defined(_SECURE_LOG)
+/**
+ * This macro allows display of exception log message with a tag and sets the last result, when the condition is @c false.
+ * This is a shorthand macro for SysSecureTryReturn(NID, condition, r, r, "[" # r "] " ...).
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ * This system log macro is for the platform modules.
+ *
+ * @since 2.1
+ *
+ * @param[in] NID The Tizen namespace
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] r The last result to set
+ * @param[in] ... The message to display
+ * @hideinitializer
+ */
+#define SysSecureTryReturnResult(NID, condition, r, ...) \
+ do \
+ { \
+ if (unlikely(!(condition))) { \
+ SysTryReturnResultInternal(NID, r, __PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__); \
+ return r; \
+ } \
+ } while (0);
+
+#else
+#define SysSecureTryReturnResult(NID, condition, r, ...) \
+ do \
+ { \
+ if (unlikely(!(condition))) { \
+ SetLastResult(r); \
+ return r; \
+ } \
+ } while (0);
#endif
/**
+ * This macro allows display of exception log message with a tag and sets the last result, when the condition is @c false.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ * This system log macro is for the platform modules.
+ *
+ * @since 2.1
+ *
+ * @param[in] NID The Tizen namespace
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] r The last result to set
+ * @param[in] ... The message to display
+ * @hideinitializer
+ */
+#define SysSecureTryReturnVoidResult(NID, condition, r, ...) \
+ do \
+ { \
+ if (unlikely(!(condition))) { \
+ SysSecureLogException(NID, r, __VA_ARGS__); \
+ return; \
+ } \
+ } while (0);
+
+/**
+ * This macro allows display of exception log message with a tag, when the condition is @c false.
+ * Executes statements, sets the last result and goes to label.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ * This system log macro is for the platform modules.
+ *
+ * @since 2.1
+ *
+ * @param[in] NID The Tizen namespace
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] expr Expressions that are evaluated before going to CATCH label
+ * @param[in] r The last result to set
+ * @param[in] ... The message to display
+ * @hideinitializer
+ */
+#define SysSecureTryCatch(NID, condition, expr, r, ...) \
+ do \
+ { \
+ if (unlikely(!(condition))) { \
+ SysSecureLogException(NID, r, __VA_ARGS__); \
+ expr; \
+ goto CATCH; \
+ } \
+ } while (0);
+
+/**
+ * This macro allows display of exception log message with a tag, when the condition is @c false.
+ * Executes statements, sets the last result and goes to label.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ * This system log macro is for the platform modules.
+ *
+ * @since 2.1
+ *
+ * @param[in] NID The Tizen namespace
+ * @param[in] condition The condition that is expected to be true
+ * @param[in] expr Expressions that are evaluated before going to catchLabel label
+ * @param[in] catchLabel The label for goto operation
+ * @param[in] r The last result to set
+ * @param[in] ... The message to display
+ * @hideinitializer
+ */
+#define SysSecureTryCatchLabel(NID, condition, expr, catchLabel, r, ...) \
+ do \
+ { \
+ if (unlikely(!(condition))) { \
+ SysSecureLogException(NID, r, __VA_ARGS__); \
+ expr; \
+ goto catchLabel; \
+ } \
+ } while (0);
+
+
+/**
* Defines the log ID.
*/
enum LogID
if (r != E_SUCCESS)
{
SysLog(NID_APP, "[%s] Propagating.", GetErrorMessage(r));
+ pMap->RemoveAll(true);
delete pMap;
return r;
}
SysLog(NID_APP, "Loading %d alias sections", __aliasAppId.GetCount());
CATCH:
+ pMap->RemoveAll(true);
delete pMap;
return r;
{
delete __pAppName;
delete __pAppVersion;
+
+ // closing may or may not succeed
+ close(__appRootDirFd);
}
_AppInfo*
}
result
+_AppMessageImpl::AddValueArray(const String& key, const IList* pList)
+{
+ SysAssert(__pBundle != NULL);
+
+ return AddValueArray(__pBundle, key, pList);
+}
+
+result
+_AppMessageImpl::AddValueArraySingle(const String& key, const String& value)
+{
+ SysAssert(__pBundle != NULL);
+
+ ArrayList arr;
+ arr.Construct();
+
+ arr.Add(value);
+
+ return AddValueArray(__pBundle, key, &arr);
+}
+
+
+result
_AppMessageImpl::AddValueArray(bundle* pBundle, const String& key, const IList* pList)
{
std::unique_ptr<char[]> pKey(_StringConverter::CopyToCharArrayN(key));
const _SettingItem* pItem = dynamic_cast<const _SettingItem*>(pObject);
SysTryReturnResult(NID_APP, pItem != null, E_TYPE_MISMATCH, "Type mismatch for instance of id.");
const Boolean* pBoolean = dynamic_cast<const Boolean*>(pItem->GetValue());
- SysTryReturnResult(NID_APP, pBoolean != null, E_TYPE_MISMATCH,
- "Type mismatch between requested type bool and object type of %ls.", id.GetPointer());
+ SysTryReturnResult(NID_APP, pBoolean != null, E_TYPE_MISMATCH, "Type mismatch between requested type bool and object type.");
value = pBoolean->ToBool();
return E_SUCCESS;
const _SettingItem* pItem = dynamic_cast<const _SettingItem*>(pObject);
SysTryReturnResult(NID_APP, pItem != null, E_TYPE_MISMATCH, "Type mismatch for instance of id.");
const Integer* pInteger = dynamic_cast<const Integer*>(pItem->GetValue());
- SysTryReturnResult(NID_APP, pInteger != null, E_TYPE_MISMATCH,
- "Type mismatch between requested type int and object type of %ls.", id.GetPointer());
+ SysTryReturnResult(NID_APP, pInteger != null, E_TYPE_MISMATCH, "Type mismatch between requested type int and object type.");
value = pInteger->ToInt();
return E_SUCCESS;
const _SettingItem* pItem = dynamic_cast<const _SettingItem*>(pObject);
SysTryReturnResult(NID_APP, pItem != null, E_TYPE_MISMATCH, "Type mismatch for instance of id.");
const String* pString = dynamic_cast<const String*>(pItem->GetValue());
- SysTryReturnResult(NID_APP, pString != null, E_TYPE_MISMATCH,
- "Type mismatch between requested type String and object type of %ls.", id.GetPointer());
+ SysTryReturnResult(NID_APP, pString != null, E_TYPE_MISMATCH, "Type mismatch between requested type String and object type.");
value = *pString;
return E_SUCCESS;
_SettingItem* pItem = dynamic_cast<_SettingItem*>(pObject);
SysTryReturnResult(NID_APP, pItem != null, E_TYPE_MISMATCH, "Type mismatch for instance of id.");
Boolean* pBoolean = dynamic_cast<Boolean*>(pItem->GetValue());
- SysTryReturnResult(NID_APP, pBoolean != null, E_TYPE_MISMATCH,
- "Type mismatch between requested type bool and object type of %ls.", id.GetPointer());
+ SysTryReturnResult(NID_APP, pBoolean != null, E_TYPE_MISMATCH, "Type mismatch between requested type bool and object type.");
*pBoolean = value;
static const String strTrue(L"true");
_SettingItem* pItem = dynamic_cast<_SettingItem*>(pObject);
SysTryReturnResult(NID_APP, pItem != null, E_TYPE_MISMATCH, "Type mismatch for instance of id.");
Integer* pInteger = dynamic_cast<Integer*>(pItem->GetValue());
- SysTryReturnResult(NID_APP, pInteger != null, E_TYPE_MISMATCH,
- "Type mismatch between requested type int and object type of %ls.", id.GetPointer());
+ SysTryReturnResult(NID_APP, pInteger != null, E_TYPE_MISMATCH, "Type mismatch between requested type int and object type.");
SysTryReturnResult(NID_APP, (pItem->GetMin() <= value), E_OUT_OF_RANGE, "value(%d) is less than minimum range(%d).",
value, pItem->GetMin());
_SettingItem* pItem = dynamic_cast<_SettingItem*>(pObject);
SysTryReturnResult(NID_APP, pItem != null, E_TYPE_MISMATCH, "Type mismatch for instance of id.");
String* pString = dynamic_cast<String*>(pItem->GetValue());
- SysTryReturnResult(NID_APP, pString != null, E_TYPE_MISMATCH,
- "Type mismatch between requested type String and object type of %ls.", id.GetPointer());
+ SysTryReturnResult(NID_APP, pString != null, E_TYPE_MISMATCH, "Type mismatch between requested type String and object type.");
SysTryReturnResult(NID_APP, pItem->GetMin() <= value.GetLength(), E_OUT_OF_RANGE,
"value length(%d) less than minimum length(%d).", value.GetLength(), pItem->GetMin());
SetValue(strId, strValue, false);
return;
}
- SysLog(NID_APP, "Failed determin value type for id=%s", pId);
+ SysSecureLog(NID_APP, "Failed determine value type for id= %s", pId);
}
else
{
- SysLog(NID_APP, "Failed find value for id=%s", pId);
+ SysSecureLog(NID_APP, "Failed find value for id= %s", pId);
}
}
result AddData(const Tizen::Base::Collection::IMap* pMap);
+ result AddValueArray(const Tizen::Base::String& key, const Tizen::Base::Collection::IList* pList);
+
+ result AddValueArraySingle(const Tizen::Base::String& key, const Tizen::Base::String& value);
+
result RemoveData(const Tizen::Base::String& key);
static result SetOperation(bundle* pBundle, const Tizen::Base::String& operation);
std::unique_ptr<char[]> pExtension(_StringConverter::CopyToCharArrayN(extension));
SysTryReturnResult(NID_APP, pExtension, E_OUT_OF_MEMORY, "pExtension is null.");
- std::unique_ptr<char[]> pPackageId(_StringConverter::CopyToCharArrayN(packageId));
- SysTryReturnResult(NID_APP, pPackageId, E_OUT_OF_MEMORY, "pPackageId is null.");
-
if ((strcasecmp(pExtension.get(), "tpk") == 0) || (strcasecmp(pExtension.get(), "wgt") == 0))
{
SysLog(NID_APP, "packageId = [%ls], packagePath = [%s], extension = [%s]", packageId.GetPointer(), pPackagePath.get(), pExtension.get());
return E_SYSTEM;
}
+ // optionalData = 12345abcde:StoreClientId=XXXXX12345.TizenStore
+ AppId StoreClientId = _AppInfo::GetApplicationId();
+ String optionalData;
+ optionalData.Append(packageId);
+ optionalData.Append(":StoreClientId=");
+ optionalData.Append(StoreClientId);
+
+ std::unique_ptr<char[]> pOptionalData(_StringConverter::CopyToCharArrayN(optionalData));
+ SysTryReturnResult(NID_APP, pOptionalData, E_OUT_OF_MEMORY, "pOptionalData is null.");
+
+ SysLog(NID_APP, "optionalData = [%s]", pOptionalData.get());
+
result r = E_SUCCESS;
_PackageManagerProxy packageManagerProxy;
r = packageManagerProxy.Construct();
SysTryReturnResult(NID_APP, __pRequestClient != null, E_SYSTEM, "pkgmgr_client_new(PC_REQUEST) failed");
}
- int res = pkgmgr_client_install(__pRequestClient, pExtension.get(), null, pPackagePath.get(), pPackageId.get(), PM_QUIET, InstallationEventHandler, pListener);
+ int res = pkgmgr_client_install(__pRequestClient, pExtension.get(), null, pPackagePath.get(), pOptionalData.get(), PM_QUIET, InstallationEventHandler, pListener);
if (res < PKGMGR_R_OK)
{
tempFilePath.Append(appId);
tempFilePath.Append(callerReqId);
__tmpPath = tempFilePath;
- SysLog(NID_IO, "[DC_PROV_SEND] temp file path: %ls", tempFilePath.GetPointer());
+ SysSecureLog(NID_IO, "[DC_PROV_SEND] temp file path: %ls", tempFilePath.GetPointer());
// initialize
r = pDbEnum->Reset();
GetErrorMessage(r), __tmpPath.GetPointer());
columnCount = pDbEnum->GetColumnCount();
- SysLog(NID_IO, "column count is %d.\n", columnCount);
+ SysSecureLog(NID_IO, "column count is %d.\n", columnCount);
r = pFile->Seek(FILESEEKPOSITION_BEGIN, sizeof(int));
SysTryReturn(NID_IO, r == E_SUCCESS, r, r, "[%s] System error was occurred.", GetErrorMessage(r));
byte = strlen(pColumnName);
totalSizeOfColumnNames += byte;
- SysLog(NID_IO, "[%d] column name: %s", i, pColumnName);
+ SysSecureLog(NID_IO, "[%d] column name: %s", i, pColumnName);
delete[] pColumnName;
}
r = pFile->Seek(FILESEEKPOSITION_BEGIN, sizeof(int) * 2);
bool internalInstalled = true;
result r = E_SUCCESS;
- SysLog(NID_IO, "[data_caging] PrepareDataCaging() was called by installer backend, appRootPath: %ls, packageId: %ls",
+ SysSecureLog(NID_IO, "[data_caging] PrepareDataCaging() was called by installer backend, appRootPath: %ls, packageId: %ls",
appRootPath.GetPointer(), pkgId.GetPointer());
if (CleanDirectories(appRootPath, pkgId) == false)
ret = messageport_get_local_port_name(id, &pLocalPort);
if (pLocalPort == null)
{
- SysLog(NID_IO, "No local port for id: %d", id);
+ SysSecureLog(NID_IO, "No local port for id: %d", id);
bundle_free(data);
return;
}
else // Bi-directional
{
- SysLog(NID_IO, "Message received from [%s:%s], trusted: %d", remote_app_id, remote_port, trusted_port);
+ SysSecureLog(NID_IO, "Message received from [%s:%s], trusted: %d", remote_app_id, remote_port, trusted_port);
pListener->OnMessageReceivedN(remote_app_id, remote_port, trusted_port, pMap);
}
ret = messageport_get_local_port_name(id, &pLocalPort);
if (pLocalPort == null)
{
- SysLog(NID_IO, "No local port for id: %d", id);
+ SysSecureLog(NID_IO, "No local port for id: %d", id);
bundle_free(data);
return;
}
else // Bi-directional
{
- SysLog(NID_IO, "Trusted message received from [%s:%s], trusted: %d", remote_app_id, remote_port, trusted_port);
+ SysSecureLog(NID_IO, "Trusted message received from [%s:%s], trusted: %d", remote_app_id, remote_port, trusted_port);
pListener->OnMessageReceivedN(remote_app_id, remote_port, trusted_port, pMap);
}
_MessagePortProxy::RegisterMessagePort(const String& localPort, bool isTrusted,
const _IMessagePortListener& listener)
{
- SysLog(NID_IO, "Register a message port : [%ls:%ls]", __appId.GetPointer(), localPort.GetPointer());
+ SysSecureLog(NID_IO, "Register a message port : [%ls:%ls]", __appId.GetPointer(), localPort.GetPointer());
result r = E_SUCCESS;
int ret = 0;
const String& remotePort,
bool isTrusted)
{
- SysLog(NID_IO, "Request a remote message port [%ls:%ls]", remoteAppId.GetPointer(), remotePort.GetPointer());
+ SysSecureLog(NID_IO, "Request a remote message port [%ls:%ls]", remoteAppId.GetPointer(), remotePort.GetPointer());
result r = E_SUCCESS;
int ret = 0;
result
_MessagePortProxy::SendMessage(const AppId& remoteAppId, const String& remotePort, bool isTrusted, const HashMap* pMap)
{
- SysLog(NID_IO, "Send a unidirectional message to remote port [%ls:%ls]", remoteAppId.GetPointer(), remotePort.GetPointer());
+ SysSecureLog(NID_IO, "Send a unidirectional message to remote port [%ls:%ls]", remoteAppId.GetPointer(), remotePort.GetPointer());
int ret = 0;
int size = 0;
result
_MessagePortProxy::SendMessage(const String& localPort, bool isTrustedLocal, const AppId& remoteAppId, const String& remotePort, bool isTrustedRemote, const HashMap* pMap)
{
- SysLog(NID_IO, "Send a bidirectional message from [%ls:%ls] to [%ls:%ls]", __appId.GetPointer(), localPort.GetPointer(), remoteAppId.GetPointer(), remotePort.GetPointer());
+ SysSecureLog(NID_IO, "Send a bidirectional message from [%ls:%ls] to [%ls:%ls]", __appId.GetPointer(), localPort.GetPointer(), remoteAppId.GetPointer(), remotePort.GetPointer());
result r = E_SUCCESS;
int id = 0;
r = E_INVALID_STATE;
}
SysTryReturnResult(NID_LCL, otherCalendar._pCalendarImpl, r, "Invalid argument is used. otherCalendar instance is invalid");
- return _pCalendarImpl->After(*otherCalendar._pCalendarImpl, after);
+ return _pCalendarImpl->AfterImpl(*otherCalendar._pCalendarImpl, after);
}
result
r = E_INVALID_STATE;
}
SysTryReturnResult(NID_LCL, otherCalendar._pCalendarImpl, r, "Invalid argument is used. otherCalendar instance is invalid");
- return _pCalendarImpl->Before(*otherCalendar._pCalendarImpl, before);
+ return _pCalendarImpl->BeforeImpl(*otherCalendar._pCalendarImpl, before);
}
result
return false;
}
- return _pCalendarImpl->Equals(*pOtherInstance->_pCalendarImpl);
+ return _pCalendarImpl->EqualsImpl(*pOtherInstance->_pCalendarImpl);
}
int
Calendar::GetHashCode(void) const
{
SysAssertf(_pCalendarImpl != null, "Not yet constructed! Construct() should be called before use.");
- return _pCalendarImpl->GetHashCode();
+ return _pCalendarImpl->GetHashCodeImpl();
}
int
Calendar::GetGreatestMinTimeField(TimeField field) const
{
SysAssertf(_pCalendarImpl != null, "Not yet constructed! Construct() should be called before use.");
- return _pCalendarImpl->GetGreatestMinTimeField(field);
+ return _pCalendarImpl->GetGreatestMinTimeFieldImpl(field);
}
int
Calendar::GetLeastMaxTimeField(TimeField field) const
{
SysAssertf(_pCalendarImpl != null, "Not yet constructed! Construct() should be called before use.");
- return _pCalendarImpl->GetLeastMaxTimeField(field);
+ return _pCalendarImpl->GetLeastMaxTimeFieldImpl(field);
}
int
Calendar::GetMaxTimeField(TimeField field) const
{
SysAssertf(_pCalendarImpl != null, "Not yet constructed! Construct() should be called before use.");
- return _pCalendarImpl->GetMaxTimeField(field);
+ return _pCalendarImpl->GetMaxTimeFieldImpl(field);
}
int
Calendar::GetMinTimeField(TimeField field) const
{
SysAssertf(_pCalendarImpl != null, "Not yet constructed! Construct() should be called before use.");
- return _pCalendarImpl->GetMinTimeField(field);
+ return _pCalendarImpl->GetMinTimeFieldImpl(field);
}
int
LanguageCode
Locale::GetLanguageCode(void) const
{
- if ((__languageCode == LANGUAGE_INVALID) && (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1))
- {
- return LANGUAGE_INVALID_RESERVED;
- }
return __languageCode;
}
CountryCode
Locale::GetCountryCode(void) const
{
- if ((__countryCode == COUNTRY_INVALID) && (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1))
- {
- return COUNTRY_INVALID_RESERVED;
- }
return __countryCode;
}
LanguageCode invalidLanguageCode = LANGUAGE_INVALID;
LanguageCode maxLangageCode = LANGUAGE_MAX;
- if (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1)
- {
- invalidLanguageCode = LANGUAGE_INVALID_RESERVED;
- maxLangageCode = LanguageMaxReserved;
- }
-
if (!languageCodeString.IsEmpty())
{
for (int i = 0; i < maxLangageCode; i++)
CountryCode invalidCountryCode = COUNTRY_INVALID;
CountryCode maxCountryCode = COUNTRY_MAX;
- if (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1)
- {
- invalidCountryCode = COUNTRY_INVALID_RESERVED;
- maxCountryCode = CountryMaxReserved;
- }
-
if(!countryCodeString.IsEmpty())
{
for (int i = 0; i < maxCountryCode; i++)
String
Locale::LanguageCodeToString(LanguageCode languageCode)
{
- if (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1)
- {
- return ((languageCode >= LANGUAGE_AAR) && (languageCode < LanguageMaxReserved))
- ? LanguageCodeString3LetterArray[languageCode]
- : String();
- }
-
return ((languageCode > LANGUAGE_INVALID) && (languageCode < LANGUAGE_MAX))
? LanguageCodeString3LetterArray[languageCode]
: String();
String
Locale::CountryCodeToString(CountryCode countryCode)
{
- if (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1)
- {
- return ((countryCode >= COUNTRY_AF) && (countryCode < CountryMaxReserved))
- ? CountryCodeString2LetterArray[countryCode]
- : String();
- }
-
return ((countryCode > COUNTRY_INVALID) && (countryCode < COUNTRY_MAX))
? CountryCodeString2LetterArray[countryCode]
: String();
String
Locale::LanguageCodeToTwoLetterLanguageCodeString(LanguageCode languageCode)
{
- if (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1)
- {
- return ((languageCode >= LANGUAGE_AAR) && (languageCode < LanguageMaxReserved))
- ? _LocaleImpl::Get2LetterLanguageCodeString(LanguageCodeString3LetterArray[languageCode])
- : String();
- }
-
return ((languageCode > LANGUAGE_INVALID) && (languageCode < LANGUAGE_MAX))
? _LocaleImpl::Get2LetterLanguageCodeString(LanguageCodeString3LetterArray[languageCode])
: String();
std::unique_ptr<char[]> pLangStr (_StringConverter::CopyToCharArrayN(languageCodeString));
return StringToLanguageCode(_LocaleImpl::Get3LetterLanguageCodeString(pLangStr.get()));
}
- return (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1) ? LANGUAGE_INVALID_RESERVED : LANGUAGE_INVALID;
+ return LANGUAGE_INVALID;
}
String
Locale::CountryCodeToThreeLetterCountryCodeString(CountryCode countryCode)
{
- if (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1)
- {
- return ((countryCode >= COUNTRY_AF) && (countryCode < CountryMaxReserved))
- ? _LocaleImpl::Get3LetterCountryCodeString(CountryCodeString2LetterArray[countryCode])
- : String();
- }
-
return ((countryCode > COUNTRY_INVALID) && (countryCode < COUNTRY_MAX))
? _LocaleImpl::Get3LetterCountryCodeString(CountryCodeString2LetterArray[countryCode])
: String();
{
if (countryCodeString.GetLength() == 3)
{
- CountryCode maxCountryCode = (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1)
- ? (CountryCode)(COUNTRY_INVALID_RESERVED - 1)
- : COUNTRY_MAX;
+ CountryCode maxCountryCode = COUNTRY_MAX;
for (int i = 0; i < maxCountryCode; i++)
{
}
}
- return (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1) ? COUNTRY_INVALID_RESERVED : COUNTRY_INVALID;
+ return COUNTRY_INVALID;
}
}
result
-_CalendarImpl::After(const _CalendarImpl& otherInstance, bool& after)
+_CalendarImpl::AfterImpl(const _CalendarImpl& otherInstance, bool& after)
{
SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
}
result
-_CalendarImpl::Before(const _CalendarImpl& otherInstance, bool& before)
+_CalendarImpl::BeforeImpl(const _CalendarImpl& otherInstance, bool& before)
{
SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
}
bool
-_CalendarImpl::Equals(const _CalendarImpl& otherInstance) const
+_CalendarImpl::EqualsImpl(const _CalendarImpl& otherInstance) const
{
if ((__pCalendar != null) && (otherInstance.__pCalendar != null))
{
}
int
-_CalendarImpl::GetHashCode(void) const
+_CalendarImpl::GetHashCodeImpl(void) const
{
Integer intValues = IsLenient() + GetFirstDayOfWeek() + GetMinDaysInFirstWeek();
int hashCode = intValues.GetHashCode();
}
int
-_CalendarImpl::GetMinTimeField(TimeField field) const
+_CalendarImpl::GetMinTimeFieldImpl(TimeField field) const
{
SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
}
int
-_CalendarImpl::GetGreatestMinTimeField(TimeField field) const
+_CalendarImpl::GetGreatestMinTimeFieldImpl(TimeField field) const
{
SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
}
int
-_CalendarImpl::GetLeastMaxTimeField(TimeField field) const
+_CalendarImpl::GetLeastMaxTimeFieldImpl(TimeField field) const
{
SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
}
int
-_CalendarImpl::GetMaxTimeField(TimeField field) const
+_CalendarImpl::GetMaxTimeFieldImpl(TimeField field) const
{
SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
result RollImpl(TimeField field, int amount);
// Methods to compare Calendars
- result After(const _CalendarImpl& otherInstance, bool& after);
- result Before(const _CalendarImpl& otherInstance, bool& before);
- bool Equals(const _CalendarImpl& otherInstance) const;
+ result AfterImpl(const _CalendarImpl& otherInstance, bool& after);
+ result BeforeImpl(const _CalendarImpl& otherInstance, bool& before);
+ bool EqualsImpl(const _CalendarImpl& otherInstance) const;
// Get methods
- int GetHashCode(void) const;
+ int GetHashCodeImpl(void) const;
CalendarType GetType(void) const;
int GetTimeFieldImpl(TimeField field) const;
result GetTimeInMillisecImpl(long long& millisec) const;
Tizen::Base::DateTime GetTimeImpl(void) const;
- int GetMinTimeField(TimeField field) const;
+ int GetMinTimeFieldImpl(TimeField field) const;
int GetActualMinTimeFieldImpl(TimeField field) const;
- int GetGreatestMinTimeField(TimeField field) const;
+ int GetGreatestMinTimeFieldImpl(TimeField field) const;
- int GetLeastMaxTimeField(TimeField field) const;
+ int GetLeastMaxTimeFieldImpl(TimeField field) const;
int GetActualMaxTimeFieldImpl(TimeField field) const;
- int GetMaxTimeField(TimeField field) const;
+ int GetMaxTimeFieldImpl(TimeField field) const;
int GetFirstDayOfWeekImpl(void) const;
int GetMinDaysInFirstWeekImpl(void) const;