LLVM 23.0.0git
DXContainer.cpp File Reference

Go to the source code of this file.

Classes

class  DXNotSupportedError

Functions

static Error parseFailed (const Twine &Msg)
static bool readIsOutOfBounds (StringRef Buffer, const char *Src, size_t Size)
template<typename T>
static Error readStruct (StringRef Buffer, const char *Src, T &Struct)
template<typename T>
static Error readInteger (StringRef Buffer, const char *Src, T &Val, Twine Str="structure")
static Error readString (StringRef Buffer, const char *&Src, size_t MaxSize, StringRef &Val, Twine Desc)
 Read a null-terminated string at the position Src from Buffer, with maximum byte size of MaxSize (including the null-terminator).

Function Documentation

◆ parseFailed()

Error parseFailed ( const Twine & Msg)
static

◆ readInteger()

template<typename T>
Error readInteger ( StringRef Buffer,
const char * Src,
T & Val,
Twine Str = "structure" )
static

◆ readIsOutOfBounds()

bool readIsOutOfBounds ( StringRef Buffer,
const char * Src,
size_t Size )
static

Definition at line 23 of file DXContainer.cpp.

References llvm::StringRef::begin(), llvm::StringRef::end(), and Size.

Referenced by readInteger(), readString(), and readStruct().

◆ readString()

Error readString ( StringRef Buffer,
const char *& Src,
size_t MaxSize,
StringRef & Val,
Twine Desc )
static

Read a null-terminated string at the position Src from Buffer, with maximum byte size of MaxSize (including the null-terminator).

Advance Src by the number of bytes read.

Definition at line 65 of file DXContainer.cpp.

References llvm::StringRef::data(), llvm::StringRef::find(), llvm::Length, llvm::StringRef::npos, parseFailed(), readIsOutOfBounds(), llvm::StringRef::substr(), and llvm::Error::success().

Referenced by readSection().

◆ readStruct()

template<typename T>
Error readStruct ( StringRef Buffer,
const char * Src,
T & Struct )
static