Extend CsvReader
capabilities, move into new library
#2805
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR extends the capabilities
CsvReader
class, introduced in #2403.Goals:
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:
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 ofCore/Data
and intoCsvReader
which has additional capabilities. Changes to existing code:
CsvReader
to your project's :cpp:envvar:COMPONENT_DEPENDS
#include <Data/CsvReader>
to#include <CSV/Reader.h>
CsvReader
class to :cpp:class:CSV::Reader
TODO:
CsvReader.h
other than an error? Yes: static_assert.