libcwdversion 2.0.0
The C++ Debugging Support Library
Loading...
Searching...
No Matches
ObjectFileName.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Carlo Wood
2// SPDX-License-Identifier: MIT
3
4#pragma once
5
9
10#ifndef LIBCWD_CLASS_OBJECT_FILE2_H
11#define LIBCWD_CLASS_OBJECT_FILE2_H
12
13#include <string>
14
15namespace libcwd {
16
17// Forward declarations.
18namespace dwarf {
19class ObjectFileRegistry;
20} // namespace dwarf
21
24
37class ObjectFileName
38{
39 private:
40 char const* filepath_; // The full path to the object file (internally allocated and leaking memory).
41 char const* filename_; // Points inside filepath_ just after the last '/' or to the beginning.
42 mutable bool no_debug_line_sections_;
43
44 protected:
45 friend class dwarf::ObjectFileRegistry;
46 ObjectFileName(char const* filepath);
47
48 public:
50 char const* filepath() const { return filepath_; }
52 char const* filename() const { return filename_; }
53
54 // For internal use.
55 void set_has_no_debug_line_sections() const { no_debug_line_sections_ = true; }
56 bool has_no_debug_line_sections() const { return no_debug_line_sections_; }
57};
58 // End of group 'source-file-line-number-information'
60
61} // namespace libcwd
62
63#endif // LIBCWD_CLASS_OBJECT_FILE2_H
char const * filename() const
The file name of the loaded executable or shared library (with path stripped off).
Definition ObjectFileName.h:52
char const * filepath() const
The full path name of the loaded executable or shared library.
Definition ObjectFileName.h:50
namespace for libcwd.