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

Add dataset templating support #2164

Merged
merged 5 commits into from
Dec 2, 2020

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Dec 2, 2020

This PR extends templated streaming to support formatting of large datasets.
It is used by #1579 to provide a mechanism for streaming directory listings in various formats.

Upgrade TemplateStream

  • Malformed template data can cause lockup waiting for next input when there isn't any.
  • Add output enable control to support filtering
  • Allow spaces in tag names, increase max length to 128
  • Add evaluate method to enable support for extended tag parsing
  • Add optional owned parameter to TemplateStream constructor for situations where caller is responsible for allocation
  • Allow TemplateStream to be rewound: implement seekFrom
  • Add option to use double braces {{ }} - necessary for JSON

Add class-based support for escaping/formatting strings (html, json, etc)

  • Base Formatter class, headers and standard/html/json within Format namespace

Add SectionStream class

  • Presents each marked section within a source stream as a separate stream
  • Sections are identified by index and can be selected to allow repeating of sections, etc. as required

Add SectionTemplate class to support dataset reporting

  • Adds basic expression parsing with conditionals, built-in functions, etc.
  • Uses SectionStream to support typical reports with a header/content/footer. The content section is repeated for each record.

Add separate TemplateStream test module, with more tests

@slaff slaff added this to the 4.2.0 milestone Dec 2, 2020
Sming/Core/Data/Stream/SectionTemplate.h Outdated Show resolved Hide resolved
Sming/Core/Data/Stream/SectionTemplate.h Outdated Show resolved Hide resolved
@mikee47 mikee47 force-pushed the feature/templatestream-upgrade branch from df01b3d to d090bf6 Compare December 2, 2020 13:11
* Malformed template data can cause lockup waiting for next input when there isn't any.
* Add output enable control to support filtering
* Allow spaces in tag names, increase max length to 128
* Add `evaluate` method to enable support for extended tag parsing
* Add optional `owned` parameter to TemplateStream constructor for situations where
caller is responsible for allocation
* Allow TemplateStream to be rewound: implement `seekFrom`
* Add option to use double braces {{ }} - necessary for JSON
@slaff slaff merged commit 70b06a7 into SmingHub:develop Dec 2, 2020
@mikee47 mikee47 deleted the feature/templatestream-upgrade branch December 3, 2020 10:47
@mikee47 mikee47 restored the feature/templatestream-upgrade branch August 31, 2024 09:23
@mikee47 mikee47 deleted the feature/templatestream-upgrade branch August 31, 2024 09:49
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