ROSE  0.9.9.109
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 753 of file BinaryString.h.

#include <BinaryString.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 762 of file BinaryString.h.

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

Where the string is located in memory.

Definition at line 765 of file BinaryString.h.

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

Starting address of string in memory.

Definition at line 768 of file BinaryString.h.

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

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

Size of encoded string in bytes.

Definition at line 771 of file BinaryString.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 774 of file BinaryString.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 779 of file BinaryString.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: