summaryrefslogtreecommitdiff
path: root/tools/source/fsys/tempfile.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'tools/source/fsys/tempfile.cxx')
-rw-r--r--tools/source/fsys/tempfile.cxx31
1 files changed, 15 insertions, 16 deletions
diff --git a/tools/source/fsys/tempfile.cxx b/tools/source/fsys/tempfile.cxx
index 1aaac1863681..bfc1a0df5e43 100644
--- a/tools/source/fsys/tempfile.cxx
+++ b/tools/source/fsys/tempfile.cxx
@@ -19,7 +19,6 @@
#include <tools/tempfile.hxx>
-#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/file.hxx>
#include <rtl/instance.hxx>
@@ -34,7 +33,7 @@ namespace { struct TempNameBase_Impl : public rtl::Static< OUString, TempNameBas
struct TempFile_Impl
{
- String aName;
+ OUString aName;
};
OUString ConstructTempDir_Impl()
@@ -52,16 +51,16 @@ OUString ConstructTempDir_Impl()
return aName;
}
-void CreateTempName_Impl( String& rName, sal_Bool bKeep, sal_Bool bDir = sal_True )
+void CreateTempName_Impl( OUString& rName, bool bKeep, bool bDir = true )
{
// add a suitable tempname
// Prefix can have 5 chars, leaving 3 for numbers. 26 ** 3 == 17576
// ER 13.07.00 why not radix 36 [0-9A-Z] ?!?
const unsigned nRadix = 26;
- String aName( rName );
- aName += OUString("sv");
+ OUString aName( rName );
+ aName += "sv";
- rName.Erase();
+ rName = "";
static unsigned long u = Time::GetSystemTicks();
for ( unsigned long nOld = u; ++u != nOld; )
{
@@ -107,38 +106,38 @@ void CreateTempName_Impl( String& rName, sal_Bool bKeep, sal_Bool bDir = sal_Tru
}
}
-String TempFile::CreateTempName()
+OUString TempFile::CreateTempName()
{
// get correct directory
- String aName = ConstructTempDir_Impl();
+ OUString aName = ConstructTempDir_Impl();
// get TempFile name with default naming scheme
- CreateTempName_Impl( aName, sal_False );
+ CreateTempName_Impl( aName, false );
return aName;
}
TempFile::TempFile()
: pImp( new TempFile_Impl )
- , bKillingFileEnabled( sal_False )
+ , bKillingFileEnabled( false )
{
// get correct directory
pImp->aName = ConstructTempDir_Impl();
// get TempFile with default naming scheme
- CreateTempName_Impl( pImp->aName, sal_True, false );
+ CreateTempName_Impl( pImp->aName, true, false );
}
-TempFile::TempFile( const String& rLeadingChars, const String* pExtension )
+TempFile::TempFile( const OUString& rLeadingChars, const OUString* pExtension )
: pImp( new TempFile_Impl )
- , bKillingFileEnabled( sal_False )
+ , bKillingFileEnabled( false )
{
// get correct directory
- String aName = ConstructTempDir_Impl();
+ OUString aName = ConstructTempDir_Impl();
// now use special naming scheme ( name takes leading chars and an index counting up from zero
aName += rLeadingChars;
- for ( sal_Int32 i=0;; i++ )
+ for ( sal_Int32 i=0; ; i++ )
{
OUStringBuffer aTmpBuffer(aName);
aTmpBuffer.append(i);
@@ -172,7 +171,7 @@ TempFile::~TempFile()
delete pImp;
}
-String TempFile::GetName() const
+OUString TempFile::GetName() const
{
OUString aTmp;
aTmp = pImp->aName;