libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
introvirt::windows::WStr Class Reference

Basic raw UTF-16 string wrapper. More...

#include <WStr.hh>

Inheritance diagram for introvirt::windows::WStr:
Collaboration diagram for introvirt::windows::WStr:

Public Member Functions

uint16_t Length () const override
 
uint16_t MaximumLength () const
 
const uint8_t * Buffer () const override
 
void set (const std::u16string &value) override
 Update the buffer with a new value.
 
guest_ptr< void > ptr () const
 Get the address of the buffer in the guest.
 
 WStr (const guest_ptr< void > &ptr)
 Parse a UTF16LE string from guest memory.
 
 WStr (const guest_ptr< void > &ptr, size_t buffer_size)
 Parse a UTF16LE string from guest memory.
 
 WStr (const guest_ptr< void > &ptr, size_t buffer_size, size_t len)
 Parse a UTF16LE string from guest memory.
 
 WStr (WStr &&) noexcept
 
WStroperator= (WStr &&) noexcept
 
 ~WStr () override
 
void set (const std::string &value)
 Sets the value of the string.
 
virtual void set (const std::u16string &value)=0
 Sets the value of the string.
 
- Public Member Functions inherited from introvirt::windows::Utf16String
const std::string & utf8 () const
 
const std::u16string & utf16 () const
 
void set (const std::string &value)
 Sets the value of the string.
 
 operator const std::u16string & () const
 
bool operator== (const std::string &) const
 
bool operator== (const std::u16string &) const
 
bool operator< (const std::string &) const
 
bool operator< (const std::u16string &) const
 
bool equals (const std::string &) const
 
bool equals (const std::u16string &) const
 
bool iequals (const std::string &) const
 
bool iequals (const std::u16string &) const
 
bool starts_with (const std::string &) const
 
bool starts_with (const std::u16string &) const
 
bool istarts_with (const std::string &) const
 
bool istarts_with (const std::u16string &) const
 
bool ends_with (const std::string &) const
 
bool ends_with (const std::u16string &) const
 
bool iends_with (const std::string &) const
 
bool iends_with (const std::u16string &) const
 
 Utf16String ()
 
virtual ~Utf16String ()
 
void write (std::ostream &os, const std::string &linePrefix="") const
 
virtual Json::Value json () const
 
 Utf16String (Utf16String &&) noexcept
 
Utf16Stringoperator= (Utf16String &&) noexcept
 

Additional Inherited Members

- Static Public Member Functions inherited from introvirt::windows::Utf16String
static std::string convert (std::u16string_view src)
 Convert a UTF16 string to UTF8.
 
static std::u16string convert (std::string_view src)
 Convert a UTF8 string to UTF16.
 
- Static Public Attributes inherited from introvirt::windows::Utf16String
static const size_t npos
 
- Protected Member Functions inherited from introvirt::windows::Utf16String
void invalidate ()
 

Detailed Description

Basic raw UTF-16 string wrapper.

Constructor & Destructor Documentation

◆ WStr() [1/4]

introvirt::windows::WStr::WStr ( const guest_ptr< void > &  ptr)

Parse a UTF16LE string from guest memory.

This version attemps to automatically determine the size of the string

Parameters
ptrThe virtual address of the string.

◆ WStr() [2/4]

introvirt::windows::WStr::WStr ( const guest_ptr< void > &  ptr,
size_t  buffer_size 
)

Parse a UTF16LE string from guest memory.

This version attemps to automatically determine the size of the string

Parameters
ptrThe virtual address of the string.
buffer_sizeThe maximum size of the buffer

◆ WStr() [3/4]

introvirt::windows::WStr::WStr ( const guest_ptr< void > &  ptr,
size_t  buffer_size,
size_t  len 
)

Parse a UTF16LE string from guest memory.

This version explicitly sets the size of the string

Parameters
ptrThe virtual address of the string.
buffer_sizeThe size to map, or 0 to use the size of the string
lenThe length of the string in bytes

◆ WStr() [4/4]

introvirt::windows::WStr::WStr ( WStr &&  )
noexcept

◆ ~WStr()

introvirt::windows::WStr::~WStr ( )
override

Member Function Documentation

◆ Buffer()

const uint8_t * introvirt::windows::WStr::Buffer ( ) const
overridevirtual
Returns
The raw UTF16LE buffer

Implements introvirt::windows::Utf16String.

◆ Length()

uint16_t introvirt::windows::WStr::Length ( ) const
overridevirtual
Returns
The length of the string, in bytes

Implements introvirt::windows::Utf16String.

◆ MaximumLength()

uint16_t introvirt::windows::WStr::MaximumLength ( ) const
Returns
The maximum number of bytes we can fit in the buffer

◆ operator=()

WStr & introvirt::windows::WStr::operator= ( WStr &&  )
noexcept

◆ ptr()

guest_ptr< void > introvirt::windows::WStr::ptr ( ) const

Get the address of the buffer in the guest.

◆ set() [1/3]

void introvirt::windows::Utf16String::set ( const std::string &  value)

Sets the value of the string.

Parameters
valueThe string to set
Exceptions
BufferTooSmallExceptionif the buffer is too small for the input string

◆ set() [2/3]

void introvirt::windows::WStr::set ( const std::u16string &  value)
overridevirtual

Update the buffer with a new value.

Implements introvirt::windows::Utf16String.

◆ set() [3/3]

virtual void introvirt::windows::Utf16String::set ( const std::u16string &  value)
virtual

Sets the value of the string.

Parameters
valueThe string to set
Exceptions
BufferTooSmallExceptionif the buffer is too small for the input string

Implements introvirt::windows::Utf16String.


The documentation for this class was generated from the following file: