LibreOffice: osl/file.hxx Source File

LibreOffice LibreOffice 7.4 SDK C/C++ API Reference

Loading...
Searching...
No Matches
file.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20/*
21 * This file is part of LibreOffice published API.
22 */
23
24#ifndef INCLUDED_OSL_FILE_HXX
25#define INCLUDED_OSL_FILE_HXX
26
27#include "sal/config.h"
28
29#include <string.h>
30
31#include <cstddef>
32
33#include "sal/log.hxx"
34#include "osl/time.h"
35#include "rtl/ustring.hxx"
36
37#include "osl/file.h"
38#include "osl/diagnose.h"
39
40namespace rtl { class ByteSequence; }
41
42namespace osl
43{
44
45
53 class FileBase
54{
55public:
56
57 enum RC {
58 E_None = osl_File_E_None,
59 E_PERM = osl_File_E_PERM,
60 E_NOENT = osl_File_E_NOENT,
61 E_SRCH = osl_File_E_SRCH,
62 E_INTR = osl_File_E_INTR,
63 E_IO = osl_File_E_IO,
64 E_NXIO = osl_File_E_NXIO,
65 E_2BIG = osl_File_E_2BIG,
66 E_NOEXEC = osl_File_E_NOEXEC,
67 E_BADF = osl_File_E_BADF,
68 E_CHILD = osl_File_E_CHILD,
69 E_AGAIN = osl_File_E_AGAIN,
70 E_NOMEM = osl_File_E_NOMEM,
71 E_ACCES = osl_File_E_ACCES,
72 E_FAULT = osl_File_E_FAULT,
73 E_BUSY = osl_File_E_BUSY,
74 E_EXIST = osl_File_E_EXIST,
75 E_XDEV = osl_File_E_XDEV,
76 E_NODEV = osl_File_E_NODEV,
77 E_NOTDIR = osl_File_E_NOTDIR,
78 E_ISDIR = osl_File_E_ISDIR,
79 E_INVAL = osl_File_E_INVAL,
80 E_NFILE = osl_File_E_NFILE,
81 E_MFILE = osl_File_E_MFILE,
82 E_NOTTY = osl_File_E_NOTTY,
83 E_FBIG = osl_File_E_FBIG,
84 E_NOSPC = osl_File_E_NOSPC,
85 E_SPIPE = osl_File_E_SPIPE,
86 E_ROFS = osl_File_E_ROFS,
87 E_MLINK = osl_File_E_MLINK,
88 E_PIPE = osl_File_E_PIPE,
89 E_DOM = osl_File_E_DOM,
90 E_RANGE = osl_File_E_RANGE,
91 E_DEADLK = osl_File_E_DEADLK,
92 E_NAMETOOLONG = osl_File_E_NAMETOOLONG,
93 E_NOLCK = osl_File_E_NOLCK,
94 E_NOSYS = osl_File_E_NOSYS,
95 E_NOTEMPTY = osl_File_E_NOTEMPTY,
96 E_LOOP = osl_File_E_LOOP,
97 E_ILSEQ = osl_File_E_ILSEQ,
98 E_NOLINK = osl_File_E_NOLINK,
99 E_MULTIHOP = osl_File_E_MULTIHOP,
100 E_USERS = osl_File_E_USERS,
101 E_OVERFLOW = osl_File_E_OVERFLOW,
102 E_NOTREADY = osl_File_E_NOTREADY,
103 E_invalidError = osl_File_E_invalidError,
104 E_TIMEDOUT = osl_File_E_TIMEDOUT,
105 E_NETWORK = osl_File_E_NETWORK
106 };
107
108
109public:
110
131 static RC getCanonicalName( const ::rtl::OUString& ustrRequestedURL, ::rtl::OUString& ustrValidURL )
132 {
133 return static_cast< RC >( osl_getCanonicalName( ustrRequestedURL.pData, &ustrValidURL.pData ) );
134 }
135
170 static RC getAbsoluteFileURL( const ::rtl::OUString& ustrBaseDirectoryURL, const ::rtl::OUString& ustrRelativeFileURL, ::rtl::OUString& ustrAbsoluteFileURL )
171 {
172 return static_cast< RC >( osl_getAbsoluteFileURL( ustrBaseDirectoryURL.pData, ustrRelativeFileURL.pData, &ustrAbsoluteFileURL.pData ) );
173 }
174
189 static RC getSystemPathFromFileURL( const ::rtl::OUString& ustrFileURL, ::rtl::OUString& ustrSystemPath )
190 {
191 return static_cast< RC >( osl_getSystemPathFromFileURL( ustrFileURL.pData, &ustrSystemPath.pData ) );
192 }
193
208 static RC getFileURLFromSystemPath( const ::rtl::OUString& ustrSystemPath, ::rtl::OUString& ustrFileURL )
209 {
210 return static_cast< RC >( osl_getFileURLFromSystemPath( ustrSystemPath.pData, &ustrFileURL.pData ) );
211 }
212
240 static RC searchFileURL( const ::rtl::OUString& ustrFileName, const ::rtl::OUString& ustrSearchPath, ::rtl::OUString& ustrFileURL )
241 {
242 return static_cast< RC >( osl_searchFileURL( ustrFileName.pData, ustrSearchPath.pData, &ustrFileURL.pData ) );
243 }
244
254 static RC getTempDirURL( ::rtl::OUString& ustrTempDirURL )
255 {
256 return static_cast< RC >( osl_getTempDirURL( &ustrTempDirURL.pData ) );
257 }
258
306 static RC createTempFile(
307 ::rtl::OUString* pustrDirectoryURL,
308 oslFileHandle* pHandle,
309 ::rtl::OUString* pustrTempFileURL)
310 {
311 rtl_uString* pustr_dir_url = pustrDirectoryURL ? pustrDirectoryURL->pData : NULL;
312 rtl_uString** ppustr_tmp_file_url = pustrTempFileURL ? &pustrTempFileURL->pData : NULL;
313
314 return static_cast< RC >( osl_createTempFile(pustr_dir_url, pHandle, ppustr_tmp_file_url) );
315 }
316};
317
318
324 class VolumeDevice : public FileBase
325{
326 oslVolumeDeviceHandle _aHandle;
327
328public:
329
333 VolumeDevice() : _aHandle( NULL )
334 {
335 }
336
343 VolumeDevice( const VolumeDevice & rDevice )
344 {
345 _aHandle = rDevice._aHandle;
346 if ( _aHandle )
347 osl_acquireVolumeDeviceHandle( _aHandle );
348 }
349
353 ~VolumeDevice()
354 {
355 if ( _aHandle )
356 osl_releaseVolumeDeviceHandle( _aHandle );
357 }
358
365 VolumeDevice & operator =( const VolumeDevice & rDevice )
366 {
367 oslVolumeDeviceHandle newHandle = rDevice._aHandle;
368
369 if ( newHandle )
370 osl_acquireVolumeDeviceHandle( newHandle );
371
372 if ( _aHandle )
373 osl_releaseVolumeDeviceHandle( _aHandle );
374
375 _aHandle = newHandle;
376
377 return *this;
378 }
379
385 rtl::OUString getMountPath()
386 {
387 rtl::OUString aPath;
388 osl_getVolumeDeviceMountPath( _aHandle, &aPath.pData );
389 return aPath;
390 }
391
392 friend class VolumeInfo;
393};
394
395
396class Directory;
397
406 class VolumeInfo
407{
408 oslVolumeInfo _aInfo;
409 sal_uInt32 _nMask;
410 VolumeDevice _aDevice;
411
415 VolumeInfo( VolumeInfo& ) SAL_DELETED_FUNCTION;
416
420 VolumeInfo& operator = ( VolumeInfo& ) SAL_DELETED_FUNCTION;
421
422public:
423
429 VolumeInfo( sal_uInt32 nMask )
430 : _nMask( nMask )
431 {
432 memset( &_aInfo, 0, sizeof( oslVolumeInfo ));
433 _aInfo.uStructSize = sizeof( oslVolumeInfo );
434 _aInfo.pDeviceHandle = &_aDevice._aHandle;
435 }
436
437 ~VolumeInfo()
438 {
439 if( _aInfo.ustrFileSystemName )
440 rtl_uString_release( _aInfo.ustrFileSystemName );
441 }
442
450 bool isValid( sal_uInt32 nMask ) const
451 {
452 return ( nMask & _aInfo.uValidFields ) == nMask;
453 }
454
460 bool getRemoteFlag() const
461 {
462 return (_aInfo.uAttributes & osl_Volume_Attribute_Remote) != 0;
463 }
464
470 bool getRemoveableFlag() const
471 {
472 return (_aInfo.uAttributes & osl_Volume_Attribute_Removeable) != 0;
473 }
474
481 bool getCompactDiscFlag() const
482 {
483 return (_aInfo.uAttributes & osl_Volume_Attribute_CompactDisc) != 0;
484 }
485
492 bool getFloppyDiskFlag() const
493 {
494 return (_aInfo.uAttributes & osl_Volume_Attribute_FloppyDisk) != 0;
495 }
496
503 bool getFixedDiskFlag() const
504 {
505 return (_aInfo.uAttributes & osl_Volume_Attribute_FixedDisk) != 0;
506 }
507
514 bool getRAMDiskFlag() const
515 {
516 return (_aInfo.uAttributes & osl_Volume_Attribute_RAMDisk) != 0;
517 }
518
526 sal_uInt64 getTotalSpace() const
527 {
528 return _aInfo.uTotalSpace;
529 }
530
538 sal_uInt64 getFreeSpace() const
539 {
540 return _aInfo.uFreeSpace;
541 }
542
550 sal_uInt64 getUsedSpace() const
551 {
552 return _aInfo.uUsedSpace;
553 }
554
562 sal_uInt32 getMaxNameLength() const
563 {
564 return _aInfo.uMaxNameLength;
565 }
566
574 sal_uInt32 getMaxPathLength() const
575 {
576 return _aInfo.uMaxPathLength;
577 }
578
586 ::rtl::OUString getFileSystemName() const
587 {
588 return _aInfo.ustrFileSystemName ? ::rtl::OUString( _aInfo.ustrFileSystemName ) : ::rtl::OUString();
589 }
590
591
599 VolumeDevice getDeviceHandle() const
600 {
601 return _aDevice;
602 }
603
610 bool isCaseSensitiveFileSystem() const
611 {
612 return (_aInfo.uAttributes & osl_Volume_Attribute_Case_Sensitive) != 0;
613 }
614
622 bool isCasePreservingFileSystem() const
623 {
624 return (_aInfo.uAttributes & osl_Volume_Attribute_Case_Is_Preserved) != 0;
625 }
626
627 friend class Directory;
628};
629
630
631class DirectoryItem;
632
638 class FileStatus
639{
640 oslFileStatus _aStatus;
641 sal_uInt32 _nMask;
642
646 FileStatus( FileStatus& ) SAL_DELETED_FUNCTION;
647
651 FileStatus& operator = ( FileStatus& ) SAL_DELETED_FUNCTION;
652
653public:
654
655 enum Type {
656 Directory = osl_File_Type_Directory,
657 Volume = osl_File_Type_Volume,
658 Regular = osl_File_Type_Regular,
659 Fifo = osl_File_Type_Fifo,
660 Socket = osl_File_Type_Socket,
661 Link = osl_File_Type_Link,
662 Special = osl_File_Type_Special,
663 Unknown = osl_File_Type_Unknown
664 };
665
671 FileStatus(sal_uInt32 nMask)
672 : _nMask(nMask)
673 {
674 memset(&_aStatus, 0, sizeof(_aStatus));
675 _aStatus.uStructSize = sizeof(_aStatus);
676 }
677
680 ~FileStatus()
681 {
682 if ( _aStatus.ustrFileURL )
683 rtl_uString_release( _aStatus.ustrFileURL );
684 if ( _aStatus.ustrLinkTargetURL )
685 rtl_uString_release( _aStatus.ustrLinkTargetURL );
686 if ( _aStatus.ustrFileName )
687 rtl_uString_release( _aStatus.ustrFileName );
688 }
689
699 bool isValid( sal_uInt32 nMask ) const
700 {
701 return ( nMask & _aStatus.uValidFields ) == nMask;
702 }
703
709 Type getFileType() const
710 {
711 SAL_INFO_IF(
712 !isValid(osl_FileStatus_Mask_Type), "sal.osl",
713 "no FileStatus Type determined");
714 return isValid(osl_FileStatus_Mask_Type)
715 ? static_cast< Type >(_aStatus.eType) : Unknown;
716 }
717
727 bool isDirectory() const
728 {
729 return ( getFileType() == Directory || getFileType() == Volume );
730 }
731
742 bool isRegular() const
743 {
744 return ( getFileType() == Regular );
745 }
746
755 bool isLink() const
756 {
757 return ( getFileType() == Link );
758 }
759
766 sal_uInt64 getAttributes() const
767 {
768 SAL_INFO_IF(
769 !isValid(osl_FileStatus_Mask_Attributes), "sal.osl",
770 "no FileStatus Attributes determined");
771 return _aStatus.uAttributes;
772 }
773
781 TimeValue getCreationTime() const
782 {
783 SAL_INFO_IF(
784 !isValid(osl_FileStatus_Mask_CreationTime), "sal.osl",
785 "no FileStatus CreationTime determined");
786 return _aStatus.aCreationTime;
787 }
788
796 TimeValue getAccessTime() const
797 {
798 SAL_INFO_IF(
799 !isValid(osl_FileStatus_Mask_AccessTime), "sal.osl",
800 "no FileStatus AccessTime determined");
801 return _aStatus.aAccessTime;
802 }
803
811 TimeValue getModifyTime() const
812 {
813 SAL_INFO_IF(
814 !isValid(osl_FileStatus_Mask_ModifyTime), "sal.osl",
815 "no FileStatus ModifyTime determined");
816 return _aStatus.aModifyTime;
817 }
818
825 sal_uInt64 getFileSize() const
826 {
827 SAL_INFO_IF(
828 !isValid(osl_FileStatus_Mask_FileSize), "sal.osl",
829 "no FileStatus FileSize determined");
830 return _aStatus.uFileSize;
831 }
832
839 ::rtl::OUString getFileName() const
840 {
841 SAL_INFO_IF(
842 !isValid(osl_FileStatus_Mask_FileName), "sal.osl",
843 "no FileStatus FileName determined");
844 return isValid(osl_FileStatus_Mask_FileName)
845 ? rtl::OUString(_aStatus.ustrFileName) : rtl::OUString();
846 }
847
848
856 ::rtl::OUString getFileURL() const
857 {
858 SAL_INFO_IF(
859 !isValid(osl_FileStatus_Mask_FileURL), "sal.osl",
860 "no FileStatus FileURL determined");
861 return isValid(osl_FileStatus_Mask_FileURL)
862 ? rtl::OUString(_aStatus.ustrFileURL) : rtl::OUString();
863 }
864
872 ::rtl::OUString getLinkTargetURL() const
873 {
874 SAL_INFO_IF(
875 !isValid(osl_FileStatus_Mask_LinkTargetURL), "sal.osl",
876 "no FileStatus LinkTargetURL determined");
877 return isValid(osl_FileStatus_Mask_LinkTargetURL)
878 ? rtl::OUString(_aStatus.ustrLinkTargetURL) : rtl::OUString();
879 }
880
881 friend class DirectoryItem;
882};
883
884
891 class File: public FileBase
892{
893 oslFileHandle _pData;
894 ::rtl::OUString _aPath;
895
899 File( File& ) SAL_DELETED_FUNCTION;
900
904 File& operator = ( File& ) SAL_DELETED_FUNCTION;
905
906public:
907
914 File( const ::rtl::OUString& ustrFileURL ): _pData( NULL ), _aPath( ustrFileURL ) {}
915
919 ~File()
920 {
921 close();
922 }
923
931 rtl::OUString getURL() const { return _aPath; }
932
975 RC open( sal_uInt32 uFlags )
976 {
977 return static_cast< RC >( osl_openFile( _aPath.pData, &_pData, uFlags ) );
978 }
979
993 RC close()
994 {
995 oslFileError Error = osl_File_E_BADF;
996
997 if( _pData )
998 {
999 Error=osl_closeFile( _pData );
1000 _pData = NULL;
1001 }
1002
1003 return static_cast< RC >( Error );
1004 }
1005
1022 SAL_WARN_UNUSED_RESULT RC setPos( sal_uInt32 uHow, sal_Int64 uPos )
1023 {
1024 return static_cast< RC >( osl_setFilePos( _pData, uHow, uPos ) );
1025 }
1026
1042 RC getPos( sal_uInt64& uPos )
1043 {
1044 return static_cast< RC >( osl_getFilePos( _pData, &uPos ) );
1045 }
1046
1068 RC isEndOfFile( sal_Bool *pIsEOF )
1069 {
1070 return static_cast< RC >( osl_isEndOfFile( _pData, pIsEOF ) );
1071 }
1072
1090 RC setSize( sal_uInt64 uSize )
1091 {
1092 return static_cast< RC >( osl_setFileSize( _pData, uSize ) );
1093 }
1094
1114 RC getSize( sal_uInt64 &rSize )
1115 {
1116 return static_cast< RC >( osl_getFileSize( _pData, &rSize ) );
1117 }
1118
1150 RC read( void *pBuffer, sal_uInt64 uBytesRequested, sal_uInt64& rBytesRead )
1151 {
1152 return static_cast< RC >( osl_readFile( _pData, pBuffer, uBytesRequested, &rBytesRead ) );
1153 }
1154
1188 RC write(const void *pBuffer, sal_uInt64 uBytesToWrite, sal_uInt64& rBytesWritten)
1189 {
1190 return static_cast< RC >( osl_writeFile( _pData, pBuffer, uBytesToWrite, &rBytesWritten ) );
1191 }
1192
1193
1217 RC readLine( ::rtl::ByteSequence& aSeq )
1218 {
1219 return static_cast< RC >( osl_readLine( _pData, reinterpret_cast<sal_Sequence**>(&aSeq) ) );
1220 }
1221
1241 RC sync() const
1242 {
1243 OSL_PRECOND(_pData, "File::sync(): File not open");
1244 return static_cast< RC >(osl_syncFile(_pData));
1245 }
1246
1272 static RC copy( const ::rtl::OUString& ustrSourceFileURL, const ::rtl::OUString& ustrDestFileURL )
1273 {
1274 return static_cast< RC >( osl_copyFile( ustrSourceFileURL.pData, ustrDestFileURL.pData ) );
1275 }
1276
1300 static RC move( const ::rtl::OUString& ustrSourceFileURL, const ::rtl::OUString& ustrDestFileURL )
1301 {
1302 return static_cast< RC >( osl_moveFile( ustrSourceFileURL.pData, ustrDestFileURL.pData ) );
1303 }
1304
1332 static RC replace(const ::rtl::OUString& ustrSourceFileURL,
1333 const ::rtl::OUString& ustrDestFileURL)
1334 {
1335 return static_cast<RC>(osl_replaceFile(ustrSourceFileURL.pData, ustrDestFileURL.pData));
1336 }
1337
1364 static RC remove( const ::rtl::OUString& ustrFileURL )
1365 {
1366 return static_cast< RC >( osl_removeFile( ustrFileURL.pData ) );
1367 }
1368
1384 static RC setAttributes( const ::rtl::OUString& ustrFileURL, sal_uInt64 uAttributes )
1385 {
1386 return static_cast< RC >( osl_setFileAttributes( ustrFileURL.pData, uAttributes ) );
1387 }
1388
1410 static RC setTime(
1411 const ::rtl::OUString& ustrFileURL,
1412 const TimeValue& rCreationTime,
1413 const TimeValue& rLastAccessTime,
1414 const TimeValue& rLastWriteTime )
1415 {
1416 return static_cast< RC >( osl_setFileTime(
1417 ustrFileURL.pData,
1418 &rCreationTime,
1419 &rLastAccessTime,
1420 &rLastWriteTime ) );
1421 }
1422
1423 friend class DirectoryItem;
1424};
1425
1426
1432 class DirectoryItem: public FileBase
1433{
1434 oslDirectoryItem _pData;
1435
1436public:
1437
1441 DirectoryItem(): _pData( NULL )
1442 {
1443 }
1444
1448 DirectoryItem( const DirectoryItem& rItem ): _pData( rItem._pData)
1449 {
1450 if( _pData )
1451 osl_acquireDirectoryItem( _pData );
1452 }
1453
1457 ~DirectoryItem()
1458 {
1459 if( _pData )
1460 osl_releaseDirectoryItem( _pData );
1461 }
1462
1466 DirectoryItem& operator=(const DirectoryItem& rItem )
1467 {
1468 if (&rItem != this)
1469 {
1470 if( _pData )
1471 osl_releaseDirectoryItem( _pData );
1472
1473 _pData = rItem._pData;
1474
1475 if( _pData )
1476 osl_acquireDirectoryItem( _pData );
1477 }
1478 return *this;
1479 }
1480
1487 bool is()
1488 {
1489 return _pData != NULL;
1490 }
1491
1525 static RC get( const ::rtl::OUString& ustrFileURL, DirectoryItem& rItem )
1526 {
1527 if( rItem._pData)
1528 {
1529 osl_releaseDirectoryItem( rItem._pData );
1530 rItem._pData = NULL;
1531 }
1532
1533 return static_cast< RC >( osl_getDirectoryItem( ustrFileURL.pData, &rItem._pData ) );
1534 }
1535
1567 RC getFileStatus( FileStatus& rStatus )
1568 {
1569 return static_cast< RC >( osl_getFileStatus( _pData, &rStatus._aStatus, rStatus._nMask ) );
1570 }
1571
1587 bool isIdenticalTo( const DirectoryItem &pOther )
1588 {
1589 return osl_identicalDirectoryItem( _pData, pOther._pData );
1590 }
1591
1592 friend class Directory;
1593};
1594
1595
1606 class DirectoryCreationObserver
1607{
1608public:
1609 virtual ~DirectoryCreationObserver() {}
1610
1620 virtual void DirectoryCreated(const rtl::OUString& aDirectoryUrl) = 0;
1621};
1622
1623
1624// This just an internal helper function for
1625// private use.
1626 extern "C" inline void SAL_CALL onDirectoryCreated(void* pData, rtl_uString* aDirectoryUrl)
1627{
1628 static_cast<DirectoryCreationObserver*>(pData)->DirectoryCreated(aDirectoryUrl);
1629}
1630
1637 class Directory: public FileBase
1638{
1639 oslDirectory _pData;
1640 ::rtl::OUString _aPath;
1641
1645 Directory( Directory& ) SAL_DELETED_FUNCTION;
1646
1650 Directory& operator = ( Directory& ) SAL_DELETED_FUNCTION;
1651
1652public:
1653
1661 Directory( const ::rtl::OUString& strPath ): _pData( NULL ), _aPath( strPath )
1662 {
1663 }
1664
1668 ~Directory()
1669 {
1670 close();
1671 }
1672
1680 rtl::OUString getURL() const { return _aPath; }
1681
1699 RC open()
1700 {
1701 return static_cast< RC >( osl_openDirectory( _aPath.pData, &_pData ) );
1702 }
1703
1714 bool isOpen() { return _pData != NULL; }
1715
1727 RC close()
1728 {
1729 oslFileError Error = osl_File_E_BADF;
1730
1731 if( _pData )
1732 {
1733 Error=osl_closeDirectory( _pData );
1734 _pData = NULL;
1735 }
1736
1737 return static_cast< RC >( Error );
1738 }
1739
1740
1757 RC reset()
1758 {
1759 close();
1760 return open();
1761 }
1762
1785 RC getNextItem( DirectoryItem& rItem, sal_uInt32 nHint = 0 )
1786 {
1787 if( rItem._pData )
1788 {
1789 osl_releaseDirectoryItem( rItem._pData );
1790 rItem._pData = NULL;
1791 }
1792 return static_cast<RC>(osl_getNextDirectoryItem( _pData, &rItem._pData, nHint ));
1793 }
1794
1795
1826 static RC getVolumeInfo( const ::rtl::OUString& ustrDirectoryURL, VolumeInfo& rInfo )
1827 {
1828 return static_cast< RC >( osl_getVolumeInformation( ustrDirectoryURL.pData, &rInfo._aInfo, rInfo._nMask ) );
1829 }
1830
1861 static RC create(
1862 const ::rtl::OUString& ustrDirectoryURL,
1863 sal_uInt32 flags = osl_File_OpenFlag_Read | osl_File_OpenFlag_Write )
1864 {
1865 return static_cast< RC >(
1866 osl_createDirectoryWithFlags( ustrDirectoryURL.pData, flags ) );
1867 }
1868
1895 static RC remove( const ::rtl::OUString& ustrDirectoryURL )
1896 {
1897 return static_cast< RC >( osl_removeDirectory( ustrDirectoryURL.pData ) );
1898 }
1899
1936 static RC createPath(
1937 const ::rtl::OUString& aDirectoryUrl,
1938 DirectoryCreationObserver* aDirectoryCreationObserver = NULL)
1939 {
1940 return static_cast< RC >(osl_createDirectoryPath(
1941 aDirectoryUrl.pData,
1942 aDirectoryCreationObserver ? onDirectoryCreated : NULL,
1943 aDirectoryCreationObserver));
1944 }
1945};
1946
1947} /* namespace osl */
1948
1949#endif // INCLUDED_OSL_FILE_HXX
1950
1951/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
config.h
log.hxx
SAL_INFO_IF
#define SAL_INFO_IF(condition, area, stream)
Produce log entry from stream in the given log area if condition is true.
Definition: log.hxx:353
SAL_DELETED_FUNCTION
#define SAL_DELETED_FUNCTION
short-circuit extra-verbose API namespaces
Definition: types.h:378
sal_Bool
unsigned char sal_Bool
Definition: types.h:38
SAL_WARN_UNUSED_RESULT
#define SAL_WARN_UNUSED_RESULT
Use this as markup for functions and methods whose return value must be checked.
Definition: types.h:284
string.h
rtl_uString_release
SAL_DLLPUBLIC void rtl_uString_release(rtl_uString *str) SAL_THROW_EXTERN_C() SAL_HOT
Decrement the reference count of a string.
ustring.hxx
diagnose.h
Provides simple diagnostic support.
file.h
Main goals and usage hints.
osl_identicalDirectoryItem
SAL_DLLPUBLIC sal_Bool osl_identicalDirectoryItem(oslDirectoryItem pItemA, oslDirectoryItem pItemB)
Determine if two directory items point the same underlying file.
osl_acquireDirectoryItem
SAL_DLLPUBLIC oslFileError osl_acquireDirectoryItem(oslDirectoryItem Item)
Increase the refcount of a directory item handle.
osl_releaseDirectoryItem
SAL_DLLPUBLIC oslFileError osl_releaseDirectoryItem(oslDirectoryItem Item)
Decrease the refcount of a directory item handle.
osl_readFile
SAL_DLLPUBLIC oslFileError osl_readFile(oslFileHandle Handle, void *pBuffer, sal_uInt64 uBytesRequested, sal_uInt64 *pBytesRead)
Read a number of bytes from a file.
osl_getFileSize
SAL_DLLPUBLIC oslFileError osl_getFileSize(oslFileHandle Handle, sal_uInt64 *pSize)
Get the file size of an open file.
osl_getFileURLFromSystemPath
SAL_DLLPUBLIC oslFileError osl_getFileURLFromSystemPath(rtl_uString *pustrSystemPath, rtl_uString **ppustrFileURL)
Convert a system dependent path into a file URL.
osl_setFileTime
SAL_DLLPUBLIC oslFileError osl_setFileTime(rtl_uString *pustrFileURL, const TimeValue *aCreationTime, const TimeValue *aLastAccessTime, const TimeValue *aLastWriteTime)
Set the file time.
osl_getVolumeInformation
SAL_DLLPUBLIC oslFileError osl_getVolumeInformation(rtl_uString *pustrDirectoryURL, oslVolumeInfo *pInfo, sal_uInt32 uFieldMask)
Retrieve information about a volume.
osl_getVolumeDeviceMountPath
SAL_DLLPUBLIC oslFileError osl_getVolumeDeviceMountPath(oslVolumeDeviceHandle Handle, rtl_uString **ppustrDirectoryURL)
Get the full qualified URL where a device is mounted to.
osl_getDirectoryItem
SAL_DLLPUBLIC oslFileError osl_getDirectoryItem(rtl_uString *pustrFileURL, oslDirectoryItem *pItem)
Retrieve a single directory item.
osl_writeFile
SAL_DLLPUBLIC oslFileError osl_writeFile(oslFileHandle Handle, const void *pBuffer, sal_uInt64 uBytesToWrite, sal_uInt64 *pBytesWritten)
Write a number of bytes to a file.
oslVolumeDeviceHandle
void * oslVolumeDeviceHandle
Definition: file.h:454
osl_removeFile
SAL_DLLPUBLIC oslFileError osl_removeFile(rtl_uString *pustrFileURL)
Remove a regular file.
osl_File_OpenFlag_Write
#define osl_File_OpenFlag_Write
Definition: file.h:635
osl_getTempDirURL
SAL_DLLPUBLIC oslFileError osl_getTempDirURL(rtl_uString **pustrTempDirURL)
Retrieves the file URL of the system's temporary directory path.
osl_getFilePos
SAL_DLLPUBLIC oslFileError osl_getFilePos(oslFileHandle Handle, sal_uInt64 *pPos)
Retrieve the current position of the internal pointer of an open file.
osl_moveFile
SAL_DLLPUBLIC oslFileError osl_moveFile(rtl_uString *pustrSourceFileURL, rtl_uString *pustrDestFileURL)
Move a file or directory to a new destination or renames it.
osl_searchFileURL
SAL_DLLPUBLIC oslFileError osl_searchFileURL(rtl_uString *pustrFileName, rtl_uString *pustrSearchPath, rtl_uString **ppustrFileURL)
Search a full qualified system path or a file URL.
osl_setFilePos
SAL_WARN_UNUSED_RESULT SAL_DLLPUBLIC oslFileError osl_setFilePos(oslFileHandle Handle, sal_uInt32 uHow, sal_Int64 uPos)
Set the internal position pointer of an open file.
oslFileError
oslFileError
Definition: file.h:89
osl_File_E_NOLINK
@ osl_File_E_NOLINK
Definition: file.h:130
osl_File_E_DOM
@ osl_File_E_DOM
Definition: file.h:121
osl_File_E_MULTIHOP
@ osl_File_E_MULTIHOP
Definition: file.h:131
osl_File_E_EXIST
@ osl_File_E_EXIST
Definition: file.h:106
osl_File_E_NOSYS
@ osl_File_E_NOSYS
Definition: file.h:126
osl_File_E_NXIO
@ osl_File_E_NXIO
Definition: file.h:96
osl_File_E_NOENT
@ osl_File_E_NOENT
Definition: file.h:92
osl_File_E_MLINK
@ osl_File_E_MLINK
Definition: file.h:119
osl_File_E_PERM
@ osl_File_E_PERM
Definition: file.h:91
osl_File_E_BUSY
@ osl_File_E_BUSY
Definition: file.h:105
osl_File_E_NOMEM
@ osl_File_E_NOMEM
Definition: file.h:102
osl_File_E_DEADLK
@ osl_File_E_DEADLK
Definition: file.h:123
osl_File_E_TIMEDOUT
@ osl_File_E_TIMEDOUT
Definition: file.h:136
osl_File_E_XDEV
@ osl_File_E_XDEV
Definition: file.h:107
osl_File_E_NOTTY
@ osl_File_E_NOTTY
Definition: file.h:114
osl_File_E_AGAIN
@ osl_File_E_AGAIN
Definition: file.h:101
osl_File_E_2BIG
@ osl_File_E_2BIG
Definition: file.h:97
osl_File_E_NODEV
@ osl_File_E_NODEV
Definition: file.h:108
osl_File_E_ACCES
@ osl_File_E_ACCES
Definition: file.h:103
osl_File_E_MFILE
@ osl_File_E_MFILE
Definition: file.h:113
osl_File_E_NFILE
@ osl_File_E_NFILE
Definition: file.h:112
osl_File_E_BADF
@ osl_File_E_BADF
Definition: file.h:99
osl_File_E_ROFS
@ osl_File_E_ROFS
Definition: file.h:118
osl_File_E_ISDIR
@ osl_File_E_ISDIR
Definition: file.h:110
osl_File_E_OVERFLOW
@ osl_File_E_OVERFLOW
Definition: file.h:133
osl_File_E_PIPE
@ osl_File_E_PIPE
Definition: file.h:120
osl_File_E_SPIPE
@ osl_File_E_SPIPE
Definition: file.h:117
osl_File_E_NAMETOOLONG
@ osl_File_E_NAMETOOLONG
Definition: file.h:124
osl_File_E_INTR
@ osl_File_E_INTR
Definition: file.h:94
osl_File_E_NOTEMPTY
@ osl_File_E_NOTEMPTY
Definition: file.h:127
osl_File_E_CHILD
@ osl_File_E_CHILD
Definition: file.h:100
osl_File_E_INVAL
@ osl_File_E_INVAL
Definition: file.h:111
osl_File_E_invalidError
@ osl_File_E_invalidError
Definition: file.h:135
osl_File_E_ILSEQ
@ osl_File_E_ILSEQ
Definition: file.h:129
osl_File_E_RANGE
@ osl_File_E_RANGE
Definition: file.h:122
osl_File_E_FBIG
@ osl_File_E_FBIG
Definition: file.h:115
osl_File_E_NOTDIR
@ osl_File_E_NOTDIR
Definition: file.h:109
osl_File_E_NOTREADY
@ osl_File_E_NOTREADY
Definition: file.h:134
osl_File_E_NOLCK
@ osl_File_E_NOLCK
Definition: file.h:125
osl_File_E_NOEXEC
@ osl_File_E_NOEXEC
Definition: file.h:98
osl_File_E_None
@ osl_File_E_None
Definition: file.h:90
osl_File_E_USERS
@ osl_File_E_USERS
Definition: file.h:132
osl_File_E_IO
@ osl_File_E_IO
Definition: file.h:95
osl_File_E_NOSPC
@ osl_File_E_NOSPC
Definition: file.h:116
osl_File_E_NETWORK
@ osl_File_E_NETWORK
Definition: file.h:137
osl_File_E_LOOP
@ osl_File_E_LOOP
Definition: file.h:128
osl_File_E_SRCH
@ osl_File_E_SRCH
Definition: file.h:93
osl_File_E_FAULT
@ osl_File_E_FAULT
Definition: file.h:104
osl_createDirectoryWithFlags
SAL_DLLPUBLIC oslFileError osl_createDirectoryWithFlags(rtl_uString *url, sal_uInt32 flags)
Create a directory, passing flags.
osl_openFile
SAL_DLLPUBLIC oslFileError osl_openFile(rtl_uString *pustrFileURL, oslFileHandle *pHandle, sal_uInt32 uFlags)
Open a regular file.
osl_getCanonicalName
SAL_DLLPUBLIC oslFileError osl_getCanonicalName(rtl_uString *pustrRequestedURL, rtl_uString **ppustrValidURL)
Determine a valid unused canonical name for a requested name.
oslDirectory
void * oslDirectory
Definition: file.h:143
osl_closeDirectory
SAL_DLLPUBLIC oslFileError osl_closeDirectory(oslDirectory Directory)
Release a directory handle.
osl_syncFile
SAL_DLLPUBLIC oslFileError osl_syncFile(oslFileHandle Handle)
Synchronize the memory representation of a file with that on the physical medium.
osl_setFileAttributes
SAL_DLLPUBLIC oslFileError osl_setFileAttributes(rtl_uString *pustrFileURL, sal_uInt64 uAttributes)
Set file attributes.
oslDirectoryItem
void * oslDirectoryItem
Definition: file.h:144
osl_getFileStatus
SAL_DLLPUBLIC oslFileError osl_getFileStatus(oslDirectoryItem Item, oslFileStatus *pStatus, sal_uInt32 uFieldMask)
Retrieve information about a single file or directory.
osl_createTempFile
SAL_DLLPUBLIC oslFileError osl_createTempFile(rtl_uString *pustrDirectoryURL, oslFileHandle *pHandle, rtl_uString **ppustrTempFileURL)
Creates a temporary file in the directory provided by the caller or the directory returned by osl_get...
oslVolumeInfo
struct _oslVolumeInfo oslVolumeInfo
Structure containing information about volumes.
osl_releaseVolumeDeviceHandle
SAL_DLLPUBLIC oslFileError osl_releaseVolumeDeviceHandle(oslVolumeDeviceHandle Handle)
Release a volume device handle.
osl_setFileSize
SAL_DLLPUBLIC oslFileError osl_setFileSize(oslFileHandle Handle, sal_uInt64 uSize)
Set the file size of an open file.
osl_closeFile
SAL_DLLPUBLIC oslFileError osl_closeFile(oslFileHandle Handle)
Close an open file.
osl_isEndOfFile
SAL_DLLPUBLIC oslFileError osl_isEndOfFile(oslFileHandle Handle, sal_Bool *pIsEOF)
Test if the end of a file is reached.
osl_replaceFile
SAL_DLLPUBLIC oslFileError osl_replaceFile(rtl_uString *pustrSourceFileURL, rtl_uString *pustrDestFileURL)
Move a file to a new destination or rename it, taking old file's identity (if exists).
osl_getNextDirectoryItem
SAL_DLLPUBLIC oslFileError osl_getNextDirectoryItem(oslDirectory Directory, oslDirectoryItem *pItem, sal_uInt32 uHint)
Retrieve the next item of a previously opened directory.
osl_File_OpenFlag_Read
#define osl_File_OpenFlag_Read
Definition: file.h:634
osl_acquireVolumeDeviceHandle
SAL_DLLPUBLIC oslFileError osl_acquireVolumeDeviceHandle(oslVolumeDeviceHandle Handle)
Acquire a volume device handle.
osl_getAbsoluteFileURL
SAL_DLLPUBLIC oslFileError osl_getAbsoluteFileURL(rtl_uString *pustrBaseDirectoryURL, rtl_uString *pustrRelativeFileURL, rtl_uString **ppustrAbsoluteFileURL)
Convert a path relative to a given directory into an full qualified file URL.
osl_createDirectoryPath
SAL_DLLPUBLIC oslFileError osl_createDirectoryPath(rtl_uString *aDirectoryUrl, oslDirectoryCreationCallbackFunc aDirectoryCreationCallbackFunc, void *pData)
Create a directory path.
osl_getSystemPathFromFileURL
SAL_DLLPUBLIC oslFileError osl_getSystemPathFromFileURL(rtl_uString *pustrFileURL, rtl_uString **ppustrSystemPath)
Convert a file URL into a system dependent path.
osl_copyFile
SAL_DLLPUBLIC oslFileError osl_copyFile(rtl_uString *pustrSourceFileURL, rtl_uString *pustrDestFileURL)
Copy a file to a new destination.
osl_readLine
SAL_DLLPUBLIC oslFileError osl_readLine(oslFileHandle Handle, sal_Sequence **ppSequence)
Read a line from a file.
osl_removeDirectory
SAL_DLLPUBLIC oslFileError osl_removeDirectory(rtl_uString *pustrDirectoryURL)
Remove an empty directory.
oslFileHandle
void * oslFileHandle
Definition: file.h:630
osl_openDirectory
SAL_DLLPUBLIC oslFileError osl_openDirectory(rtl_uString *pustrDirectoryURL, oslDirectory *pDirectory)
Open a directory for enumerating its contents.
time.h
OSL_PRECOND
#define OSL_PRECOND(c, m)
Check the precondition of functions.
Definition: diagnose.h:112
osl_File_Type_Link
@ osl_File_Type_Link
Definition: file.h:334
osl_File_Type_Directory
@ osl_File_Type_Directory
Definition: file.h:329
osl_File_Type_Volume
@ osl_File_Type_Volume
Definition: file.h:330
osl_File_Type_Fifo
@ osl_File_Type_Fifo
Definition: file.h:332
osl_File_Type_Special
@ osl_File_Type_Special
Definition: file.h:335
osl_File_Type_Regular
@ osl_File_Type_Regular
Definition: file.h:331
osl_File_Type_Socket
@ osl_File_Type_Socket
Definition: file.h:333
osl_File_Type_Unknown
@ osl_File_Type_Unknown
Definition: file.h:336
osl_FileStatus_Mask_ModifyTime
#define osl_FileStatus_Mask_ModifyTime
Definition: file.h:368
osl_FileStatus_Mask_AccessTime
#define osl_FileStatus_Mask_AccessTime
Definition: file.h:367
osl_FileStatus_Mask_Type
#define osl_FileStatus_Mask_Type
Definition: file.h:364
osl_FileStatus_Mask_FileSize
#define osl_FileStatus_Mask_FileSize
Definition: file.h:369
osl_FileStatus_Mask_FileURL
#define osl_FileStatus_Mask_FileURL
Definition: file.h:371
osl_FileStatus_Mask_LinkTargetURL
#define osl_FileStatus_Mask_LinkTargetURL
Definition: file.h:372
osl_FileStatus_Mask_CreationTime
#define osl_FileStatus_Mask_CreationTime
Definition: file.h:366
osl_FileStatus_Mask_Attributes
#define osl_FileStatus_Mask_Attributes
Definition: file.h:365
osl_FileStatus_Mask_FileName
#define osl_FileStatus_Mask_FileName
Definition: file.h:370
osl_Volume_Attribute_Case_Sensitive
#define osl_Volume_Attribute_Case_Sensitive
Definition: file.h:536
osl_Volume_Attribute_FloppyDisk
#define osl_Volume_Attribute_FloppyDisk
Definition: file.h:533
osl_Volume_Attribute_Case_Is_Preserved
#define osl_Volume_Attribute_Case_Is_Preserved
Definition: file.h:535
osl_Volume_Attribute_Remote
#define osl_Volume_Attribute_Remote
Definition: file.h:529
osl_Volume_Attribute_FixedDisk
#define osl_Volume_Attribute_FixedDisk
Definition: file.h:531
osl_Volume_Attribute_RAMDisk
#define osl_Volume_Attribute_RAMDisk
Definition: file.h:532
osl_Volume_Attribute_CompactDisc
#define osl_Volume_Attribute_CompactDisc
Definition: file.h:530
osl_Volume_Attribute_Removeable
#define osl_Volume_Attribute_Removeable
Definition: file.h:528
osl
Definition: condition.hxx:31
osl::onDirectoryCreated
void onDirectoryCreated(void *pData, rtl_uString *aDirectoryUrl)
Definition: file.hxx:1626
rtl
Definition: bootstrap.hxx:34
_sal_Sequence
This is the binary specification of a SAL sequence.
Definition: types.h:304
rtl::ByteSequence
C++ class representing a SAL byte sequence.
Definition: byteseq.h:170
rtl::OUString
This String class provides base functionality for C++ like Unicode character array handling.
Definition: ustring.hxx:203
_oslFileStatus
Structure containing information about files and directories.
Definition: file.h:382
_oslFileStatus::uValidFields
sal_uInt32 uValidFields
Determines which members of the structure contain valid data.
Definition: file.h:386
_oslFileStatus::aAccessTime
TimeValue aAccessTime
Last access time in nanoseconds since 1/1/1970.
Definition: file.h:396
_oslFileStatus::ustrLinkTargetURL
rtl_uString * ustrLinkTargetURL
Full URL of the target file if the file itself is a link.
Definition: file.h:410
_oslFileStatus::uAttributes
sal_uInt64 uAttributes
File attributes.
Definition: file.h:390
_oslFileStatus::ustrFileName
rtl_uString * ustrFileName
Case correct name of the file.
Definition: file.h:403
_oslFileStatus::eType
oslFileType eType
The type of the file (file, directory, volume).
Definition: file.h:388
_oslFileStatus::uFileSize
sal_uInt64 uFileSize
Size in bytes of the file.
Definition: file.h:400
_oslFileStatus::uStructSize
sal_uInt32 uStructSize
Must be initialized with the size in bytes of the structure before passing it to any function.
Definition: file.h:384
_oslFileStatus::aModifyTime
TimeValue aModifyTime
Last modify time in nanoseconds since 1/1/1970.
Definition: file.h:398
_oslFileStatus::ustrFileURL
rtl_uString * ustrFileURL
Full URL of the file.
Definition: file.h:406
_oslFileStatus::aCreationTime
TimeValue aCreationTime
First creation time in nanoseconds since 1/1/1970.
Definition: file.h:393
_oslVolumeInfo
Structure containing information about volumes.
Definition: file.h:564
_oslVolumeInfo::uMaxNameLength
sal_uInt32 uMaxNameLength
Maximum length of file name of a single item.
Definition: file.h:579
_oslVolumeInfo::uValidFields
sal_uInt32 uValidFields
Determines which members of the structure contain valid data.
Definition: file.h:569
_oslVolumeInfo::uMaxPathLength
sal_uInt32 uMaxPathLength
Maximum length of a full qualified path in system notation.
Definition: file.h:581
_oslVolumeInfo::uAttributes
sal_uInt32 uAttributes
Attributes of the volume (remote and/or removable)
Definition: file.h:571
_oslVolumeInfo::uUsedSpace
sal_uInt64 uUsedSpace
Used space on the volume for the current process/user.
Definition: file.h:575
_oslVolumeInfo::pDeviceHandle
oslVolumeDeviceHandle * pDeviceHandle
Pointer to handle the receives underlying device.
Definition: file.h:588
_oslVolumeInfo::uTotalSpace
sal_uInt64 uTotalSpace
Total available space on the volume for the current process/user.
Definition: file.h:573
_oslVolumeInfo::ustrFileSystemName
rtl_uString * ustrFileSystemName
Points to a string that receives the name of the file system type.
Definition: file.h:585
_oslVolumeInfo::uStructSize
sal_uInt32 uStructSize
Must be initialized with the size in bytes of the structure before passing it to any function.
Definition: file.h:567
_oslVolumeInfo::uFreeSpace
sal_uInt64 uFreeSpace
Free space on the volume for the current process/user.
Definition: file.h:577
osl::FileBase
Base class for all File System specific objects.
Definition: file.hxx:54
osl::FileBase::createTempFile
static RC createTempFile(::rtl::OUString *pustrDirectoryURL, oslFileHandle *pHandle, ::rtl::OUString *pustrTempFileURL)
Creates a temporary file in the directory provided by the caller or the directory returned by getTemp...
Definition: file.hxx:306
osl::FileBase::getSystemPathFromFileURL
static RC getSystemPathFromFileURL(const ::rtl::OUString &ustrFileURL, ::rtl::OUString &ustrSystemPath)
Convert a file URL into a system dependent path.
Definition: file.hxx:189
osl::FileBase::searchFileURL
static RC searchFileURL(const ::rtl::OUString &ustrFileName, const ::rtl::OUString &ustrSearchPath, ::rtl::OUString &ustrFileURL)
Search a full qualified system path or a file URL.
Definition: file.hxx:240
osl::FileBase::getCanonicalName
static RC getCanonicalName(const ::rtl::OUString &ustrRequestedURL, ::rtl::OUString &ustrValidURL)
Determine a valid unused canonical name for a requested name.
Definition: file.hxx:131
osl::FileBase::getAbsoluteFileURL
static RC getAbsoluteFileURL(const ::rtl::OUString &ustrBaseDirectoryURL, const ::rtl::OUString &ustrRelativeFileURL, ::rtl::OUString &ustrAbsoluteFileURL)
Convert a path relative to a given directory into an full qualified file URL.
Definition: file.hxx:170
osl::FileBase::getTempDirURL
static RC getTempDirURL(::rtl::OUString &ustrTempDirURL)
Retrieves the file URL of the system's temporary directory path.
Definition: file.hxx:254
osl::FileBase::getFileURLFromSystemPath
static RC getFileURLFromSystemPath(const ::rtl::OUString &ustrSystemPath, ::rtl::OUString &ustrFileURL)
Convert a system dependent path into a file URL.
Definition: file.hxx:208
osl::FileBase::RC
RC
Definition: file.hxx:57
osl::FileBase::E_ACCES
@ E_ACCES
file permissions do not allow operation
Definition: file.hxx:71
osl::FileBase::E_DEADLK
@ E_DEADLK
deadlock avoided
Definition: file.hxx:91
osl::FileBase::E_NOTEMPTY
@ E_NOTEMPTY
directory not empty
Definition: file.hxx:95
osl::FileBase::E_NETWORK
@ E_NETWORK
Definition: file.hxx:105
osl::FileBase::E_OVERFLOW
@ E_OVERFLOW
value too large for defined data type
Definition: file.hxx:101
osl::FileBase::E_2BIG
@ E_2BIG
argument list too long
Definition: file.hxx:65
osl::FileBase::E_EXIST
@ E_EXIST
file exists where should only be created
Definition: file.hxx:74
osl::FileBase::E_CHILD
@ E_CHILD
there are no child processes
Definition: file.hxx:68
osl::FileBase::E_IO
@ E_IO
I/O error occurred.
Definition: file.hxx:63
osl::FileBase::E_DOM
@ E_DOM
domain error (mathematical error)
Definition: file.hxx:89
osl::FileBase::E_invalidError
@ E_invalidError
unmapped error: always last entry in enum!
Definition: file.hxx:103
osl::FileBase::E_NOENT
@ E_NOENT
no such file or directory
Definition: file.hxx:60
osl::FileBase::E_XDEV
@ E_XDEV
improper link across file systems detected
Definition: file.hxx:75
osl::FileBase::E_PERM
@ E_PERM
operation not permitted
Definition: file.hxx:59
osl::FileBase::E_NOEXEC
@ E_NOEXEC
invalid executable file format
Definition: file.hxx:66
osl::FileBase::E_TIMEDOUT
@ E_TIMEDOUT
socket operation timed out
Definition: file.hxx:104
osl::FileBase::E_NOSYS
@ E_NOSYS
function not implemented
Definition: file.hxx:94
osl::FileBase::E_ILSEQ
@ E_ILSEQ
invalid or incomplete byte sequence of multibyte char found
Definition: file.hxx:97
osl::FileBase::E_SPIPE
@ E_SPIPE
invalid seek operation (such as on pipe)
Definition: file.hxx:85
osl::FileBase::E_MULTIHOP
@ E_MULTIHOP
remote resource is not directly available
Definition: file.hxx:99
osl::FileBase::E_FAULT
@ E_FAULT
bad address; an invalid pointer detected
Definition: file.hxx:72
osl::FileBase::E_MLINK
@ E_MLINK
too many links to file
Definition: file.hxx:87
osl::FileBase::E_ROFS
@ E_ROFS
illegal modification to read-only filesystem
Definition: file.hxx:86
osl::FileBase::E_NOSPC
@ E_NOSPC
no space left on device, write failed
Definition: file.hxx:84
osl::FileBase::E_NOTTY
@ E_NOTTY
inappropriate I/O control operation
Definition: file.hxx:82
osl::FileBase::E_BADF
@ E_BADF
bad file descriptor
Definition: file.hxx:67
osl::FileBase::E_BUSY
@ E_BUSY
resource busy
Definition: file.hxx:73
osl::FileBase::E_NXIO
@ E_NXIO
no such device or address
Definition: file.hxx:64
osl::FileBase::E_NFILE
@ E_NFILE
too many distinct file openings
Definition: file.hxx:80
osl::FileBase::E_INVAL
@ E_INVAL
invalid argument to library function
Definition: file.hxx:79
osl::FileBase::E_NOTREADY
@ E_NOTREADY
device not ready
Definition: file.hxx:102
osl::FileBase::E_AGAIN
@ E_AGAIN
resource temp unavailable, try again later
Definition: file.hxx:69
osl::FileBase::E_LOOP
@ E_LOOP
too many levels of symbolic links found during name lookup
Definition: file.hxx:96
osl::FileBase::E_USERS
@ E_USERS
file quote system is confused as there are too many users
Definition: file.hxx:100
osl::FileBase::E_NOMEM
@ E_NOMEM
no memory available
Definition: file.hxx:70
osl::FileBase::E_NODEV
@ E_NODEV
wrong device type specified
Definition: file.hxx:76
osl::FileBase::E_MFILE
@ E_MFILE
process has too many distinct files open
Definition: file.hxx:81
osl::FileBase::E_NOTDIR
@ E_NOTDIR
file isn't a directory where one is needed
Definition: file.hxx:77
osl::FileBase::E_INTR
@ E_INTR
function call was interrupted
Definition: file.hxx:62
osl::FileBase::E_PIPE
@ E_PIPE
broken pipe; no process reading from other end of pipe
Definition: file.hxx:88
osl::FileBase::E_NOLCK
@ E_NOLCK
no locks available
Definition: file.hxx:93
osl::FileBase::E_ISDIR
@ E_ISDIR
file is a directory, invalid operation
Definition: file.hxx:78
osl::FileBase::E_NAMETOOLONG
@ E_NAMETOOLONG
filename too long
Definition: file.hxx:92
osl::FileBase::E_FBIG
@ E_FBIG
file too large
Definition: file.hxx:83
osl::FileBase::E_NOLINK
@ E_NOLINK
link has been severed
Definition: file.hxx:98
osl::FileBase::E_RANGE
@ E_RANGE
range error (mathematical error)
Definition: file.hxx:90
osl::FileBase::E_None
@ E_None
on success
Definition: file.hxx:58
osl::FileBase::E_SRCH
@ E_SRCH
no process matches the PID
Definition: file.hxx:61
osl::VolumeDevice
The VolumeDevice class.
Definition: file.hxx:325
osl::VolumeDevice::~VolumeDevice
~VolumeDevice()
Destructor.
Definition: file.hxx:353
osl::VolumeDevice::operator=
VolumeDevice & operator=(const VolumeDevice &rDevice)
Assignment operator.
Definition: file.hxx:365
osl::VolumeDevice::getMountPath
rtl::OUString getMountPath()
Get the full qualified URL where a device is mounted to.
Definition: file.hxx:385
osl::VolumeDevice::VolumeDevice
VolumeDevice()
Constructor.
Definition: file.hxx:333
osl::VolumeDevice::VolumeDevice
VolumeDevice(const VolumeDevice &rDevice)
Copy constructor.
Definition: file.hxx:343
osl::VolumeInfo
The VolumeInfo class.
Definition: file.hxx:407
osl::VolumeInfo::getUsedSpace
sal_uInt64 getUsedSpace() const
Determine the used space of a volume device.
Definition: file.hxx:550
osl::VolumeInfo::getDeviceHandle
VolumeDevice getDeviceHandle() const
Get the volume device handle.
Definition: file.hxx:599
osl::VolumeInfo::getFixedDiskFlag
bool getFixedDiskFlag() const
Check the fixed disk flag.
Definition: file.hxx:503
osl::VolumeInfo::getTotalSpace
sal_uInt64 getTotalSpace() const
Determine the total space of a volume device.
Definition: file.hxx:526
osl::VolumeInfo::isCaseSensitiveFileSystem
bool isCaseSensitiveFileSystem() const
Return whether the file system is case sensitive or case insensitive.
Definition: file.hxx:610
osl::VolumeInfo::getRemoteFlag
bool getRemoteFlag() const
Check the remote flag.
Definition: file.hxx:460
osl::VolumeInfo::isCasePreservingFileSystem
bool isCasePreservingFileSystem() const
Return whether the file system preserves the case of file and directory names or not.
Definition: file.hxx:622
osl::VolumeInfo::getRemoveableFlag
bool getRemoveableFlag() const
Check the removable flag.
Definition: file.hxx:470
osl::VolumeInfo::isValid
bool isValid(sal_uInt32 nMask) const
Check if specified fields are valid.
Definition: file.hxx:450
osl::VolumeInfo::getFileSystemName
::rtl::OUString getFileSystemName() const
Determine the name of the volume device's File System.
Definition: file.hxx:586
osl::VolumeInfo::getFloppyDiskFlag
bool getFloppyDiskFlag() const
Check the floppy disc flag.
Definition: file.hxx:492
osl::VolumeInfo::getMaxNameLength
sal_uInt32 getMaxNameLength() const
Determine the maximal length of a file name.
Definition: file.hxx:562
osl::VolumeInfo::VolumeInfo
VolumeInfo(sal_uInt32 nMask)
Constructor.
Definition: file.hxx:429
osl::VolumeInfo::getMaxPathLength
sal_uInt32 getMaxPathLength() const
Determine the maximal length of a path name.
Definition: file.hxx:574
osl::VolumeInfo::getCompactDiscFlag
bool getCompactDiscFlag() const
Check the compact disc flag.
Definition: file.hxx:481
osl::VolumeInfo::~VolumeInfo
~VolumeInfo()
Definition: file.hxx:437
osl::VolumeInfo::getFreeSpace
sal_uInt64 getFreeSpace() const
Determine the free space of a volume device.
Definition: file.hxx:538
osl::VolumeInfo::getRAMDiskFlag
bool getRAMDiskFlag() const
Check the RAM disk flag.
Definition: file.hxx:514
osl::FileStatus
The FileStatus class.
Definition: file.hxx:639
osl::FileStatus::getAccessTime
TimeValue getAccessTime() const
Get the file access time.
Definition: file.hxx:796
osl::FileStatus::Type
Type
Definition: file.hxx:655
osl::FileStatus::Fifo
@ Fifo
Definition: file.hxx:659
osl::FileStatus::Regular
@ Regular
Definition: file.hxx:658
osl::FileStatus::Unknown
@ Unknown
Definition: file.hxx:663
osl::FileStatus::Volume
@ Volume
Definition: file.hxx:657
osl::FileStatus::Link
@ Link
Definition: file.hxx:661
osl::FileStatus::Special
@ Special
Definition: file.hxx:662
osl::FileStatus::getLinkTargetURL
::rtl::OUString getLinkTargetURL() const
Get the link target URL.
Definition: file.hxx:872
osl::FileStatus::getFileURL
::rtl::OUString getFileURL() const
Get the URL of the file.
Definition: file.hxx:856
osl::FileStatus::getFileSize
sal_uInt64 getFileSize() const
Get the size of the file.
Definition: file.hxx:825
osl::FileStatus::getFileType
Type getFileType() const
Get the file type.
Definition: file.hxx:709
osl::FileStatus::isRegular
bool isRegular() const
Is it a regular file?
Definition: file.hxx:742
osl::FileStatus::isDirectory
bool isDirectory() const
Is it a directory? This method returns True for both directories, and volumes.
Definition: file.hxx:727
osl::FileStatus::getFileName
::rtl::OUString getFileName() const
Get the file name.
Definition: file.hxx:839
osl::FileStatus::~FileStatus
~FileStatus()
Destructor.
Definition: file.hxx:680
osl::FileStatus::isValid
bool isValid(sal_uInt32 nMask) const
Check if specified fields are valid.
Definition: file.hxx:699
osl::FileStatus::getCreationTime
TimeValue getCreationTime() const
Get the creation time of this file.
Definition: file.hxx:781
osl::FileStatus::getModifyTime
TimeValue getModifyTime() const
Get the file modification time.
Definition: file.hxx:811
osl::FileStatus::isLink
bool isLink() const
Is it a link?
Definition: file.hxx:755
osl::FileStatus::getAttributes
sal_uInt64 getAttributes() const
Get the file attributes.
Definition: file.hxx:766
osl::FileStatus::FileStatus
FileStatus(sal_uInt32 nMask)
Constructor.
Definition: file.hxx:671
osl::File
The file class object provides access to file contents and attributes.
Definition: file.hxx:892
osl::File::read
RC read(void *pBuffer, sal_uInt64 uBytesRequested, sal_uInt64 &rBytesRead)
Read a number of bytes from a file.
Definition: file.hxx:1150
osl::File::~File
~File()
Destructor.
Definition: file.hxx:919
osl::File::close
RC close()
Close an open file.
Definition: file.hxx:993
osl::File::setAttributes
static RC setAttributes(const ::rtl::OUString &ustrFileURL, sal_uInt64 uAttributes)
Set file attributes.
Definition: file.hxx:1384
osl::File::open
RC open(sal_uInt32 uFlags)
Open a regular file.
Definition: file.hxx:975
osl::File::readLine
RC readLine(::rtl::ByteSequence &aSeq)
Read a line from a file.
Definition: file.hxx:1217
osl::File::remove
static RC remove(const ::rtl::OUString &ustrFileURL)
Remove a regular file.
Definition: file.hxx:1364
osl::File::getURL
rtl::OUString getURL() const
Obtain the URL.
Definition: file.hxx:931
osl::File::copy
static RC copy(const ::rtl::OUString &ustrSourceFileURL, const ::rtl::OUString &ustrDestFileURL)
Copy a file to a new destination.
Definition: file.hxx:1272
osl::File::setSize
RC setSize(sal_uInt64 uSize)
Set the file size of an open file.
Definition: file.hxx:1090
osl::File::write
RC write(const void *pBuffer, sal_uInt64 uBytesToWrite, sal_uInt64 &rBytesWritten)
Write a number of bytes to a file.
Definition: file.hxx:1188
osl::File::sync
RC sync() const
Synchronize the memory representation of a file with that on the physical medium.
Definition: file.hxx:1241
osl::File::getSize
RC getSize(sal_uInt64 &rSize)
Get the file size of an open file.
Definition: file.hxx:1114
osl::File::setTime
static RC setTime(const ::rtl::OUString &ustrFileURL, const TimeValue &rCreationTime, const TimeValue &rLastAccessTime, const TimeValue &rLastWriteTime)
Set the file time.
Definition: file.hxx:1410
osl::File::replace
static RC replace(const ::rtl::OUString &ustrSourceFileURL, const ::rtl::OUString &ustrDestFileURL)
Move a file to a new destination or rename it, taking old file's identity (if exists).
Definition: file.hxx:1332
osl::File::getPos
RC getPos(sal_uInt64 &uPos)
Retrieve the current position of the internal pointer of an open file.
Definition: file.hxx:1042
osl::File::File
File(const ::rtl::OUString &ustrFileURL)
Constructor.
Definition: file.hxx:914
osl::File::setPos
SAL_WARN_UNUSED_RESULT RC setPos(sal_uInt32 uHow, sal_Int64 uPos)
Set the internal position pointer of an open file.
Definition: file.hxx:1022
osl::File::move
static RC move(const ::rtl::OUString &ustrSourceFileURL, const ::rtl::OUString &ustrDestFileURL)
Move a file or directory to a new destination or renames it.
Definition: file.hxx:1300
osl::File::isEndOfFile
RC isEndOfFile(sal_Bool *pIsEOF)
Test if the end of a file is reached.
Definition: file.hxx:1068
osl::DirectoryItem
The directory item class object provides access to file status information.
Definition: file.hxx:1433
osl::DirectoryItem::DirectoryItem
DirectoryItem()
Constructor.
Definition: file.hxx:1441
osl::DirectoryItem::get
static RC get(const ::rtl::OUString &ustrFileURL, DirectoryItem &rItem)
Retrieve a single directory item.
Definition: file.hxx:1525
osl::DirectoryItem::DirectoryItem
DirectoryItem(const DirectoryItem &rItem)
Copy constructor.
Definition: file.hxx:1448
osl::DirectoryItem::is
bool is()
Check for validity of this instance.
Definition: file.hxx:1487
osl::DirectoryItem::~DirectoryItem
~DirectoryItem()
Destructor.
Definition: file.hxx:1457
osl::DirectoryItem::isIdenticalTo
bool isIdenticalTo(const DirectoryItem &pOther)
Determine if a directory item point the same underlying file.
Definition: file.hxx:1587
osl::DirectoryItem::operator=
DirectoryItem & operator=(const DirectoryItem &rItem)
Assignment operator.
Definition: file.hxx:1466
osl::DirectoryItem::getFileStatus
RC getFileStatus(FileStatus &rStatus)
Retrieve information about a single file or directory.
Definition: file.hxx:1567
osl::DirectoryCreationObserver
Base class for observers of directory creation notifications.
Definition: file.hxx:1607
osl::DirectoryCreationObserver::DirectoryCreated
virtual void DirectoryCreated(const rtl::OUString &aDirectoryUrl)=0
This method will be called when a new directory has been created and needs to be overwritten by deriv...
osl::DirectoryCreationObserver::~DirectoryCreationObserver
virtual ~DirectoryCreationObserver()
Definition: file.hxx:1609
osl::Directory
The directory class object provides an enumeration of DirectoryItems.
Definition: file.hxx:1638
osl::Directory::getNextItem
RC getNextItem(DirectoryItem &rItem, sal_uInt32 nHint=0)
Retrieve the next item of a previously opened directory.
Definition: file.hxx:1785
osl::Directory::remove
static RC remove(const ::rtl::OUString &ustrDirectoryURL)
Remove an empty directory.
Definition: file.hxx:1895
osl::Directory::getURL
rtl::OUString getURL() const
Obtain the URL.
Definition: file.hxx:1680
osl::Directory::createPath
static RC createPath(const ::rtl::OUString &aDirectoryUrl, DirectoryCreationObserver *aDirectoryCreationObserver=NULL)
Create a directory path.
Definition: file.hxx:1936
osl::Directory::~Directory
~Directory()
Destructor.
Definition: file.hxx:1668
osl::Directory::reset
RC reset()
Resets the directory item enumeration to the beginning.
Definition: file.hxx:1757
osl::Directory::open
RC open()
Open a directory for enumerating its contents.
Definition: file.hxx:1699
osl::Directory::close
RC close()
Close a directory.
Definition: file.hxx:1727
osl::Directory::Directory
Directory(const ::rtl::OUString &strPath)
Constructor.
Definition: file.hxx:1661
osl::Directory::create
static RC create(const ::rtl::OUString &ustrDirectoryURL, sal_uInt32 flags=osl_File_OpenFlag_Read|osl_File_OpenFlag_Write)
Create a directory.
Definition: file.hxx:1861
osl::Directory::getVolumeInfo
static RC getVolumeInfo(const ::rtl::OUString &ustrDirectoryURL, VolumeInfo &rInfo)
Retrieve information about a volume.
Definition: file.hxx:1826
osl::Directory::isOpen
bool isOpen()
Query if directory is open.
Definition: file.hxx:1714
osl::Socket
Definition: socket_decl.hxx:196
TimeValue
Definition: time.h:72