secureswitools/swisistools/source/sisxlibrary/utility_windows.cpp
changeset 50 c6e8afe0ba85
parent 25 98b66e4fb0be
equal deleted inserted replaced
46:bb1748e0dd9b 50:c6e8afe0ba85
     1 /*
     1 /*
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
   183 int GetErrorValue()
   183 int GetErrorValue()
   184 	{
   184 	{
   185 	return ::GetLastError();
   185 	return ::GetLastError();
   186 	}
   186 	}
   187 
   187 
   188 int FileCopyA(const char* aSrc, const char* aDest, size_t aFlag)
   188 int FileCopyA(const char* aSrc, const char* aDest, bool aFailIfExistsFlag)
   189 {
   189 {
   190 	int err=CopyFileA(aSrc,aDest,aFlag);
   190 	// CopyFileA() returns zero on failure and non-zero otherwise.
   191 	return err;
   191 	int err=CopyFileA(aSrc,aDest,aFailIfExistsFlag);
       
   192 	// To maintain consistency with the LINUX wrapper API FileCopyA() which uses cp 
       
   193 	// command with system(), we return 0 on success and 1 on failure.
       
   194 	return !err;
   192 }
   195 }
   193 
   196 
   194 int FileMoveA(const char* aSrc, const char* aDest)
   197 int FileMoveA(const char* aSrc, const char* aDest)
   195 {
   198 {
       
   199 	// MoveFileA() returns zero on failure and non-zero otherwise.
   196 	int err=MoveFileA(aSrc,aDest);
   200 	int err=MoveFileA(aSrc,aDest);
   197 	return err;
   201 	// To maintain consistency with the LINUX wrapper API FileMoveA() which uses mv
       
   202 	// command with system(), we return 0 on success and 1 on failure.
       
   203 	return !err;
   198 }
   204 }
   199 
   205