sal: remove OSL_ENSURE_FILE, better use SAL_LOG/SAL_INFO

Change-Id: I43d77cbf572acc4c27785990e28b43b35d71c96d
This commit is contained in:
Michael Stahl
2014-01-09 13:15:32 +01:00
parent 4356aef48a
commit 4eae9d19cc
3 changed files with 12 additions and 43 deletions

View File

@@ -122,25 +122,4 @@ oslFileError oslTranslateFileError (/*DWORD*/ unsigned long dwError)
return osl_File_E_INVAL;
}
//#####################################################
#if OSL_DEBUG_LEVEL > 0
void _osl_warnFile( const char *message, rtl_uString *ustrFile )
{
char szBuffer[2048];
if (ustrFile)
{
rtl_String *strFile = NULL;
rtl_uString2String( &strFile, rtl_uString_getStr( ustrFile ), rtl_uString_getLength( ustrFile ),
osl_getThreadTextEncoding(), OUSTRING_TO_OSTRING_CVTFLAGS );
snprintf( szBuffer, sizeof(szBuffer), message, strFile->buffer );
rtl_string_release( strFile );
message = szBuffer;
}
OSL_FAIL( message );
}
#endif /* OSL_DEBUG_LEVEL */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -21,7 +21,6 @@
#define INCLUDED_OSL_FILE_ERROR_H
#include "osl/file.h"
#include "rtl/ustring.h"
#ifdef __cplusplus
extern "C" {
@@ -29,13 +28,6 @@ extern "C" {
oslFileError oslTranslateFileError (/*DWORD*/ unsigned long dwError);
#if OSL_DEBUG_LEVEL > 0
void _osl_warnFile (const char * message, rtl_uString * ustrFile);
#define OSL_ENSURE_FILE( cond, msg, file ) ( (cond) ? (void)0 : _osl_warnFile( msg, file ) )
#else
#define OSL_ENSURE_FILE( cond, msg, file ) ((void)0)
#endif
#ifdef __cplusplus
}
#endif

View File

@@ -711,10 +711,11 @@ oslFileError _osl_getSystemPathFromFileURL( rtl_uString *strURL, rtl_uString **p
/* If the length of strUTF8 and strURL differs it indicates that the URL was not correct encoded */
OSL_ENSURE_FILE(
strUTF8->length == strURL->length ||
0 != rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength( strURL->buffer, strURL->length, "file:\\\\", 7 )
,"osl_getSystemPathFromFileURL: \"%s\" is not encoded !!!", strURL );
SAL_WARN_IF(
strUTF8->length != strURL->length &&
0 == rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength( strURL->buffer, strURL->length, "file:\\\\", 7 )
, "sal.osl"
,"osl_getSystemPathFromFileURL: \"" << strURL << "\" is not encoded !!!");
bValidEncoded = _osl_decodeURL( strUTF8, &strDecodedURL );
@@ -809,10 +810,9 @@ oslFileError _osl_getSystemPathFromFileURL( rtl_uString *strURL, rtl_uString **p
if ( IsValidFilePath( strTempPath, NULL, VALIDATEPATH_ALLOW_RELATIVE | VALIDATEPATH_ALLOW_ELLIPSE, &strTempPath ) )
nError = osl_File_E_None;
}
/*
else
OSL_ENSURE_FILE( !nError, "osl_getSystemPathFromFileURL: \"%s\" is not an absolute FileURL !!!", strURL );
*/
else
SAL_INFO_IF(nError, "sal.osl",
"osl_getSystemPathFromFileURL: \"" << strURL << "\" is not an absolute FileURL");
}
@@ -825,9 +825,8 @@ oslFileError _osl_getSystemPathFromFileURL( rtl_uString *strURL, rtl_uString **p
if ( strTempPath )
rtl_uString_release( strTempPath );
/*
OSL_ENSURE_FILE( !nError, "osl_getSystemPathFromFileURL: \"%s\" is not a FileURL !!!", strURL );
*/
SAL_INFO_IF(nError, "sal.osl",
"osl_getSystemPathFromFileURL: \"" << strURL << "\" is not a FileURL");
return nError;
}
@@ -933,9 +932,8 @@ oslFileError _osl_getFileURLFromSystemPath( rtl_uString* strPath, rtl_uString**
if ( strTempURL )
rtl_uString_release( strTempURL );
/*
OSL_ENSURE_FILE( !nError, "osl_getFileURLFromSystemPath: \"%s\" is not a systemPath !!!", strPath );
*/
SAL_INFO_IF(nError, "sal.osl",
"osl_getFileURLFromSystemPath: \"" << strPath << "\" is not a systemPath");
return nError;
}