-
-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend
CsvReader
capabilities, move into new library (#2805)
This PR extends the capabilities `CsvReader` class, introduced in #2403. Goals: - Extend testing, verify efficient use of memory - Add Parser capability to allow filtering and processing of (very) large files streamed via network, in files, etc. - Add seeking support to allow indexing, bookmarking, etc. - Add iterator support The code has been moved into a separate library. Changes: **Fix String move to avoid de-allocating buffers** Use longer of two buffers for result. Example: ``` String s1 = "Greater than SSO buffer length"; String s2; s1 = ""; // Buffer remains allocated s2 = std::move(s1); // The move we need to fix ``` At present this move will result in s1's buffer being de-allocated. This can lead to performance degratation due to subsequent memory reallocations where a String is being passed around as a general buffer. This change uses the larger of the two buffers when deciding how to behave. Checks added to HostTests to enforce predictable behaviour. **Add CStringArray::release method** Allows efficient conversion to a regular `String` object for manipulation. **Fix CStringArray operator+=** Must take reference, not copy - inefficient and fails when used with FlashString. **Move CsvReader into separate library** The `CsvReader` class has been moved out of `Core/Data` and into `CsvReader` which has additional capabilities. Changes to existing code: - Add ``CsvReader`` to your project's :cpp:envvar:`COMPONENT_DEPENDS` - Change ``#include <Data/CsvReader>`` to ``#include <CSV/Reader.h>`` - Change ``CsvReader`` class to :cpp:class:`CSV::Reader`
- Loading branch information
Showing
13 changed files
with
112 additions
and
298 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
COMPONENT_DEPENDS := CsvReader | ||
HWCONFIG := basic_templates | ||
DISABLE_NETWORK := 1 | ||
|
Oops, something went wrong.