|
|
|||
File indexing completed on 2026-05-10 08:42:58
0001 //===--------------------- TildeExpressionResolver.h ------------*- C++ -*-===// 0002 // 0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 0004 // See https://llvm.org/LICENSE.txt for license information. 0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 0006 // 0007 //===----------------------------------------------------------------------===// 0008 0009 #ifndef LLDB_UTILITY_TILDEEXPRESSIONRESOLVER_H 0010 #define LLDB_UTILITY_TILDEEXPRESSIONRESOLVER_H 0011 0012 #include "llvm/ADT/StringRef.h" 0013 #include "llvm/ADT/StringSet.h" 0014 0015 namespace llvm { 0016 template <typename T> class SmallVectorImpl; 0017 } 0018 0019 namespace lldb_private { 0020 class TildeExpressionResolver { 0021 public: 0022 virtual ~TildeExpressionResolver(); 0023 0024 /// Resolve a Tilde Expression contained according to bash rules. 0025 /// 0026 /// \param Expr Contains the tilde expression to resolve. A valid tilde 0027 /// expression must begin with a tilde and contain only non 0028 /// separator characters. 0029 /// 0030 /// \param Output Contains the resolved tilde expression, or the original 0031 /// input if the tilde expression could not be resolved. 0032 /// 0033 /// \returns true if \p Expr was successfully resolved, false otherwise. 0034 virtual bool ResolveExact(llvm::StringRef Expr, 0035 llvm::SmallVectorImpl<char> &Output) = 0; 0036 0037 /// Auto-complete a tilde expression with all matching values. 0038 /// 0039 /// \param Expr Contains the tilde expression prefix to resolve. See 0040 /// ResolveExact() for validity rules. 0041 /// 0042 /// \param Output Contains all matching home directories, each one 0043 /// itself unresolved (i.e. you need to call ResolveExact 0044 /// on each item to turn it into a real path). 0045 /// 0046 /// \returns true if there were any matches, false otherwise. 0047 virtual bool ResolvePartial(llvm::StringRef Expr, 0048 llvm::StringSet<> &Output) = 0; 0049 0050 /// Resolve an entire path that begins with a tilde expression, replacing 0051 /// the username portion with the matched result. 0052 bool ResolveFullPath(llvm::StringRef Expr, 0053 llvm::SmallVectorImpl<char> &Output); 0054 }; 0055 0056 class StandardTildeExpressionResolver : public TildeExpressionResolver { 0057 public: 0058 bool ResolveExact(llvm::StringRef Expr, 0059 llvm::SmallVectorImpl<char> &Output) override; 0060 bool ResolvePartial(llvm::StringRef Expr, llvm::StringSet<> &Output) override; 0061 }; 0062 } 0063 0064 #endif // LLDB_UTILITY_TILDEEXPRESSIONRESOLVER_H
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|