1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_TOOLS_PATHUTILS_HXX
20 #define INCLUDED_TOOLS_PATHUTILS_HXX
22 #include <sal/config.h>
26 #define WIN32_LEAN_AND_MEAN
29 // The compiled code is not part of the tl dynamic library, but is delivered as
30 // pathutils-obj and pathutils-slo objects (it is linked into special
31 // executables and dynamic libraries that do not link against OOo libraries):
34 /** Determine the filename part of a path.
36 A non-NULL pointer to a null-terminated path.
38 A pointer to the trailing filename part of the given path.
40 WCHAR
* filename(WCHAR
* path
);
42 /** Concatenate two paths.
44 Either the first path is empty and the second path is an absolute path. Or
45 the first path is an absolute path that ends in a backslash and the second
46 path is a relative path. In the latter case, to avoid paths that grow too
47 long, leading .. segments of the second path are removed together with
48 trailing segments from the first path. This should not cause problems as long
49 as there are no symbolic links on Windows (as with symbolic links, x\y\.. and
50 x might denote different directories).
53 An output parameter taking the resulting path; must point at a valid
54 range of memory of size at least MAX_PATH. If NULL is returned, the
55 content is unspecified.
56 @param frontBegin, frontEnd
57 Forms a valid range [frontBegin .. frontEnd) of less than MAX_PATH size.
58 @param backBegin, backLength
59 Forms a valid range [backBegin .. backBegin + backLength) of less than
62 A pointer to the terminating null character of the concatenation, or NULL
63 if a failure occurred.
66 WCHAR
* path
, WCHAR
const * frontBegin
, WCHAR
const * frontEnd
,
67 WCHAR
const * backBegin
, std::size_t backLength
);
74 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */