7 #ifndef RETDEC_LLVMIR2HLL_IR_CONST_STRING_H
8 #define RETDEC_LLVMIR2HLL_IR_CONST_STRING_H
A generic string constant.
Definition: const_string.h:32
bool isWideString() const
Is the string a wide string?
Definition: const_string.cpp:85
retdec::utils::WideCharType UnderlyingCharType
Underlying character type.
Definition: const_string.h:35
virtual ShPtr< Type > getType() const override
Returns the type of the expression.
Definition: const_string.cpp:44
std::size_t charSize
Definition: const_string.h:67
virtual bool isEqualTo(ShPtr< Value > otherValue) const override
Returns true if this value is equal to otherValue, false otherwise.
Definition: const_string.cpp:35
bool is8BitString() const
Is the string an 8-bit string?
Definition: const_string.cpp:78
UnderlyingStringType getValue() const
Returns the constant's value.
Definition: const_string.cpp:57
virtual void replace(ShPtr< Expression > oldExpr, ShPtr< Expression > newExpr) override
Replaces all occurrences of oldExpr with newExpr in the current expression.
Definition: const_string.cpp:48
virtual ShPtr< Value > clone() override
Returns a clone of the value.
Definition: const_string.cpp:29
ShPtr< StringType > type
Type.
Definition: const_string.h:70
static ShPtr< ConstString > create(const UnderlyingStringType &value, std::size_t charSize)
Constructs a string constant initialized to the given value.
Definition: const_string.cpp:98
virtual void accept(Visitor *v) override
Visitor pattern implementation.
Definition: const_string.cpp:113
retdec::utils::WideStringType UnderlyingStringType
Underlying string type.
Definition: const_string.h:38
std::size_t getCharSize() const
Returns how large are characters in the string (in bits).
Definition: const_string.cpp:71
std::string getValueAsEscapedCString() const
Returns the constant's value as an escaped C string.
Definition: const_string.cpp:64
ConstString(const UnderlyingStringType &value, std::size_t charSize)
Constructs a string constant initialized to the given value.
Definition: const_string.cpp:25
UnderlyingStringType value
Value.
Definition: const_string.h:64
A base class for all constants.
Definition: constant.h:20
A base class of all visitors.
Definition: visitor.h:95
A base class for all constants.
A library providing API for working with back-end IR.
std::shared_ptr< T > ShPtr
An alias for a shared pointer.
Definition: smart_ptr.h:18
std::basic_string< WideCharType > WideStringType
Definition: string.h:26
std::uint32_t WideCharType
Definition: string.h:22
Definition: archive_wrapper.h:19
Declarations, aliases, macros, etc. for the use of smart pointers.