summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-09-05 16:52:32 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-09-05 23:31:44 +0200
commit27c886f5aa8e53b22caf0ef9d721f60e77cd65f2 (patch)
tree77737112fab7fdfe981a153ec0b5ea3611d3b451 /sal
parentde146784684789174616108817f5c9df7c000e81 (diff)
Clean up {osl_,osl::}systemPathEnsureSeparator combo
Change-Id: Iafa953725c1ca8e6f3032945dc0700ae989519b9 Reviewed-on: https://gerrit.libreoffice.org/78671 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/file_path_helper.cxx12
-rw-r--r--sal/osl/unx/file_path_helper.hxx35
2 files changed, 8 insertions, 39 deletions
diff --git a/sal/osl/unx/file_path_helper.cxx b/sal/osl/unx/file_path_helper.cxx
index 5ddef5873585..e848586ccb3e 100644
--- a/sal/osl/unx/file_path_helper.cxx
+++ b/sal/osl/unx/file_path_helper.cxx
@@ -58,7 +58,9 @@ void osl_systemPathRemoveSeparator(rtl_uString* pustrPath)
}
}
-void osl_systemPathEnsureSeparator(OUString* ppustrPath)
+namespace {
+
+void systemPathEnsureSeparator(OUString* ppustrPath)
{
assert(nullptr != ppustrPath);
sal_Int32 lp = ppustrPath->getLength();
@@ -71,7 +73,9 @@ void osl_systemPathEnsureSeparator(OUString* ppustrPath)
SAL_WARN_IF( !ppustrPath->endsWith(FPH_PATH_SEPARATOR),
"sal.osl",
- "osl_systemPathEnsureSeparator: Post condition failed");
+ "systemPathEnsureSeparator: Post condition failed");
+}
+
}
bool osl_systemPathIsRelativePath(const rtl_uString* pustrPath)
@@ -87,7 +91,7 @@ OUString osl::systemPathMakeAbsolutePath(
OUString base(BasePath);
if (!base.isEmpty())
- osl_systemPathEnsureSeparator(&base);
+ systemPathEnsureSeparator(&base);
return base + RelPath;
}
@@ -224,7 +228,7 @@ bool osl_searchPath(
while (!pli.done())
{
OUString p = pli.get_current_item();
- osl::systemPathEnsureSeparator(p);
+ systemPathEnsureSeparator(&p);
p += fp;
if (osl::access(p, F_OK) > -1)
diff --git a/sal/osl/unx/file_path_helper.hxx b/sal/osl/unx/file_path_helper.hxx
index 9fe7c8e047e9..b969cfebf5ba 100644
--- a/sal/osl/unx/file_path_helper.hxx
+++ b/sal/osl/unx/file_path_helper.hxx
@@ -39,19 +39,6 @@
void osl_systemPathRemoveSeparator(rtl_uString* pustrPath);
/**
- Adds a trailing path separator to the given system path if not already there
- and if the path is not the root path '/'
-
- @param pustrPath [inout] a system path if the path is not the root path
- '/' and has no trailing separator a separator
- will be added ppustrPath must not be NULL
-
- @returns nothing
-
-*/
-void osl_systemPathEnsureSeparator(OUString* ppustrPath);
-
-/**
Returns true if the given path is a relative path and so starts not with '/'
@param pustrPath [in] a system path - must not be NULL
@@ -165,28 +152,6 @@ namespace osl
}
/*******************************************
- systemPathEnsureSeparator
- Adds a trailing path separator to the
- given system path if not already there
- and if the path is not the root path '/'
-
- @param pustrPath [inout] a system path
- if the path is not the root path
- '/' and has no trailing separator
- a separator will be added
- ppustrPath must not be NULL and
- must point to a valid rtl_uString
-
- @returns nothing
-
- ******************************************/
-
- inline void systemPathEnsureSeparator(/*inout*/ OUString& Path)
- {
- osl_systemPathEnsureSeparator(&Path);
- }
-
- /*******************************************
systemPathIsRelativePath
Returns true if the given path is a
relative path and so starts not with '/'