diff options
Diffstat (limited to 'tools/source/fsys')
-rw-r--r-- | tools/source/fsys/dirent.cxx | 257 | ||||
-rw-r--r-- | tools/source/fsys/tdir.cxx | 52 | ||||
-rw-r--r-- | tools/source/fsys/tempfile.cxx | 33 | ||||
-rw-r--r-- | tools/source/fsys/unx.cxx | 19 | ||||
-rw-r--r-- | tools/source/fsys/urlobj.cxx | 139 | ||||
-rw-r--r-- | tools/source/fsys/wntmsc.cxx | 40 | ||||
-rw-r--r-- | tools/source/fsys/wntmsc.hxx | 4 |
7 files changed, 19 insertions, 525 deletions
diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx index a188569868e1..ea3db76c5c07 100644 --- a/tools/source/fsys/dirent.cxx +++ b/tools/source/fsys/dirent.cxx @@ -331,6 +331,7 @@ ByteString ImplCutPath( const ByteString& rStr, sal_uInt16 nMax, char cAccDel ) return aCutPath; } +#if defined(WNT) /************************************************************************* |* |* DirEntry::ImpParseOs2Name() @@ -402,9 +403,15 @@ FSysError DirEntry::ImpParseOs2Name( const ByteString& rPfad, FSysPathStyle eSty else { // liegt ein anderes Drive auf dem Stack? - if ( aStack.Count() && - COMPARE_EQUAL != aStack.Bottom()->aName.CompareIgnoreCaseToAscii(aName) ) - aStack.Clear(); + if ( aStack.Count() ) + { + rtl::OString aThis(aStack.Bottom()->aName); + aThis = aThis.toAsciiLowerCase(); + rtl::OString aOther(aName); + aOther = aOther.toAsciiLowerCase(); + if (aThis.compareTo(aOther) != 0) + aStack.Clear(); + } // liegt jetzt nichts mehr auf dem Stack? if ( !aStack.Count() ) @@ -502,6 +509,7 @@ FSysError DirEntry::ImpParseOs2Name( const ByteString& rPfad, FSysPathStyle eSty aName = rPfad; return nErr; } +#endif /************************************************************************* |* @@ -662,7 +670,6 @@ DirEntry::DirEntry( const String& rInitName, FSysPathStyle eStyle ) } #ifdef DBG_UTIL - // ASF nur bei Default eStyle, nicht z.B. aus MakeShortName() if( eStyle == FSYS_STYLE_HOST && aTmpName.Search( "://" ) != STRING_NOTFOUND ) { @@ -709,7 +716,6 @@ DirEntry::DirEntry( const ByteString& rInitName, FSysPathStyle eStyle ) } #ifdef DBG_UTIL else - // ASF nur bei Default eStyle, nicht z.B. aus MakeShortName() if( eStyle == FSYS_STYLE_HOST && rInitName.Search( "://" ) != STRING_NOTFOUND ) { @@ -1129,31 +1135,6 @@ String DirEntry::CutName( FSysPathStyle eStyle ) /************************************************************************* |* -|* DirEntry::NameCompare -|* -|* Beschreibung Vergleich nur die Namen (ohne Pfad, aber mit Gross/Klein) -|* -*************************************************************************/ - -StringCompare DirEntry::NameCompare( const DirEntry &rWith ) const -{ - ByteString aThisName; - ByteString aParameterName; - -#ifdef UNX - aThisName = aName; - aParameterName = rWith.aName; -#else - aThisName = ByteString(aName).ToLowerAscii(); - aParameterName = ByteString(rWith.aName).ToLowerAscii(); -#endif - - return aThisName.CompareTo( aParameterName ); -} - - -/************************************************************************* -|* |* DirEntry::operator==() |* *************************************************************************/ @@ -1369,31 +1350,6 @@ void DirEntry::SetExtension( const String& rExtension, char cSep ) /************************************************************************* |* -|* DirEntry::CutExtension() -|* -*************************************************************************/ - -String DirEntry::CutExtension( char cSep ) -{ - DBG_CHKTHIS( DirEntry, ImpCheckDirEntry ); - - const char *p0 = ( aName.GetBuffer() ); - const char *p1 = p0 + aName.Len() - 1; - while ( p1 >= p0 && *p1 != cSep ) - p1--; - - if ( p1 >= p0 ) - { - // es wurde ein cSep an der Position p1 gefunden - aName.Erase( static_cast< xub_StrLen >(p1-p0) ); - return String(p1 + 1, osl_getThreadTextEncoding()); - } - - return String(); -} - -/************************************************************************* -|* |* DirEntry::SetName() |* *************************************************************************/ @@ -1728,6 +1684,7 @@ const DirEntry &DirEntry::operator[]( sal_uInt16 nParentLevel ) const return *pRes; } +#if !defined(WNT) /************************************************************************* |* |* DirEntry::ImpParseUnixName() @@ -1843,200 +1800,12 @@ FSysError DirEntry::ImpParseUnixName( const ByteString& rPfad, FSysPathStyle eSt return FSYS_ERR_OK; } - -/************************************************************************* -|* -|* DirEntry::MakeShortName() -|* -*************************************************************************/ - -ErrCode CreateEntry_Impl( const DirEntry &rPath, DirEntryKind eKind ) -{ - // versuchen, anzulegen (ausser bei FSYS_KIND_ALL) - ErrCode eErr = ERRCODE_NONE; - if ( FSYS_KIND_FILE == eKind ) - { - SvFileStream aStream( rPath.GetFull(), STREAM_STD_WRITE ); - aStream.WriteLine( "" ); - eErr = aStream.GetError(); - } - else if ( FSYS_KIND_ALL != eKind ) - eErr = rPath.MakeDir() ? ERRCODE_NONE : ERRCODE_IO_UNKNOWN; - - // erfolgreich? - if ( !rPath.Exists() ) - eErr = ERRCODE_IO_UNKNOWN; // Doch was schiefgegangen ? - - // ggf. wieder l"oschen - if ( FSYS_KIND_NONE == eKind ) - rPath.Kill(); - - // Fehlercode zur?ckliefern - return eErr; -} - -sal_Bool IsValidEntry_Impl( const DirEntry &rPath, - const String &rLongName, - DirEntryKind eKind, - sal_Bool bIsShortened, - sal_Bool bUseDelim ) -{ - // Parameter-Pr"uefung - DBG_ASSERT( eKind == FSYS_KIND_NONE || eKind == FSYS_KIND_ALL || - eKind == FSYS_KIND_FILE || eKind == FSYS_KIND_DIR, - "invalid entry-kind" ); - - // Alle von MSDOS erreichbaren FSYS_STYLES muessen den - // MSDOS Filenamenanforderungen genuegen. Sonst wird probiert, - // ob sich eine Datei des gewuenschten Names anlegen laesst. - FSysPathStyle eStyle = DirEntry::GetPathStyle( rPath.GetDevice().GetName() ); - DirEntry aPath(rPath); - DirEntry aName(rLongName, eStyle); - if ( !aName.IsValid() || aName.Level() != 1 ) - return sal_False; - aPath += aName; - if ( 1 == aPath.Level() ) - return sal_False; - - // Pfad-Trenner sind nicht erlaubt (bei ungek"urzten auch nicht FSYS_SHORTNAME_DELIMITER) - char cDelim = bUseDelim == 2 ? FSYS_SHORTNAME_DELIMITER : char(0); - if ( - rLongName.Search(DirEntry::GetAccessDelimiter()) != STRING_NOTFOUND || - (!bIsShortened && rLongName.Search(cDelim) != STRING_NOTFOUND) - ) - { - return sal_False; - } - - // MI: Abfrage nach 'CON:' etc. wird jetzt in Exists() mitgemacht - if ( aPath.Exists() ) - return sal_False; - - return (ERRCODE_NONE == CreateEntry_Impl( aPath, eKind )); -} - -//------------------------------------------------------------------------- +#endif #define MAX_EXT_MAX 250 #define MAX_LEN_MAX 255 #define INVALID_CHARS_DEF "\\/\"':|^<>?*" -sal_Bool DirEntry::MakeShortName( const String& rLongName, DirEntryKind eKind, - sal_Bool bUseDelim, FSysPathStyle eStyle ) -{ - String aLongName(rLongName); - - // Alle '#' aus den Dateinamen entfernen, weil das INetURLObject - // damit Probleme hat. Siehe auch #51246# - aLongName.EraseAllChars( '#' ); - ByteString bLongName(aLongName, osl_getThreadTextEncoding()); - - // Auf Novell-Servern (wegen der rottigen Clients) nur 7bit ASCII - - // bei FSYS_KIND_ALL den alten Namen merken und abh"angen (rename) - ByteString aOldName; - if ( FSYS_KIND_ALL == eKind ) - { - aOldName = ByteString(CutName(), osl_getThreadTextEncoding()); - aOldName = CMP_LOWER(aOldName); - } - - // ist der Langname direkt verwendbar? - if ( IsValidEntry_Impl( *this, aLongName, eKind, sal_False, bUseDelim ) ) - { - operator+=( DirEntry(aLongName) ); - return sal_True; - } - - // max L"angen feststellen - sal_uInt16 nMaxExt, nMaxLen; - if ( FSYS_STYLE_DETECT == eStyle ) - eStyle = DirEntry::GetPathStyle( GetDevice().GetName() ); - ByteString aInvalidChars; - nMaxExt = MAX_EXT_MAX; - nMaxLen = MAX_LEN_MAX; - aInvalidChars = INVALID_CHARS_DEF; - - // Extension abschneiden und kuerzen - ByteString aExt; - ByteString aFName = bLongName; - DirEntry aUnparsed; - aUnparsed.aName = bLongName; - aExt = ByteString(aUnparsed.CutExtension(), osl_getThreadTextEncoding()); - aFName = aUnparsed.aName; - if ( aExt.Len() > nMaxExt ) - { - char c = aExt.GetChar( aExt.Len() - 1 ); - aExt.Erase(nMaxExt-1); - aExt += c; - } - - // ausser auf einem FAT-System geh"ort die Extension zur - // Maxl"ange. Muss also vorher mit dem Punkt abgezogen werden. - nMaxLen -= ( aExt.Len() + 1 ); - - // Name k"urzen - ByteString aSName; - for ( const char *pc = aFName.GetBuffer(); aSName.Len() < nMaxLen && *pc; ++pc ) - { - if ( STRING_NOTFOUND == aInvalidChars.Search( *pc ) && - (unsigned char) *pc >= (unsigned char) 32 && - ( !aSName.Len() || *pc != ' ' || aSName.GetChar(aSName.Len()-1) != ' ' ) ) - aSName += *pc; - } - aSName.EraseTrailingChars(); - - // HRO: #74246# Also cut leading spaces - aSName.EraseLeadingChars(); - - if ( !aSName.Len() ) - aSName = "noname"; - - // kommt dabei der alte Name raus? - ByteString aNewName = aSName; - if ( aExt.Len() ) - ( aNewName += '.' ) += aExt; - operator+=( DirEntry(String(aNewName, osl_getThreadTextEncoding())) ); - if ( FSYS_KIND_ALL == eKind && CMP_LOWER(aName) == aOldName ) - if ( FSYS_KIND_ALL == eKind && CMP_LOWER(ByteString(GetName(), osl_getThreadTextEncoding())) == aOldName ) - return sal_True; - - // kann der gek"urzte Name direkt verwendet werden? - if ( !Exists() && (ERRCODE_NONE == CreateEntry_Impl( *this, eKind )) ) - return sal_True; - - // darf '?##' verwendet werden, um eindeutigen Name zu erzeugen? - if ( bUseDelim ) - { - // eindeutigen Namen per '?##' erzeugen - aSName.Erase( nMaxLen-3 ); - if ( bUseDelim != 2 ) - aSName += FSYS_SHORTNAME_DELIMITER; - for ( int n = 1; n < 99; ++n ) - { - // Name zusammensetzen - ByteString aTmpStr( aSName ); - aTmpStr += ByteString::CreateFromInt32(n); - if ( aExt.Len() ) - ( aTmpStr += '.' ) += aExt; - - // noch nicht vorhanden? - SetName( String(aTmpStr, osl_getThreadTextEncoding()) ); - - if ( !Exists() ) - { - // Fehler setzen !!! - nError = CreateEntry_Impl( *this, eKind ); - return (ERRCODE_NONE == nError); - } - } - } - - // keine ## mehr frei / ?## soll nicht verwendet werden - nError = ERRCODE_IO_ALREADYEXISTS; - return sal_False; -} - /************************************************************************* |* |* DirEntry::CreatePath() diff --git a/tools/source/fsys/tdir.cxx b/tools/source/fsys/tdir.cxx index 6d16a5ed605a..db811f35e76b 100644 --- a/tools/source/fsys/tdir.cxx +++ b/tools/source/fsys/tdir.cxx @@ -386,27 +386,6 @@ sal_uInt16 Dir::Scan( sal_uInt16 nCount ) |* *************************************************************************/ -Dir::Dir( const DirEntry& rDirEntry, DirEntryKind nKindFlags, FSysSort nSort, ... ): - DirEntry( rDirEntry ), - pReader( 0 ) -{ - DBG_CTOR( Dir, NULL ); - - Construct( nKindFlags ); - - std::va_list pArgs; - va_start( pArgs, nSort ); - ImpSetSort( pArgs, nSort ); - - Reset(); -} - -/************************************************************************* -|* -|* Dir::Dir() -|* -*************************************************************************/ - Dir::Dir( const DirEntry& rDirEntry, DirEntryKind nKindFlags ): DirEntry( rDirEntry ), pReader( 0 ) @@ -419,24 +398,6 @@ Dir::Dir( const DirEntry& rDirEntry, DirEntryKind nKindFlags ): /************************************************************************* |* -|* Dir::Dir() -|* -*************************************************************************/ - -Dir::Dir(): - pReader( 0 ) -{ - DBG_CTOR( Dir, NULL ); - - pLst = NULL; - pSortLst = NULL; - pStatLst = NULL; - eAttrMask = FSYS_KIND_ALL; - aNameMask = String("*", osl_getThreadTextEncoding()); -} - -/************************************************************************* -|* |* Dir::~Dir() |* *************************************************************************/ @@ -587,19 +548,6 @@ FSysError Dir::ImpSetSort( std::va_list pArgs, int nFirstSort ) /************************************************************************* |* -|* Dir::SetSort() -|* -*************************************************************************/ - -FSysError Dir::SetSort( FSysSort nSort, ... ) -{ - std::va_list pArgs; - va_start( pArgs, nSort ); - return ImpSetSort( pArgs, nSort ); -} - -/************************************************************************* -|* |* Dir::operator[]() |* *************************************************************************/ diff --git a/tools/source/fsys/tempfile.cxx b/tools/source/fsys/tempfile.cxx index 078e91834975..b6a4b1e2b70e 100644 --- a/tools/source/fsys/tempfile.cxx +++ b/tools/source/fsys/tempfile.cxx @@ -267,37 +267,4 @@ String TempFile::GetName() const return aTmp; } -String TempFile::SetTempNameBaseDirectory( const String &rBaseName ) -{ - String aName( rBaseName ); - - ::rtl::OUString& rTempNameBase_Impl = TempNameBase_Impl::get(); - - FileBase::RC err= Directory::create( aName ); - if ( err == FileBase::E_None || err == FileBase::E_EXIST ) - { - rTempNameBase_Impl = aName; - rTempNameBase_Impl += String( '/' ); - - TempFile aBase( NULL, sal_True ); - if ( aBase.IsValid() ) - rTempNameBase_Impl = aBase.pImp->aName; - } - - rtl::OUString aTmp; - aTmp = rTempNameBase_Impl; - return aTmp; -} - -String TempFile::GetTempNameBaseDirectory() -{ - ::rtl::OUString& rTempNameBase_Impl = TempNameBase_Impl::get(); - if ( !rTempNameBase_Impl.getLength() ) - rTempNameBase_Impl = GetSystemTempDir_Impl(); - - rtl::OUString aTmp; - aTmp = rTempNameBase_Impl; - return aTmp; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/tools/source/fsys/unx.cxx b/tools/source/fsys/unx.cxx index b04a2e64904a..0adc7ce8fa03 100644 --- a/tools/source/fsys/unx.cxx +++ b/tools/source/fsys/unx.cxx @@ -44,7 +44,7 @@ extern "C" int mntctl( int cmd, size_t size, char* buf ); #elif defined(NETBSD) #include <sys/mount.h> #elif defined(FREEBSD) || defined(MACOSX) || defined(OPENBSD) || \ - defined(DRAGONFLY) + defined(DRAGONFLY) || defined(IOS) struct mnttab { char *mnt_dir; @@ -85,7 +85,7 @@ struct mymnttab #if defined(NETBSD) || defined(FREEBSD) || defined(MACOSX) || \ - defined(OPENBSD) || defined(DRAGONFLY) + defined(OPENBSD) || defined(DRAGONFLY) || defined(IOS) sal_Bool GetMountEntry(dev_t /* dev */, struct mymnttab * /* mytab */ ) { DBG_WARNING( "Sorry, not implemented: GetMountEntry" ); @@ -478,7 +478,7 @@ const char *TempDirImpl( char *pBuf ) |* *************************************************************************/ -FSysPathStyle DirEntry::GetPathStyle( const String & ) +FSysPathStyle DirEntry::GetPathStyle() { return FSYS_STYLE_UNX; } @@ -521,17 +521,4 @@ void FileStat::SetDateTime( const String& rFileName, } } -//========================================================================= - -ErrCode FileStat::QueryDiskSpace( const String &, BigInt &, BigInt & ) -{ - return ERRCODE_IO_NOTSUPPORTED; -} - -//========================================================================= - -void FSysEnableSysErrorBox( sal_Bool ) -{ -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index 6a855d7d85c8..bf3cf2e95a4d 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -2909,29 +2909,6 @@ bool INetURLObject::parseHostOrNetBiosName( } //============================================================================ -// static -rtl::OUString INetURLObject::encodeHostPort(rtl::OUString const & rTheHostPort, - bool bOctets, - EncodeMechanism eMechanism, - rtl_TextEncoding eCharset) -{ - sal_Int32 nPort = rTheHostPort.getLength(); - if (nPort != 0) - { - sal_Int32 i = nPort - 1; - while (i != 0 && INetMIME::isDigit(rTheHostPort.getStr()[i])) - --i; - if (rTheHostPort.getStr()[i] == ':') - nPort = i; - } - rtl::OUString aResult(encodeText(rTheHostPort.copy(0, nPort), bOctets, - PART_HOST_EXTRA, '%', eMechanism, eCharset, - true)); - aResult += rTheHostPort.copy(nPort); - return aResult; -} - -//============================================================================ bool INetURLObject::setHost(rtl::OUString const & rTheHost, bool bOctets, EncodeMechanism eMechanism, rtl_TextEncoding eCharset) @@ -3706,31 +3683,6 @@ bool INetURLObject::setFragment(rtl::OUString const & rTheFragment, } //============================================================================ -INetURLObject::FTPType INetURLObject::getFTPType() const -{ - if (m_eScheme == INET_PROT_FTP - && m_aPath.getLength() >= RTL_CONSTASCII_LENGTH(";type=") + 1 - && rtl::OUString(m_aAbsURIRef).copy( - m_aPath.getEnd() - (RTL_CONSTASCII_LENGTH(";type=") + 1), - RTL_CONSTASCII_LENGTH(";type=")).equalsIgnoreAsciiCaseAscii(";type=")) - switch (m_aAbsURIRef.charAt(m_aPath.getEnd())) - { - case 'A': - case 'a': - return FTP_TYPE_A; - - case 'D': - case 'd': - return FTP_TYPE_D; - - case 'I': - case 'i': - return FTP_TYPE_I; - } - return FTP_TYPE_NONE; -} - -//============================================================================ bool INetURLObject::hasDosVolume(FSysStyle eStyle) const { sal_Unicode const * p = m_aAbsURIRef.getStr() + m_aPath.getBegin(); @@ -3743,33 +3695,6 @@ bool INetURLObject::hasDosVolume(FSysStyle eStyle) const } //============================================================================ -sal_uInt32 INetURLObject::getIMAPUID() const -{ - if (m_eScheme == INET_PROT_IMAP - && m_aPath.getLength() >= RTL_CONSTASCII_LENGTH("/;uid=") + 1) - { - sal_Unicode const * pBegin = m_aAbsURIRef.getStr() - + m_aPath.getBegin() - + RTL_CONSTASCII_LENGTH("/;uid="); - sal_Unicode const * pEnd = pBegin + m_aPath.getLength(); - sal_Unicode const * p = pEnd; - while (p > pBegin && INetMIME::isDigit(p[-1])) - --p; - if (p < pEnd && *--p != '0' - && rtl::OUString(m_aAbsURIRef).copy( - p - RTL_CONSTASCII_LENGTH("/;uid=") - m_aAbsURIRef.getStr(), - RTL_CONSTASCII_LENGTH("/;uid=")).equalsIgnoreAsciiCaseAscii("/;uid=") - ) - { - sal_uInt32 nUID; - if (INetMIME::scanUnsigned(p, pEnd, false, nUID)) - return nUID; - } - } - return 0; -} - -//============================================================================ // static rtl::OUString INetURLObject::encodeText(sal_Unicode const * pBegin, sal_Unicode const * pEnd, bool bOctets, @@ -4369,22 +4294,6 @@ bool INetURLObject::hasPassword() const } //============================================================================ -void INetURLObject::makeAuthCanonic() -{ - if (m_eScheme == INET_PROT_IMAP && m_aAuth.getLength() == 1 - && m_aAbsURIRef.charAt(m_aAuth.getBegin()) == '*') - { - lcl_Erase(m_aAbsURIRef, m_aAuth.getBegin() - - RTL_CONSTASCII_LENGTH(";AUTH="), - RTL_CONSTASCII_LENGTH(";AUTH=*")); - sal_Int32 nDelta = m_aAuth.clear() - RTL_CONSTASCII_LENGTH(";AUTH="); - m_aPath += nDelta; - m_aQuery += nDelta; - m_aFragment += nDelta; - } -} - -//============================================================================ rtl::OUString INetURLObject::GetHostPort(DecodeMechanism eMechanism, rtl_TextEncoding eCharset) { @@ -4441,33 +4350,6 @@ bool INetURLObject::SetPort(sal_uInt32 nThePort) } //============================================================================ -void INetURLObject::makePortCanonic() -{ - if (m_aPort.isPresent()) - { - sal_Unicode const * p = m_aAbsURIRef.getStr() + m_aPort.getBegin(); - sal_Unicode const * pEnd = p + m_aPort.getLength(); - sal_uInt32 nThePort; - if (INetMIME::scanUnsigned(p, pEnd, true, nThePort) && p == pEnd) - { - sal_Int32 nDelta; - if (nThePort != 0 && nThePort == getSchemeInfo().m_nDefaultPort) - { - lcl_Erase(m_aAbsURIRef, m_aPort.getBegin() - 1, - m_aPort.getLength() + 1); - nDelta = m_aPort.clear() - 1; - } - else - nDelta = m_aPort.set(m_aAbsURIRef, - rtl::OUString::valueOf(sal_Int64(nThePort))); - m_aPath += nDelta; - m_aQuery += nDelta; - m_aFragment += nDelta; - } - } -} - -//============================================================================ sal_Int32 INetURLObject::getSegmentCount(bool bIgnoreFinalSlash) const { if (!checkHierarchical()) @@ -5137,19 +5019,6 @@ rtl::OUString INetURLObject::getFSysPath(FSysStyle eStyle, } //============================================================================ -bool INetURLObject::HasMsgId() const -{ - if (m_eScheme != INET_PROT_POP3) - return false; - sal_Unicode const * p = m_aAbsURIRef.getStr() + m_aPath.getBegin(); - sal_Unicode const * pEnd = p + m_aPath.getLength(); - for (; p < pEnd; ++p) - if (*p == '<') - return true; - return false; -} - -//============================================================================ rtl::OUString INetURLObject::GetMsgId(DecodeMechanism eMechanism, rtl_TextEncoding eCharset) const { @@ -5593,14 +5462,6 @@ void INetURLObject::SetName(rtl::OUString const & rTheName, } //============================================================================ -rtl::OUString INetURLObject::CutName(DecodeMechanism eMechanism, - rtl_TextEncoding eCharset) -{ - rtl::OUString aTheName(getName(LAST_SEGMENT, true, eMechanism, eCharset)); - return removeSegment(LAST_SEGMENT, true) ? aTheName : rtl::OUString(); -} - -//============================================================================ void INetURLObject::SetExtension(rtl::OUString const & rTheExtension, EncodeMechanism eMechanism, rtl_TextEncoding eCharset) diff --git a/tools/source/fsys/wntmsc.cxx b/tools/source/fsys/wntmsc.cxx index fa18aa46fcf1..ab783b45a161 100644 --- a/tools/source/fsys/wntmsc.cxx +++ b/tools/source/fsys/wntmsc.cxx @@ -114,7 +114,7 @@ int closedir( DIR *pDir ) |* *************************************************************************/ -FSysPathStyle DirEntry::GetPathStyle( const String & ) +FSysPathStyle DirEntry::GetPathStyle() { return FSYS_STYLE_NTFS; } @@ -872,42 +872,4 @@ const char* TempDirImpl( char *pBuf ) return pBuf; } -//======================================================================= - -ErrCode FileStat::QueryDiskSpace( const String &rPath, - BigInt &rFreeBytes, BigInt &rTotalBytes ) -{ - DWORD nSectorsPerCluster; /* address of sectors per cluster */ - DWORD nBytesPerSector; /* address of bytes per sector */ - DWORD nFreeClusters; /* address of number of free clusters */ - DWORD nClusters; /* address of total number of clusters */ - - ByteString aVol( DirEntry(rPath).ImpGetTopPtr()->GetName(), osl_getThreadTextEncoding()); - bool bOK = GetDiskFreeSpace( aVol.GetBuffer(), - &nSectorsPerCluster, &nBytesPerSector, - &nFreeClusters, &nClusters ); - if ( !bOK ) - return Sys2SolarError_Impl( GetLastError() ); - - BigInt aBytesPerCluster( BigInt(nSectorsPerCluster) * - BigInt(nBytesPerSector) ); - rFreeBytes = aBytesPerCluster * BigInt(nFreeClusters); - rTotalBytes = aBytesPerCluster * BigInt(nClusters); - return 0; -} - -//========================================================================= - -void FSysEnableSysErrorBox( sal_Bool bEnable ) -{ // Preserve other Bits!! - sal_uInt32 nErrorMode = SetErrorMode( bEnable ? 0 : SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX ); - if ( bEnable ) - nErrorMode &= ~(SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX); - else - nErrorMode |= (SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX); - SetErrorMode( nErrorMode ); -} - - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/tools/source/fsys/wntmsc.hxx b/tools/source/fsys/wntmsc.hxx index ba88e4eaf020..43b700fe17be 100644 --- a/tools/source/fsys/wntmsc.hxx +++ b/tools/source/fsys/wntmsc.hxx @@ -34,8 +34,8 @@ #ifndef ICC #include <io.h> #endif -#include <sys\types.h> -#include <sys\stat.h> +#include <sys/types.h> +#include <sys/stat.h> #include <direct.h> #include <windows.h> |