ROSE 0.11.145.192
|
Terminated string encoding scheme.
A string whose character octets are followed by octets for a special code point that marks the end of the string but is not included as part of the string's characters. An example is C-style NUL-terminated ASCII.
#include <Rose/BinaryAnalysis/String.h>
Public Types | |
typedef Sawyer::SharedPointer< TerminatedString > | Ptr |
Shared ownership pointer to a TerminatedString. | |
Public Types inherited from Rose::BinaryAnalysis::Strings::StringEncodingScheme | |
typedef Sawyer::SharedPointer< StringEncodingScheme > | Ptr |
Shared ownership pointer to a StringEncodingScheme. | |
Public Member Functions | |
virtual StringEncodingScheme::Ptr | clone () const override |
Create a new copy of this encoder. | |
virtual std::string | name () const override |
Name of encoding. | |
virtual Octets | encode (const CodePoints &) override |
Encode a string into a sequence of octets. | |
virtual State | decode (Octet) override |
Decode one octet. | |
virtual void | reset () override |
Reset the state machine to an initial state. | |
Sawyer::Optional< CodePoint > | terminated () const |
Returns the decoded termination character, if any. | |
const CodePoints & | terminators () const |
Property: string termination code points. | |
CodePoints & | terminators () |
Property: string termination code points. | |
Public Member Functions inherited from Rose::BinaryAnalysis::Strings::StringEncodingScheme | |
State | state () const |
Decoder state. | |
CodePoints | consume () |
Consume pending decoded code points. | |
const CodePoints & | codePoints () const |
Return pending decoded code points without consuming them. | |
size_t | length () const |
Number of code points decoded since reset. | |
CharacterEncodingForm::Ptr | characterEncodingForm () const |
Property: Character encoding format. | |
void | characterEncodingForm (const CharacterEncodingForm::Ptr &cef) |
Property: Character encoding format. | |
CharacterEncodingScheme::Ptr | characterEncodingScheme () const |
Property: Character encoding scheme. | |
void | characterEncodingScheme (const CharacterEncodingScheme::Ptr &ces) |
Property: Character encoding scheme. | |
CodePointPredicate::Ptr | codePointPredicate () const |
Property: Code point predicate. | |
void | codePointPredicate (const CodePointPredicate::Ptr &cpp) |
Property: Code point predicate. | |
Public Member Functions inherited from Sawyer::SharedObject | |
SharedObject () | |
Default constructor. | |
SharedObject (const SharedObject &) | |
Copy constructor. | |
virtual | ~SharedObject () |
Virtual destructor. | |
SharedObject & | operator= (const SharedObject &) |
Assignment. | |
Static Public Member Functions | |
static Ptr | instance (const CharacterEncodingForm::Ptr &cef, const CharacterEncodingScheme::Ptr &ces, const CodePointPredicate::Ptr &cpp, const CodePoints &terminators) |
static Ptr | instance (const CharacterEncodingForm::Ptr &cef, const CharacterEncodingScheme::Ptr &ces, const CodePointPredicate::Ptr &cpp, CodePoint terminator=0) |
Protected Member Functions | |
TerminatedString (const CharacterEncodingForm::Ptr &cef, const CharacterEncodingScheme::Ptr &ces, const CodePointPredicate::Ptr &cpp, const CodePoints &terminators) | |
Protected Member Functions inherited from Rose::BinaryAnalysis::Strings::StringEncodingScheme | |
StringEncodingScheme (const CharacterEncodingForm::Ptr &cef, const CharacterEncodingScheme::Ptr &ces, const CodePointPredicate::Ptr &cpp) | |
Additional Inherited Members | |
Protected Attributes inherited from Rose::BinaryAnalysis::Strings::StringEncodingScheme | |
State | state_ = INITIAL_STATE |
CodePoints | codePoints_ |
size_t | nCodePoints_ = 0 |
CharacterEncodingForm::Ptr | cef_ |
CharacterEncodingScheme::Ptr | ces_ |
CodePointPredicate::Ptr | cpp_ |
typedef Sawyer::SharedPointer<TerminatedString> Rose::BinaryAnalysis::Strings::TerminatedString::Ptr |
Shared ownership pointer to a TerminatedString.
See Shared ownership.
|
inlineprotected |
|
inlinestatic |
|
inlinestatic |
|
inlineoverridevirtual |
Create a new copy of this encoder.
Implements Rose::BinaryAnalysis::Strings::StringEncodingScheme.
|
overridevirtual |
Name of encoding.
Implements Rose::BinaryAnalysis::Strings::StringEncodingScheme.
|
overridevirtual |
Encode a string into a sequence of octets.
Implements Rose::BinaryAnalysis::Strings::StringEncodingScheme.
Decode one octet.
Processes a single octet and updates the decoder state machine. Returns the new state. See documentation for Strings::State for restrictions on state transitions.
Implements Rose::BinaryAnalysis::Strings::StringEncodingScheme.
|
overridevirtual |
Reset the state machine to an initial state.
Reimplemented from Rose::BinaryAnalysis::Strings::StringEncodingScheme.
|
inline |
|
inline |
Property: string termination code points.
A list of code points (characters) that cause a string to be terminated. When decoding a string, if a terminating code point is encountered then the string ends at the previous code point even if the terminating code point also satisfies the code point predicate.
|
inline |
Property: string termination code points.
A list of code points (characters) that cause a string to be terminated. When decoding a string, if a terminating code point is encountered then the string ends at the previous code point even if the terminating code point also satisfies the code point predicate.