[devel_3.0_main] Cherry-pick Beautification of source-code. 80383
[platform/framework/native/appfw.git] / src / base / FBaseUuId.cpp
index 1cc12d7..90ca696 100644 (file)
@@ -18,7 +18,6 @@
  * @file               FBaseUuId.cpp
  * @brief              This is the implementation file for UuId class.
  */
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <wchar.h>
@@ -27,9 +26,8 @@
 #include <FBaseResult.h>
 #include <FBaseByteBuffer.h>
 #include <FBaseSysLog.h>
-#include "FBase_StringConverter.h"
 #include <unique_ptr.h>
-
+#include "FBase_StringConverter.h"
 
 namespace Tizen { namespace Base
 {
@@ -69,7 +67,7 @@ UuId::~UuId(void)
 bool
 operator ==(const UUID& uuid1, const UuId& uuid2)
 {
-       byte uuid[16] = {0,};
+       byte uuid[16] = {0, };
        memcpy(uuid, &uuid1, sizeof(uuid));
        UuId::ConvertToUuId(uuid);
 
@@ -135,7 +133,7 @@ UuId::operator =(const UuId& uuid)
 bool
 UuId::Equals(const Object& obj) const
 {
-       const UuId* pOther = dynamic_cast<const UuId*>(&obj);
+       const UuId* pOther = dynamic_cast< const UuId* >(&obj);
 
        if (pOther == null)
        {
@@ -196,8 +194,8 @@ UuId::ToString(void) const
        return String(pChar);
        */
 
-       char uuid_str[36] = {0,};
-       
+       char uuid_str[36] = {0, };
+
        uuid_unparse(this->uuid, uuid_str);
 
        return String(uuid_str);
@@ -207,8 +205,8 @@ UUID
 UuId::ToUUID(void) const
 {
        UUID uuid;
-       byte uuidValue[16] = {0,};
-       
+       byte uuidValue[16] = {0, };
+
        uuid_copy(uuidValue, this->uuid);
        ConvertToUuId(uuidValue);
 
@@ -316,14 +314,14 @@ UuId::Parse(const String& str, UuId& uuid)
        SysTryReturnResult(NID_BASE, length == 36, E_INVALID_ARG, "The length of str(%d) MUST be 36.", length);
 
        SysTryReturnResult(NID_BASE, !(str[8] != L'-' || str[13] != L'-' || str[18] != L'-' || str[23] != L'-')
-                         ,E_INVALID_ARG, "The str(%ls) is not valid UuId type.", str.GetPointer());
+               E_INVALID_ARG, "The str(%ls) is not valid UuId type.", str.GetPointer());
 
        uuid_t uuidValue;
-       std::unique_ptr<char []> pStr(_StringConverter::CopyToCharArrayN(str));
+       std::unique_ptr< char[] > pStr(_StringConverter::CopyToCharArrayN(str));
        SysTryReturnResult(NID_BASE, pStr != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
        int ret = uuid_parse(pStr.get(), uuidValue);
 
-       SysTryReturnResult(NID_BASE, ret == 0,  E_INVALID_ARG, "The str(%ls) MUST consist of only alphanumeric characters and '-'.", str.GetPointer());
+       SysTryReturnResult(NID_BASE, ret == 0, E_INVALID_ARG, "The str(%ls) MUST consist of only alphanumeric characters and '-'.", str.GetPointer());
 
        uuid_copy(uuid.uuid, uuidValue);
 
@@ -360,11 +358,11 @@ UuId::ConvertToUuId(byte uuid[16])
 {
        byte value = 0x00;
 
-       for (int i=0; i<2; i++)
+       for (int i = 0; i < 2; i++)
        {
                value = uuid[i];
-               uuid[i] = uuid[3-i];
-               uuid[3-i] = value;
+               uuid[i] = uuid[3 - i];
+               uuid[3 - i] = value;
        }
 
        value = uuid[4];