diff options
author | Michael Meeks <michael.meeks@suse.com> | 2012-01-19 14:01:33 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-01-19 14:01:33 +0000 |
commit | 13a752cdbb9e2c1e2c0f922158f03fc70c12245c (patch) | |
tree | 050e47c940f84f196a2ed884af49d3543a5083c7 /sal | |
parent | 9f03ad248e2e0151facadee0738a7fa6158743f9 (diff) |
sal: expose a public API for comparing directory items
Windows impl. still pending.
Diffstat (limited to 'sal')
-rw-r--r-- | sal/inc/osl/file.h | 24 | ||||
-rw-r--r-- | sal/inc/osl/file.hxx | 26 | ||||
-rw-r--r-- | sal/util/sal.map | 2 |
3 files changed, 50 insertions, 2 deletions
diff --git a/sal/inc/osl/file.h b/sal/inc/osl/file.h index 0e0d7657679c..3bcd877e78a8 100644 --- a/sal/inc/osl/file.h +++ b/sal/inc/osl/file.h @@ -316,6 +316,30 @@ SAL_DLLPUBLIC oslFileError SAL_CALL osl_acquireDirectoryItem( SAL_DLLPUBLIC oslFileError SAL_CALL osl_releaseDirectoryItem( oslDirectoryItem Item ); +/** Determine if two directory items point the the same underlying file + + The comparison is done first by URL, and then by resolving links to + find the target, and finally by comparing inodes on unix. + + @param pItemA [in] + A directory handle to compare with another handle + + @param pItemB [in] + A directory handle to compare with pItemA + + @return + sal_True: if the items point to an identical resource<br> + sal_False: if the items point to a different resource, or a fatal error occured<br> + + @see osl_getDirectoryItem() + + @since LibreOffice 3.6 +*/ + +SAL_DLLPUBLIC sal_Bool SAL_CALL osl_identicalDirectoryItem( + oslDirectoryItem pItemA, + oslDirectoryItem pItemB ); + /* File types */ typedef enum { diff --git a/sal/inc/osl/file.hxx b/sal/inc/osl/file.hxx index d9a1d89fe84c..85393f515af2 100644 --- a/sal/inc/osl/file.hxx +++ b/sal/inc/osl/file.hxx @@ -1389,9 +1389,9 @@ public: class DirectoryItem: public FileBase { + oslDirectoryItem _pData; public: - oslDirectoryItem _pData; /** Constructor. */ @@ -1529,6 +1529,30 @@ public: return (RC) osl_getFileStatus( _pData, &rStatus._aStatus, rStatus._nMask ); } +/** Determine if two directory items point the the same underlying file + + The comparison is done first by URL, and then by resolving links to + find the target, and finally by comparing inodes on unix. + + @param pItemA [in] + A directory handle to compare with another handle + + @param pItemB [in] + A directory handle to compare with pItemA + + @return + sal_True: if the items point to an identical resource<br> + sal_False: if the items point to a different resource, or a fatal error occured<br> + + @see osl_getDirectoryItem() + + @since LibreOffice 3.6 +*/ + inline sal_Bool isIdenticalTo( const DirectoryItem &pOther ) + { + return osl_identicalDirectoryItem( _pData, pOther._pData ); + } + friend class Directory; }; diff --git a/sal/util/sal.map b/sal/util/sal.map index 02610f554bd2..1e9753b4845d 100644 --- a/sal/util/sal.map +++ b/sal/util/sal.map @@ -613,6 +613,7 @@ LIBO_UDK_3.5 { # symbols available in >= LibO 3.5 LIBO_UDK_3.6 { # symbols available in >= LibO 3.6 global: osl_unmapMappedFile; + osl_identicalDirectoryItem; } UDK_3.10; PRIVATE_1.0 { @@ -647,7 +648,6 @@ PRIVATE_textenc.1 { # LibreOffice 3.6 PRIVATE_file.1 { # LibreOffice 3.6 global: - osl_identicalDirectoryItem; osl_getFileOSHandle; }; |