Avoid potential negative array index access to cached text.
[LibreOffice.git] / include / unotest / directories.hxx
blobefdcd93a6acf05ad19d728160bf28b1b60629dcf
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
10 #ifndef INCLUDED_UNOTEST_DIRECTORIES_HXX
11 #define INCLUDED_UNOTEST_DIRECTORIES_HXX
13 #include <sal/config.h>
15 #include <string_view>
17 #include <rtl/ustring.hxx>
18 #include <unotest/detail/unotestdllapi.hxx>
20 namespace test
22 class OOO_DLLPUBLIC_UNOTEST Directories
24 private:
25 OUString m_aSrcRootURL;
26 OUString m_aSrcRootPath;
27 OUString m_aWorkdirRootURL;
28 OUString m_aWorkdirRootPath;
30 public:
31 Directories();
33 const OUString& getSrcRootURL() const { return m_aSrcRootURL; }
34 const OUString& getSrcRootPath() const { return m_aSrcRootPath; }
36 // return a URL to a given path from the source directory
37 OUString getURLFromSrc(std::u16string_view rPath) const;
39 // return a Path to a given path from the source directory
40 OUString getPathFromSrc(std::u16string_view rPath) const;
42 // return a URL to a given path from the workdir directory
43 OUString getURLFromWorkdir(std::u16string_view rPath) const;
45 // return a Path to a given path from the workdir directory
46 OUString getPathFromWorkdir(std::u16string_view rPath) const;
50 #endif
52 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */