ROSE 0.11.145.147
Public Member Functions | List of all members
Rose::BinaryAnalysis::Strings::EncodedString Class Reference

Description

An encoder plus interval.

Represents a string by specifying the encoding and an interval of virtual addresses where the encoded octets are stored.

Definition at line 757 of file String.h.

#include <Rose/BinaryAnalysis/String.h>

Public Member Functions

 EncodedString (const StringEncodingScheme::Ptr &encoder, const AddressInterval &where)
 
StringEncodingScheme::Ptr encoder () const
 Information about the string encoding.
 
const AddressIntervalwhere () const
 Where the string is located in memory.
 
rose_addr_t address () const
 Starting address of string in memory.
 
size_t size () const
 Size of encoded string in bytes.
 
size_t length () const
 Length of encoded string in code points.
 
const CodePointscodePoints () const
 Code points associated with the string.
 
std::string narrow () const
 Return code points as a C++ std::string.
 
std::wstring wide () const
 Return code points as a C++ std::wstring.
 
void decode (const MemoryMap &)
 Decodes the string from memory.
 

Constructor & Destructor Documentation

◆ EncodedString() [1/2]

Rose::BinaryAnalysis::Strings::EncodedString::EncodedString ( )
inline

Definition at line 761 of file String.h.

◆ EncodedString() [2/2]

Rose::BinaryAnalysis::Strings::EncodedString::EncodedString ( const StringEncodingScheme::Ptr encoder,
const AddressInterval where 
)
inline

Definition at line 762 of file String.h.

Member Function Documentation

◆ encoder()

StringEncodingScheme::Ptr Rose::BinaryAnalysis::Strings::EncodedString::encoder ( ) const
inline

Information about the string encoding.

Definition at line 766 of file String.h.

◆ where()

const AddressInterval & Rose::BinaryAnalysis::Strings::EncodedString::where ( ) const
inline

Where the string is located in memory.

Definition at line 769 of file String.h.

◆ address()

rose_addr_t Rose::BinaryAnalysis::Strings::EncodedString::address ( ) const
inline

Starting address of string in memory.

Definition at line 772 of file String.h.

References Sawyer::Container::Interval< T >::least().

◆ size()

size_t Rose::BinaryAnalysis::Strings::EncodedString::size ( ) const
inline

Size of encoded string in bytes.

Definition at line 775 of file String.h.

References Sawyer::Container::Interval< T >::size().

◆ length()

size_t Rose::BinaryAnalysis::Strings::EncodedString::length ( ) const
inline

Length of encoded string in code points.

Definition at line 778 of file String.h.

◆ codePoints()

const CodePoints & Rose::BinaryAnalysis::Strings::EncodedString::codePoints ( ) const
inline

Code points associated with the string.

If code points have been consumed then they may be partly or fully absent from the decoder.

Definition at line 783 of file String.h.

◆ narrow()

std::string Rose::BinaryAnalysis::Strings::EncodedString::narrow ( ) const

Return code points as a C++ std::string.

This truncates each code point to eight bits.

◆ decode()

void Rose::BinaryAnalysis::Strings::EncodedString::decode ( const MemoryMap )

Decodes the string from memory.

A string need not store its code points, in which case this method can decode them from memory. The memory should be the same as when the string was originally found, otherwise an std::runtime_error might be thrown.


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