Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / CellString.cpp
diff options
context:
space:
mode:
1 files changed, 5 insertions, 0 deletions
-rw-r--r--src/Models/CellString.cpp5
diff --git a/src/Models/CellString.cpp b/src/Models/CellString.cpp
index f323a7c..2a105ef 100644
--- a/src/Models/CellString.cpp
+++ b/src/Models/CellString.cpp
@@ -20,4 +20,9 @@ void CellString::parseAndSetValue(const char* str) {
void CellString::writeToFile(std::ofstream& file) {
file << '"';
const char* strCpy = value.get_cstr();
+ while (*strCpy != '\0') {
+ if (*strCpy == '\\' || *strCpy == '"') file << '\\';
+ file << *(strCpy++);
+ }
+ file << '"';
}