Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StreamTransformer improvements #1593

Merged

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Feb 3, 2019

Add virtual transform method to StreamTransformer class, optimise QuotedPrintableOutputStream and ChunkedStream.

transformCallback retained, but no longer required by framework; could deprecate and make transform a pure virtual method?

@slaff slaff added this to the 3.7.2 milestone Feb 4, 2019
{
base64_init_encodestate(&state, CHARS_PER_LINE);

transformCallback = std::bind(&Base64OutputStream::encode, this, std::placeholders::_1, std::placeholders::_2,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: transformCallback retained, but no longer required by framework; could deprecate and make transform a pure virtual method

Can you add that information as comments in the code? Ex:

/**
*  ...
* @deprecated
*/ 
StreamTransformerCallback transformCallback  __attribute__ ((deprecated))  = nullptr;

@mikee47 mikee47 changed the title Feature/stream transformer improvements StreamTransformer improvements Feb 5, 2019
Change `transform` to return `size_t` instead of `int`, and make input parameter `const`.

Note: transformCallback retained, but no longer required by framework; could deprecate and make `transform` a pure virtual method
Remove use of strlen
Replace `ets_sprintf` with `m_snprintf`
… one

Also move constructor/destructor code into header
@mikee47 mikee47 force-pushed the feature/StreamTransformer_improvements branch from 4e690c8 to 6d667b7 Compare February 5, 2019 17:02
@slaff slaff removed the 3 - Review label Feb 5, 2019
@slaff slaff merged commit 284e288 into SmingHub:develop Feb 5, 2019
mikee47 added a commit to mikee47/Sming that referenced this pull request Feb 6, 2019
* Add virtual `transform` method to `StreamTransformer` class

Change `transform` to return `size_t` instead of `int`, and make input parameter `const`.

Note: transformCallback retained, but no longer required by framework; could deprecate and make `transform` a pure virtual method

* Use `hexchar` function in `QuotedPrintableOutputStream`

* Optimise ChunkedStream transform routine

Remove use of strlen
Replace `ets_sprintf` with `m_snprintf`

* Add new constructor without callback parameter, and deprecate the old one

Also move constructor/destructor code into header
@slaff slaff mentioned this pull request Feb 27, 2019
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants