Decompile fn_18244 (DecodeTextEscapes)
Batch #835 by ragnarok-clanker: 0 byte-identical, 1 confirmed by peer review. - fn_18244 DecodeTextEscapes: logic confirmed by peer review Reviewed-by: ragnarok-clanker Adds to the build: Source/Utility/TextEscapes.cpp
This commit is contained in:
parent
f66874c19f
commit
02d760984c
3 changed files with 25 additions and 0 deletions
16
Source/Utility/TextEscapes.cpp
Normal file
16
Source/Utility/TextEscapes.cpp
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#include "Utility/TextEscapes.h"
|
||||
|
||||
// FUNCTION: fn_18244
|
||||
void DecodeTextEscapes(std::string& text) {
|
||||
for (std::size_t position = text.find("\\r"); position != std::string::npos; position = text.find("\\r")) {
|
||||
text.replace(position, 2, "\r", 1);
|
||||
}
|
||||
|
||||
for (std::size_t position = text.find("\\n"); position != std::string::npos; position = text.find("\\n")) {
|
||||
text.replace(position, 2, "\n", 1);
|
||||
}
|
||||
|
||||
for (std::size_t position = text.find("\\\""); position != std::string::npos; position = text.find("\\\"")) {
|
||||
text.replace(position, 2, "\"", 1);
|
||||
}
|
||||
}
|
||||
8
Source/Utility/TextEscapes.h
Normal file
8
Source/Utility/TextEscapes.h
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef RAGNAROK_SOURCE_UTILITY_TEXTESCAPES_H
|
||||
#define RAGNAROK_SOURCE_UTILITY_TEXTESCAPES_H
|
||||
|
||||
#include <string>
|
||||
|
||||
void DecodeTextEscapes(std::string& text);
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue