diff options
| Commit | 7cf7145c28babd1bacc36153db6273c627ef8669 (patch) | |
|---|---|---|
| Author | 2022-06-14 14:29:31 +0300 | |
| Committer | 2022-06-14 14:29:31 +0300 | |
| Files | c7a9e91427fa5a5e16a8b8a9ef8f761809f46ba8 /src | |
| FMI-OOP-P2_Tables-7cf7145c28babd1bacc36153db6273c627ef8669.tar FMI-OOP-P2_Tables-7cf7145c28babd1bacc36153db6273c627ef8669.tar.gz FMI-OOP-P2_Tables-7cf7145c28babd1bacc36153db6273c627ef8669.zip | ||
| Parent | 473b71190ad39c2fa930ad7d8c90b892fe1840b6 (diff) | |
Autocommit at 14.06.2022 @ 14:29
4 files changed, 10 insertions, 9 deletions
| -rw-r--r-- | src/Generic/String/String.cpp | 10 | ||||
| -rw-r--r-- | src/Models/CellString.cpp | 3 | ||||
| -rw-r--r-- | src/Models/Table.cpp | 2 | ||||
| -rw-r--r-- | src/test.table | 4 |
diff --git a/src/Generic/String/String.cpp b/src/Generic/String/String.cpp index 5bc17b4..57e5d58 100644 --- a/src/Generic/String/String.cpp +++ b/src/Generic/String/String.cpp @@ -174,9 +174,9 @@ int String::compare(const String& other) const { * \warning It takes at most 1024 characters from the stream! * \note Best used with std::cin or text std::ifstream */ -std::istream& operator>>(std::istream& istr, String& event) { - istr.getline(event.str, 1024); - event.length = strlen(event.str); +std::istream& operator>>(std::istream& istr, String& str) { + istr.getline(str.str, 1024); + str.length = strlen(str.str); return istr; } @@ -186,6 +186,6 @@ std::istream& operator>>(std::istream& istr, String& event) { * * \note Best used with std::cout or text std::ofstream */ -std::ostream& operator<<(std::ostream& ostr, const String& event) { - return ostr << event.str; +std::ostream& operator<<(std::ostream& ostr, const String& str) { + return ostr << str.str; } diff --git a/src/Models/CellString.cpp b/src/Models/CellString.cpp index 9c010c3..f323a7c 100644 --- a/src/Models/CellString.cpp +++ b/src/Models/CellString.cpp @@ -18,5 +18,6 @@ void CellString::parseAndSetValue(const char* str) { } void CellString::writeToFile(std::ofstream& file) { - file << '"' << value << '"'; + file << '"'; + const char* strCpy = value.get_cstr(); } diff --git a/src/Models/Table.cpp b/src/Models/Table.cpp index 3b1c8f2..0231dea 100644 --- a/src/Models/Table.cpp +++ b/src/Models/Table.cpp @@ -155,7 +155,7 @@ void Table::putCell(unsigned row, unsigned col, const char* rawValue) { rawValue++; while (*rawValue != '"' && *rawValue != '\0') { if (*rawValue == '\\') rawValue++; - buffer.add(*rawValue); + buffer.add(*(rawValue++)); } if (*rawValue == '"' && *(rawValue + 1) != '\0') throw std::logic_error("Error: Text after closing (inescaped) brace!"); diff --git a/src/test.table b/src/test.table index 6406ca6..805f6db 100644 --- a/src/test.table +++ b/src/test.table @@ -1,3 +1,3 @@ -+8.6,+3,"String","= 3 * R1C2 + R1C1 ^ R1C2 * 27 / R1C2 - 2 * 2.5 * 2 * 2 + R1C3 ^ R1C3","", -"C:\\My\\File\"","Bruh","=R1C0 + R1C1",-19.2441,-2,, +8.6,3,"String","= 3 * R1C2 + R1C1 ^ R1C2 * 27 / R1C2 - 2 * 2.5 * 2 * 2 + R1C3 ^ R1C3","", +"C:\My\File"","Bruh","=R1C0 + R1C1","C:\Doc\"asdf"",-2,, |
