diff options
| author | Rusty Wagner <rusty@vector35.com> | 2015-04-28 02:31:19 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2015-04-28 02:31:19 -0400 |
| commit | 4baa6fc4add2b1d9ff32d8eba67621dfdb1cbfd4 (patch) | |
| tree | 716b9ddf505558b779c26d3ed35bacacc63d1f0c /databuffer.cpp | |
| parent | 26093c952f60de3c0510e76f28ccfc0290824eec (diff) | |
Implement renaming of functions with persistence and undo
Diffstat (limited to 'databuffer.cpp')
| -rw-r--r-- | databuffer.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/databuffer.cpp b/databuffer.cpp index 4bcd930b..6a0748b4 100644 --- a/databuffer.cpp +++ b/databuffer.cpp @@ -134,3 +134,17 @@ DataBuffer DataBuffer::FromEscapedString(const string& src) { return DataBuffer(BNDecodeEscapedString(src.c_str())); } + + +string BinaryNinja::EscapeString(const string& s) +{ + DataBuffer buffer(s.c_str(), s.size()); + return buffer.ToEscapedString(); +} + + +string BinaryNinja::UnescapeString(const string& s) +{ + DataBuffer buffer = DataBuffer::FromEscapedString(s); + return string((const char*)buffer.GetData(), buffer.GetLength()); +} |
