LLDB mainline
SBFormat.cpp
Go to the documentation of this file.
1//===-- SBFormat.cpp ------------------------------------------------------===//
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#include "lldb/API/SBFormat.h"
10#include "Utils.h"
12#include "lldb/lldb-types.h"
13#include <lldb/API/SBError.h>
14#include <lldb/Utility/Status.h>
15
16using namespace lldb;
17using namespace lldb_private;
18
19SBFormat::SBFormat() : m_opaque_sp() {}
20
23}
24
25SBFormat::~SBFormat() = default;
26
28 if (this != &rhs)
30 return *this;
31}
32
33SBFormat::operator bool() const { return (bool)m_opaque_sp; }
34
35SBFormat::SBFormat(const char *format, lldb::SBError &error) {
36 FormatEntrySP format_entry_sp = std::make_shared<FormatEntity::Entry>();
37 Status status = FormatEntity::Parse(format, *format_entry_sp);
38
39 error.SetError(status);
40 if (error.Success())
41 m_opaque_sp = format_entry_sp;
42}
43
static llvm::raw_ostream & error(Stream &strm)
Class that represents a format string that can be used to generate descriptions of objects like frame...
Definition: SBFormat.h:28
lldb::FormatEntrySP GetFormatEntrySP() const
Definition: SBFormat.cpp:44
lldb::FormatEntrySP m_opaque_sp
The storage for this object.
Definition: SBFormat.h:62
lldb::SBFormat & operator=(const lldb::SBFormat &rhs)
Definition: SBFormat.cpp:27
An error handling class.
Definition: Status.h:44
Status Parse(const llvm::StringRef &format, Entry &entry)
A class that represents a running process on the host machine.
std::unique_ptr< T > clone(const std::unique_ptr< T > &src)
Definition: Utils.h:17
Definition: SBAddress.h:15
std::shared_ptr< lldb_private::FormatEntity::Entry > FormatEntrySP
Definition: lldb-forward.h:349