Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / CellString.cpp
diff options
context:
space:
mode:
Commit553111770e5f3df085130378e249e6cf52859a4d (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-06-14 14:34:33 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-06-14 14:34:33 +0300
Files9e15b3ca98b88df3bb381872decc138ebcace947 /src/Models/CellString.cpp
FMI-OOP-P2_Tables-553111770e5f3df085130378e249e6cf52859a4d.tar
FMI-OOP-P2_Tables-553111770e5f3df085130378e249e6cf52859a4d.tar.gz
FMI-OOP-P2_Tables-553111770e5f3df085130378e249e6cf52859a4d.zip
Parent7cf7145c28babd1bacc36153db6273c627ef8669 (diff)
Autocommit at 14.06.2022 @ 14:34
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 << '"';
}