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

Refactor TemplateFileStream class using TemplateStream #1500

Merged
merged 2 commits into from
Oct 23, 2018

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Oct 22, 2018

DataSourceStream

  • [BC] Amend StreamType enumeration eSST_TemplateFile -> eSST_Template
  • [BC] Make getStreamType() method const
  • [BC] make id() method const
  • Add virtual getName() method to provide generic way of getting filename from TemplateStream wrapper
  • Add virtual isValid() method

TemplateFileStream

  • Refactor as TemplateStream class to allow any other stream type to provide source template data
  • Replace int with unsigned or size_t as appropriate
  • Minor code improvements

HttpRequest

  • setFile() method can use any ReadWriteStream-derived class, doesn't have to be FileStream.

@slaff
Copy link
Contributor

slaff commented Oct 22, 2018

@mikee47 rebase and push -f to update the code.

cd %SMING_HOME%
git checkout develop
git pull
git checkout feature/TemplateStream
git merge develop
# if the merge errored then
# git mergetool 
git rebase develop 
# if rebase failed
# git mergetool 

@mikee47 mikee47 force-pushed the feature/TemplateStream branch 3 times, most recently from 374942f to 24ed75a Compare October 23, 2018 06:09
DataSourceStream
* [BC] Amend StreamType enumeration eSST_TemplateFile -> eSST_Template
* [BC] Make getStreamType() method const
* [BC] make id() method const
* Add virtual getName() method to provide generic way of getting filename from TemplateStream wrapper
* Add virtual isValid() method

TemplateFileStream
* Refactor as TemplateStream class to allow any other stream type to provide source template data
* Replace int with unsigned or size_t as appropriate
* Minor code improvements

HttpRequest
* setFile() method can use any ReadWriteStream-derived class, doesn't have to be FileStream.
@mikee47 mikee47 force-pushed the feature/TemplateStream branch from 24ed75a to ebc8e76 Compare October 23, 2018 06:10
@slaff slaff added this to the 3.7.0 milestone Oct 23, 2018
@slaff
Copy link
Contributor

slaff commented Oct 23, 2018

@mikee47 Did you have the time to test the PR with the HttpServer_ConfigNetwork sample?

@mikee47
Copy link
Contributor Author

mikee47 commented Oct 23, 2018

@mikee47 Did you have the time to test the PR with the HttpServer_ConfigNetwork sample?

Not sure. I'll do that test and report back. I'd also like to make this PR a bit more interesting so will add something to samples to illustrate using TemplateStream with flash strings instead of files.

@mikee47
Copy link
Contributor Author

mikee47 commented Oct 23, 2018

Re-tested with HttpServer_ConfigNetwork (lovely sample!) yes, I remember already doing this so works fine.

@slaff slaff removed the 3 - Review label Oct 23, 2018
@slaff slaff merged commit 90de22f into SmingHub:develop Oct 23, 2018
@slaff slaff mentioned this pull request Oct 23, 2018
4 tasks
@mikee47 mikee47 deleted the feature/TemplateStream branch October 24, 2018 13:11
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