Drop 'using namespace osl' for consistency
Change-Id: I9fb1cf011bc982f2e9722c6b69ce2420b21b4083 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163577 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
@@ -42,8 +42,6 @@
|
|||||||
#include <process.h>
|
#include <process.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace osl;
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
OUString gTempNameBase_Impl;
|
OUString gTempNameBase_Impl;
|
||||||
@@ -155,12 +153,12 @@ OUString ConstructTempDir_Impl( const OUString* pParent, bool bCreateParentDirs
|
|||||||
&& (osl::FileBase::getFileURLFromSystemPath(aRet, aRet)
|
&& (osl::FileBase::getFileURLFromSystemPath(aRet, aRet)
|
||||||
== osl::FileBase::E_None))
|
== osl::FileBase::E_None))
|
||||||
{
|
{
|
||||||
::osl::DirectoryItem aItem;
|
osl::DirectoryItem aItem;
|
||||||
sal_Int32 i = aRet.getLength();
|
sal_Int32 i = aRet.getLength();
|
||||||
if ( aRet[i-1] == '/' )
|
if ( aRet[i-1] == '/' )
|
||||||
i--;
|
i--;
|
||||||
|
|
||||||
if ( DirectoryItem::get( aRet.copy(0, i), aItem ) == FileBase::E_None || bCreateParentDirs )
|
if ( osl::DirectoryItem::get( aRet.copy(0, i), aItem ) == osl::FileBase::E_None || bCreateParentDirs )
|
||||||
aName = aRet;
|
aName = aRet;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -245,12 +243,12 @@ private:
|
|||||||
|
|
||||||
sal_uInt32 UniqueTokens::globalValue = SAL_MAX_UINT32;
|
sal_uInt32 UniqueTokens::globalValue = SAL_MAX_UINT32;
|
||||||
|
|
||||||
class TempDirCreatedObserver : public DirectoryCreationObserver
|
class TempDirCreatedObserver : public osl::DirectoryCreationObserver
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void DirectoryCreated(const OUString& aDirectoryUrl) override
|
virtual void DirectoryCreated(const OUString& aDirectoryUrl) override
|
||||||
{
|
{
|
||||||
File::setAttributes( aDirectoryUrl, osl_File_Attribute_OwnRead |
|
osl::File::setAttributes( aDirectoryUrl, osl_File_Attribute_OwnRead |
|
||||||
osl_File_Attribute_OwnWrite | osl_File_Attribute_OwnExe );
|
osl_File_Attribute_OwnWrite | osl_File_Attribute_OwnExe );
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -270,8 +268,8 @@ OUString lcl_createName(
|
|||||||
else
|
else
|
||||||
aDirName = aName;
|
aDirName = aName;
|
||||||
TempDirCreatedObserver observer;
|
TempDirCreatedObserver observer;
|
||||||
FileBase::RC err = Directory::createPath( aDirName, &observer );
|
osl::FileBase::RC err = osl::Directory::createPath(aDirName, &observer);
|
||||||
if ( err != FileBase::E_None && err != FileBase::E_EXIST )
|
if (err != osl::FileBase::E_None && err != osl::FileBase::E_EXIST)
|
||||||
return OUString();
|
return OUString();
|
||||||
}
|
}
|
||||||
aName += rLeadingChars;
|
aName += rLeadingChars;
|
||||||
@@ -286,44 +284,44 @@ OUString lcl_createName(
|
|||||||
aTmp += ".tmp";
|
aTmp += ".tmp";
|
||||||
if ( bDirectory )
|
if ( bDirectory )
|
||||||
{
|
{
|
||||||
FileBase::RC err = Directory::create(
|
osl::FileBase::RC err = osl::Directory::create(
|
||||||
aTmp,
|
aTmp,
|
||||||
(osl_File_OpenFlag_Read | osl_File_OpenFlag_Write
|
(osl_File_OpenFlag_Read | osl_File_OpenFlag_Write
|
||||||
| osl_File_OpenFlag_Private));
|
| osl_File_OpenFlag_Private));
|
||||||
if ( err == FileBase::E_None )
|
if (err == osl::FileBase::E_None)
|
||||||
{
|
{
|
||||||
// !bKeep: only for creating a name, not a file or directory
|
// !bKeep: only for creating a name, not a file or directory
|
||||||
if ( bKeep || Directory::remove( aTmp ) == FileBase::E_None )
|
if (bKeep || osl::Directory::remove(aTmp) == osl::FileBase::E_None)
|
||||||
return aTmp;
|
return aTmp;
|
||||||
else
|
else
|
||||||
return OUString();
|
return OUString();
|
||||||
}
|
}
|
||||||
else if ( err != FileBase::E_EXIST )
|
else if (err != osl::FileBase::E_EXIST)
|
||||||
// if f.e. name contains invalid chars stop trying to create dirs
|
// if f.e. name contains invalid chars stop trying to create dirs
|
||||||
return OUString();
|
return OUString();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DBG_ASSERT( bKeep, "Too expensive, use directory for creating name!" );
|
DBG_ASSERT( bKeep, "Too expensive, use directory for creating name!" );
|
||||||
File aFile( aTmp );
|
osl::File aFile(aTmp);
|
||||||
FileBase::RC err = aFile.open(
|
osl::FileBase::RC err = aFile.open(
|
||||||
osl_File_OpenFlag_Create | osl_File_OpenFlag_Private
|
osl_File_OpenFlag_Create | osl_File_OpenFlag_Private
|
||||||
| (bLock ? 0 : osl_File_OpenFlag_NoLock));
|
| (bLock ? 0 : osl_File_OpenFlag_NoLock));
|
||||||
if ( err == FileBase::E_None || (bLock && err == FileBase::E_NOLCK) )
|
if (err == osl::FileBase::E_None || (bLock && err == osl::FileBase::E_NOLCK))
|
||||||
{
|
{
|
||||||
aFile.close();
|
aFile.close();
|
||||||
return aTmp;
|
return aTmp;
|
||||||
}
|
}
|
||||||
else if ( err != FileBase::E_EXIST )
|
else if (err != osl::FileBase::E_EXIST)
|
||||||
{
|
{
|
||||||
// if f.e. name contains invalid chars stop trying to create dirs
|
// if f.e. name contains invalid chars stop trying to create dirs
|
||||||
// but if there is a folder with such name proceed further
|
// but if there is a folder with such name proceed further
|
||||||
|
|
||||||
DirectoryItem aTmpItem;
|
osl::DirectoryItem aTmpItem;
|
||||||
FileStatus aTmpStatus( osl_FileStatus_Mask_Type );
|
osl::FileStatus aTmpStatus(osl_FileStatus_Mask_Type);
|
||||||
if ( DirectoryItem::get( aTmp, aTmpItem ) != FileBase::E_None
|
if (osl::DirectoryItem::get(aTmp, aTmpItem) != osl::FileBase::E_None
|
||||||
|| aTmpItem.getFileStatus( aTmpStatus ) != FileBase::E_None
|
|| aTmpItem.getFileStatus(aTmpStatus) != osl::FileBase::E_None
|
||||||
|| aTmpStatus.getFileType() != FileStatus::Directory )
|
|| aTmpStatus.getFileType() != osl::FileStatus::Directory)
|
||||||
return OUString();
|
return OUString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -395,7 +393,7 @@ OUString CreateTempName()
|
|||||||
// convert to file URL
|
// convert to file URL
|
||||||
OUString aTmp;
|
OUString aTmp;
|
||||||
if ( !aName.isEmpty() )
|
if ( !aName.isEmpty() )
|
||||||
FileBase::getSystemPathFromFileURL( aName, aTmp );
|
osl::FileBase::getSystemPathFromFileURL(aName, aTmp);
|
||||||
return aTmp;
|
return aTmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -440,7 +438,7 @@ void TempFileFast::CloseStream()
|
|||||||
// On other platforms, we need to explicitly delete it.
|
// On other platforms, we need to explicitly delete it.
|
||||||
#else
|
#else
|
||||||
if (!aName.isEmpty() && (osl::FileBase::getFileURLFromSystemPath(aName, aName) == osl::FileBase::E_None))
|
if (!aName.isEmpty() && (osl::FileBase::getFileURLFromSystemPath(aName, aName) == osl::FileBase::E_None))
|
||||||
File::remove(aName);
|
osl::File::remove(aName);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -496,7 +494,7 @@ TempFileNamed::~TempFileNamed()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
File::remove( aName );
|
osl::File::remove(aName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -508,7 +506,7 @@ bool TempFileNamed::IsValid() const
|
|||||||
OUString TempFileNamed::GetFileName() const
|
OUString TempFileNamed::GetFileName() const
|
||||||
{
|
{
|
||||||
OUString aTmp;
|
OUString aTmp;
|
||||||
FileBase::getSystemPathFromFileURL(aName, aTmp);
|
osl::FileBase::getSystemPathFromFileURL(aName, aTmp);
|
||||||
return aTmp;
|
return aTmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -553,7 +551,7 @@ OUString SetTempNameBaseDirectory( const OUString &rBaseName )
|
|||||||
// try to create the directory
|
// try to create the directory
|
||||||
bool bRet = false;
|
bool bRet = false;
|
||||||
osl::FileBase::RC err = osl::Directory::create( aUnqPath );
|
osl::FileBase::RC err = osl::Directory::create( aUnqPath );
|
||||||
if ( err != FileBase::E_None && err != FileBase::E_EXIST )
|
if (err != osl::FileBase::E_None && err != osl::FileBase::E_EXIST)
|
||||||
// perhaps parent(s) don't exist
|
// perhaps parent(s) don't exist
|
||||||
bRet = ensuredir( aUnqPath );
|
bRet = ensuredir( aUnqPath );
|
||||||
else
|
else
|
||||||
@@ -572,7 +570,7 @@ OUString SetTempNameBaseDirectory( const OUString &rBaseName )
|
|||||||
gTempNameBase_Impl = ensureTrailingSlash(aBase.aName);
|
gTempNameBase_Impl = ensureTrailingSlash(aBase.aName);
|
||||||
|
|
||||||
// return system path of used directory
|
// return system path of used directory
|
||||||
FileBase::getSystemPathFromFileURL(gTempNameBase_Impl, aTmp);
|
osl::FileBase::getSystemPathFromFileURL(gTempNameBase_Impl, aTmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
return aTmp;
|
return aTmp;
|
||||||
|
Reference in New Issue
Block a user