[NFC][Coroutines] Use structured binding with llvm::enumerate in CoroSplit (#116879)
[llvm-project.git] / lldb / unittests / TestingSupport / MockTildeExpressionResolver.h
blobc96e2d248bfb8df47bbb8ebb5ad8a803a283b71f
1 //===-- MockTildeExpressionResolver.h ---------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_UNITTESTS_TESTINGSUPPORT_MOCKTILDEEXPRESSIONRESOLVER_H
10 #define LLDB_UNITTESTS_TESTINGSUPPORT_MOCKTILDEEXPRESSIONRESOLVER_H
12 #include "lldb/Utility/TildeExpressionResolver.h"
14 #include "llvm/ADT/SmallString.h"
15 #include "llvm/ADT/StringMap.h"
17 namespace lldb_private {
18 class MockTildeExpressionResolver : public TildeExpressionResolver {
19 llvm::StringRef CurrentUser;
20 llvm::StringMap<llvm::StringRef> UserDirectories;
22 public:
23 MockTildeExpressionResolver(llvm::StringRef CurrentUser,
24 llvm::StringRef HomeDir);
26 void AddKnownUser(llvm::StringRef User, llvm::StringRef HomeDir);
27 void Clear();
28 void SetCurrentUser(llvm::StringRef User);
30 bool ResolveExact(llvm::StringRef Expr,
31 llvm::SmallVectorImpl<char> &Output) override;
32 bool ResolvePartial(llvm::StringRef Expr, llvm::StringSet<> &Output) override;
34 } // namespace lldb_private
36 #endif