1 //===-- MockTildeExpressionResolver.h ---------------------------*- C++ -*-===//
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
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
;
23 MockTildeExpressionResolver(llvm::StringRef CurrentUser
,
24 llvm::StringRef HomeDir
);
26 void AddKnownUser(llvm::StringRef User
, llvm::StringRef HomeDir
);
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