LLDB  mainline
TypeValidator.cpp
Go to the documentation of this file.
1 //===-- TypeValidator.cpp ---------------------------------------*- 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 //===----------------------------------------------------------------------===//
8 
9 
10 
11 
14 
15 using namespace lldb;
16 using namespace lldb_private;
17 
18 TypeValidatorImpl::TypeValidatorImpl(const Flags &flags)
19  : m_flags(flags), m_my_revision(0) {}
20 
22 
25 }
26 
28 TypeValidatorImpl::Failure(std::string message) {
30 }
31 
33  ValidatorFunction f, std::string d, const TypeValidatorImpl::Flags &flags)
34  : TypeValidatorImpl(flags), m_description(d), m_validator_function(f) {}
35 
37 
40  if (!valobj)
41  return Success(); // I guess there's nothing wrong with a null valueobject..
42 
43  return m_validator_function(valobj);
44 }
45 
47  StreamString sstr;
48  sstr.Printf("%s%s%s%s", m_description.c_str(),
49  Cascades() ? "" : " (not cascading)",
50  SkipsPointers() ? " (skip pointers)" : "",
51  SkipsReferences() ? " (skip references)" : "");
52  return sstr.GetString();
53 }
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
static ValidationResult Failure(std::string message)
static ValidationResult Success()
ValidationResult FormatObject(ValueObject *valobj) const override
TypeValidatorImpl_CXX(ValidatorFunction f, std::string d, const TypeValidatorImpl::Flags &flags=Flags())
llvm::StringRef GetString() const
std::string GetDescription() override
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:106
Definition: SBAddress.h:15
std::function< TypeValidatorImpl::ValidationResult(ValueObject *valobj)> ValidatorFunction