Imported Upstream version 0.8~alpha1
[platform/upstream/syncevolution.git] / src / client-api / src / c++ / common / syncml / core / Authentication.cpp
index fb6ceb4..45aee9b 100644 (file)
@@ -37,6 +37,9 @@
 #include "syncml/core/Authentication.h"
 #include "syncml/core/Constants.h"
 #include "syncml/core/Cred.h"
+#include "base/globalsdef.h"
+
+USE_NAMESPACE
 
 
 Authentication::Authentication() {
@@ -54,7 +57,7 @@ Authentication::~Authentication() {
      if (principalId)    {delete [] principalId; principalId = NULL; }
      if (meta)           {delete  meta; meta = NULL; }
 
-     encode = FALSE;
+     encode = false;
 
 }
 
@@ -77,7 +80,7 @@ void Authentication::initialize() {
     this->data            = NULL;
     this->username        = NULL;
     this->password        = NULL;
-    this->encode          = FALSE;
+    this->encode          = false;
     this->deviceId        = NULL ;
     this->syncMLVerProto  = NULL ;
     this->principalId     = NULL;
@@ -123,7 +126,7 @@ Authentication::Authentication(const char* type, const char* data) {
  */
 Authentication::Authentication(const char* type,
                                const char* data,
-                               BOOL encode) {
+                               bool encode) {
 
 
     initialize();
@@ -152,7 +155,7 @@ Authentication::Authentication(const char* type,
            // tbd
     }
 
-    encode = TRUE;
+    encode = true;
     char auth[DIM_512];
     sprintf(auth, "%s:%s", username, password);
     createAuthentication(type, auth);
@@ -311,20 +314,20 @@ void Authentication::setData(const char*data) {
 
         unsigned int len = strlen(clearData);
         char* p1 = clearData;
-        BOOL charFound = FALSE;
+        bool charFound = false;
         for (unsigned int k = 0; k < len; k++) {
             if (*p1 == 0) {
                 break;
             }
             else if (*p1 == ':') {
-                charFound = TRUE;
+                charFound = true;
                 p1 = p1 + 1;
                 break;
             }
             p1 = p1 + 1;
         }
 
-        if (charFound == FALSE) {
+        if (charFound == false) {
             this->setUsername(clearData);
             this->setPassword(NULL);
         } else {