ROSE  0.11.145.0
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. More...
 
const AddressIntervalwhere () const
 Where the string is located in memory. More...
 
rose_addr_t address () const
 Starting address of string in memory. More...
 
size_t size () const
 Size of encoded string in bytes. More...
 
size_t length () const
 Length of encoded string in code points. More...
 
const CodePointscodePoints () const
 Code points associated with the string. More...
 
std::string narrow () const
 Return code points as a C++ std::string. More...
 
std::wstring wide () const
 Return code points as a C++ std::wstring. More...
 
void decode (const MemoryMap &)
 Decodes the string from memory. More...
 

Member Function Documentation

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

Information about the string encoding.

Definition at line 766 of file String.h.

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

Where the string is located in memory.

Definition at line 769 of file String.h.

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_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().

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

Length of encoded string in code points.

Definition at line 778 of file String.h.

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.

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

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

This truncates each code point to eight bits.

std::wstring Rose::BinaryAnalysis::Strings::EncodedString::wide ( ) const

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

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: