| 1 | /**************************************************************************** |
| 2 | * Copyright (C) 2013 Woboq UG (haftungsbeschraenkt) |
| 3 | * Olivier Goffart <contact at woboq.com> |
| 4 | * https://woboq.com/codebrowser.html |
| 5 | * |
| 6 | * This file is part of the Woboq Code Browser. |
| 7 | * |
| 8 | * Commercial License Usage: |
| 9 | * Licensees holding valid commercial licenses provided by Woboq may use |
| 10 | * this file in accordance with the terms contained in a written agreement |
| 11 | * between the licensee and Woboq. |
| 12 | * For further information see https://woboq.com/codebrowser.html |
| 13 | * |
| 14 | * Alternatively, this work may be used under a Creative Commons |
| 15 | * Attribution-NonCommercial-ShareAlike 3.0 (CC-BY-NC-SA 3.0) License. |
| 16 | * http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_US |
| 17 | * This license does not allow you to use the code browser to assist the |
| 18 | * development of your commercial software. If you intent to do so, consider |
| 19 | * purchasing a commercial licence. |
| 20 | ****************************************************************************/ |
| 21 | |
| 22 | #pragma once |
| 23 | |
| 24 | #include <llvm/ADT/SmallString.h> |
| 25 | #include <llvm/ADT/SmallVector.h> |
| 26 | #include <llvm/Support/FileSystem.h> |
| 27 | |
| 28 | #include <system_error> |
| 29 | |
| 30 | namespace llvm { |
| 31 | class Twine; |
| 32 | } |
| 33 | |
| 34 | /* Is declared in llvm::sys::fs, but not implemented */ |
| 35 | std::error_code canonicalize(const llvm::Twine &path, llvm::SmallVectorImpl<char> &result); |
| 36 | |
| 37 | /* The one in llvm::sys::fs do not create the directory with the right peromissions */ |
| 38 | std::error_code create_directories(const llvm::Twine &path); |
| 39 | |
| 40 | std::string naive_uncomplete(llvm::StringRef base, llvm::StringRef path); |
| 41 | |
| 42 | void make_forward_slashes(char *str); |
| 43 | void make_forward_slashes(std::string &str); |
| 44 | void replace_invalid_filename_chars(std::string &str); |
| 45 | |