diff options
| author | Stefan Boberg <[email protected]> | 2026-04-23 18:16:57 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2026-04-23 18:16:57 +0200 |
| commit | 0232b991cd7d8e3a2114ea30e4591dd3e7b65c36 (patch) | |
| tree | 94730e7594fd09ae1fa820391ce311f6daf13905 /thirdparty/raw_pdb/src/PDB_RawFile.h | |
| parent | Fix forward declaration order for s_GotSigWinch and SigWinchHandler (diff) | |
| parent | trace: declare Region event name fields as AnsiString (#1012) (diff) | |
| download | archived-zen-sb/zen-help.tar.xz archived-zen-sb/zen-help.zip | |
Merge branch 'main' into sb/zen-helpsb/zen-help
- Combine HelpCommand (this branch) with HistoryCommand (main) in zen CLI dispatcher
- Keep filter-aware TuiPickOne rewrite; adopt main's ASCII arrow glyphs in doc comment
Diffstat (limited to 'thirdparty/raw_pdb/src/PDB_RawFile.h')
| -rw-r--r-- | thirdparty/raw_pdb/src/PDB_RawFile.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/thirdparty/raw_pdb/src/PDB_RawFile.h b/thirdparty/raw_pdb/src/PDB_RawFile.h new file mode 100644 index 000000000..bf886734c --- /dev/null +++ b/thirdparty/raw_pdb/src/PDB_RawFile.h @@ -0,0 +1,66 @@ +// Copyright 2011-2022, Molecular Matters GmbH <[email protected]> +// See LICENSE.txt for licensing details (2-clause BSD License: https://opensource.org/licenses/BSD-2-Clause) + +#pragma once + +#include "Foundation/PDB_Macros.h" +#include "PDB_CoalescedMSFStream.h" + + +// https://llvm.org/docs/PDB/index.html +namespace PDB +{ + struct SuperBlock; + + + class PDB_NO_DISCARD RawFile + { + public: + RawFile(RawFile&& other) PDB_NO_EXCEPT; + RawFile& operator=(RawFile&& other) PDB_NO_EXCEPT; + + explicit RawFile(const void* data) PDB_NO_EXCEPT; + ~RawFile(void) PDB_NO_EXCEPT; + + // Creates any type of MSF stream. + template <typename T> + PDB_NO_DISCARD T CreateMSFStream(uint32_t streamIndex) const PDB_NO_EXCEPT; + + // Creates any type of MSF stream with the given size. + template <typename T> + PDB_NO_DISCARD T CreateMSFStream(uint32_t streamIndex, uint32_t streamSize) const PDB_NO_EXCEPT; + + + // Returns the SuperBlock. + PDB_NO_DISCARD inline const SuperBlock* GetSuperBlock(void) const PDB_NO_EXCEPT + { + return m_superBlock; + } + + // Returns the number of streams in the PDB file. + PDB_NO_DISCARD inline uint32_t GetStreamCount(void) const PDB_NO_EXCEPT + { + return m_streamCount; + } + + // Returns the size of the stream with the given index, taking into account nil page sizes. + PDB_NO_DISCARD inline uint32_t GetStreamSize(uint32_t streamIndex) const PDB_NO_EXCEPT + { + const uint32_t streamSize = m_streamSizes[streamIndex]; + + return (streamSize == NilPageSize) ? 0u : streamSize; + } + + private: + const void* m_data; + const SuperBlock* m_superBlock; + CoalescedMSFStream m_directoryStream; + + // stream directory + uint32_t m_streamCount; + const uint32_t* m_streamSizes; + const uint32_t** m_streamBlocks; + + PDB_DISABLE_COPY(RawFile); + }; +} |