summaryrefslogtreecommitdiff
path: root/configmgr/source/inc
diff options
context:
space:
mode:
authorDirk Grobler <dg@openoffice.org>2001-09-18 18:12:17 +0000
committerDirk Grobler <dg@openoffice.org>2001-09-18 18:12:17 +0000
commit20c22b99129a4bcefbca6976f9c6329bb7ac7a72 (patch)
tree4e6654be331c50a90bec1aa787916b3c7a2a9b8a /configmgr/source/inc
parent3ac225c65b392558bc4fbd93a0a6b2a3f720a20f (diff)
#91972# correction of pathhandling, pathhepler replaced by lookup context
Diffstat (limited to 'configmgr/source/inc')
-rw-r--r--configmgr/source/inc/filehelper.hxx63
-rw-r--r--configmgr/source/inc/mergechange.hxx7
2 files changed, 53 insertions, 17 deletions
diff --git a/configmgr/source/inc/filehelper.hxx b/configmgr/source/inc/filehelper.hxx
index 21773087fd4a..4491af9af990 100644
--- a/configmgr/source/inc/filehelper.hxx
+++ b/configmgr/source/inc/filehelper.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: filehelper.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: lla $ $Date: 2001-05-14 12:06:26 $
+ * last change: $Author: dg $ $Date: 2001-09-18 19:11:44 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -70,31 +70,64 @@
#include <com/sun/star/io/IOException.hpp>
#endif
+namespace io = com::sun::star::io;
+
namespace configmgr
{
+ //==========================================================================
+ //= FileHelper
+ //==========================================================================
+ /** Within the FileHelper namespace there is a list of methods declared, which ease
+ specific file operations.
+ */
namespace FileHelper
{
- namespace io = com::sun::star::io;
+ /// delimiter used in URLs and ConfPath
+ static const ::sal_Unicode delimiter = sal_Unicode('/');
- // convert a filename like "d:\foo\bar\file.xyz to
- // something like file:///d|/foo/bar/file.xyz
- rtl::OUString convertFilenameToFileURL(rtl::OUString const& _sFilename);
+ /// string representation of the delimiter
+ const rtl::OUString& delimiterAsString();
- void createBackupRemoveAndRename(
- const rtl::OUString& _aFromURL, const rtl::OUString &_aToURL) throw (io::IOException);
+ /// Tests if the file exists.
+ bool fileExists(rtl::OUString const& _sFileURL);
+ /// Tests if the directory exists.
+ bool dirExists(rtl::OUString const& _sDirURL);
- void tryToRemoveFile(const rtl::OUString& _aURL) throw (io::IOException);
+ /** Returns the parent part of the pathname of this File URL,
+ or an empty string if the name has no parent part.
+ The parent part is generally everything leading up to the last occurrence
+ of the separator character.
+ */
+ rtl::OUString getParentDir(rtl::OUString const& _aFileURL);
- rtl::OUString createOSLErrorString(osl::FileBase::RC eError);
+ /** creates a directory whose pathname is specified by a FileURL.
+ @return true if directory could be created or does exist, otherwise false.
+ */
+ bool mkdir(rtl::OUString const& _sDirURL);
+
+ /** creates a directory whose pathname is specified by a FileURL,
+ including any necessary parent directories.
+ @return true if directory (or directories) could be created or do(es) exist, otherwise false.
+ */
+ bool mkdirs(rtl::OUString const& _aDirectory);
- bool fileExist(rtl::OUString const& _aFileURL);
- bool directoryExist(rtl::OUString const& _aDirexURL);
+ /** replaces a file specified by _aFromURL with a file specified by _aToURL.
+ */
+ void replaceFile(const rtl::OUString& _aFromURL, const rtl::OUString &_aToURL) throw (io::IOException);
- rtl::OUString splitDirectoryOff(rtl::OUString const& _sFilename);
- inline const sal_Unicode getFileDelimiter() { return sal_Unicode('/'); }
+ /** removes a file specified by _aURL. Ignores the case of a non-existing file.
+ */
+ void removeFile(const rtl::OUString& _aURL) throw (io::IOException);
+
+ /** creates an error msg string for a given file error return code.
+ */
+ rtl::OUString createOSLErrorString(osl::FileBase::RC eError);
- TimeValue getFileModificationStamp(rtl::OUString const& _aNormalizedFilename) throw (io::IOException);
+ /** determines the modification time of a directory entry specified by a URL.
+ @return the TimeValue of the last modification, if the file exists, otherwise a TimeValue(0,0).
+ */
+ TimeValue getModifyTime(rtl::OUString const& _aNormalizedFilename) throw (io::IOException);
}
} // namespace configmgr
diff --git a/configmgr/source/inc/mergechange.hxx b/configmgr/source/inc/mergechange.hxx
index a6205ebfd8e4..f1b641adede4 100644
--- a/configmgr/source/inc/mergechange.hxx
+++ b/configmgr/source/inc/mergechange.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: mergechange.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: jb $ $Date: 2001-07-16 17:00:30 $
+ * last change: $Author: dg $ $Date: 2001-09-18 19:11:44 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -103,6 +103,9 @@ namespace configmgr
virtual void handle(SubtreeChange const& _rSubtree);
};
+ // method that applies changes on a existing subtree
+ void applyChanges(TreeChangeList & _aTreeChangeList, ISubtree& _aSubtree);
+
// -----------------------------------------------------------------------------
class OMergeChanges : private ChangeTreeAction, private OPathCreator<RelativePath>
{