diff options
| Commit | 6d9930c848f18296867cebbf6f93b2e7c4f0e1b2 (patch) | |
|---|---|---|
| Author | 2022-06-13 20:37:36 +0300 | |
| Committer | 2022-06-13 20:37:36 +0300 | |
| Files | fa8ccbfb0ad7e1197fa10de42704010d1b1fe62f /src | |
| FMI-OOP-P2_Tables-6d9930c848f18296867cebbf6f93b2e7c4f0e1b2.tar FMI-OOP-P2_Tables-6d9930c848f18296867cebbf6f93b2e7c4f0e1b2.tar.gz FMI-OOP-P2_Tables-6d9930c848f18296867cebbf6f93b2e7c4f0e1b2.zip | ||
| Parent | 5189e321ef3442a105dff2cc32d2721e4624aba9 (diff) | |
Autocommit at 13.06.2022 @ 20:37
2 files changed, 10 insertions, 5 deletions
| -rw-r--r-- | src/Generic/List/List.hpp | 2 | ||||
| -rw-r--r-- | src/Models/Table.cpp | 13 |
diff --git a/src/Generic/List/List.hpp b/src/Generic/List/List.hpp index c6fd8a1..ba4851c 100644 --- a/src/Generic/List/List.hpp +++ b/src/Generic/List/List.hpp @@ -47,6 +47,8 @@ public: T& operator[](unsigned index); //! Returns constant reference to element at index const T& operator[](unsigned index) const; + //! Returns raw array of data + const T* raw_data() const; //! Appends elements from other list List<T>& operator+=(const List<T> other); diff --git a/src/Models/Table.cpp b/src/Models/Table.cpp index b5638c9..3724d3a 100644 --- a/src/Models/Table.cpp +++ b/src/Models/Table.cpp @@ -24,12 +24,14 @@ void W(std::ifstream& in) { while (in.peek() == ' ') in.get(); } -void D(std::ifstream& in) { - while (in.peek() >= '0' && in.peek() <= '9') in.get(); +void D(std::ifstream& in, List<char>& buffer) { + while (in.peek() >= '0' && in.peek() <= '9') + buffer.add(in.get()); } -void A(std::ifstream& in) { - while ((in.peek() >= '#' && in.peek() <= '~') || in.peek() == '!') in.get(); +void A(std::ifstream& in, List<char>& buffer) { + while ((in.peek() >= '#' && in.peek() <= '~') || in.peek() == '!') + buffer.add(in.get()); } void Table::readFromFile(std::ifstream& inFile) { @@ -38,7 +40,8 @@ void Table::readFromFile(std::ifstream& inFile) { if (inFile.peek() == '"') inFile.get(); if (inFile.peek() == '=') { - + List<char> buffer; + A(inFile, buffer); } } } |
