summaryrefslogtreecommitdiff
path: root/tools/source/fsys
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2013-06-29 23:57:38 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2013-06-30 04:58:49 +0000
commit710f41b7aec8e7d35a0da8be332aa289f98942af (patch)
treeb894ef2d3f06a63a85f423b2713a654ea57f9c69 /tools/source/fsys
parent1ca3beae12a7f222c987481e07a544845fc9fd46 (diff)
Clean String and sal_Bool in tools
Change-Id: I6a92196f33d7a5278c7dcc426112e9c56d582655 Reviewed-on: https://gerrit.libreoffice.org/4627 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'tools/source/fsys')
-rw-r--r--tools/source/fsys/tempfile.cxx31
-rw-r--r--tools/source/fsys/wldcrd.cxx8
2 files changed, 19 insertions, 20 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;
diff --git a/tools/source/fsys/wldcrd.cxx b/tools/source/fsys/wldcrd.cxx
index a38c66eda085..e7311eab38c2 100644
--- a/tools/source/fsys/wldcrd.cxx
+++ b/tools/source/fsys/wldcrd.cxx
@@ -86,7 +86,7 @@ sal_uInt16 WildCard::ImpMatch( const char *pWild, const char *pStr ) const
return ( *pStr == '\0' ) && ( *pWild == '\0' );
}
-sal_Bool WildCard::Matches( const String& rString ) const
+bool WildCard::Matches( const OUString& rString ) const
{
OString aTmpWild = aWildString;
OString aString(OUStringToOString(rString, osl_getThreadTextEncoding()));
@@ -99,15 +99,15 @@ sal_Bool WildCard::Matches( const String& rString ) const
{
// Check all splitted wildcards
if ( ImpMatch( aTmpWild.copy( 0, nSepPos ).getStr(), aString.getStr() ) )
- return sal_True;
+ return true;
aTmpWild = aTmpWild.copy(nSepPos + 1); // remove separator
}
}
if ( ImpMatch( aTmpWild.getStr(), aString.getStr() ) )
- return sal_True;
+ return true;
else
- return sal_False;
+ return false;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */