Modernize Poco::Util and clean up some code duplications#5153
Merged
Conversation
Member
Author
|
I also added a template to Poco::Util::Units:
|
…rfaces Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
matejk
reviewed
Jan 5, 2026
|
|
||
|
|
||
| Keys keys(const std::string& key = std::string()) const; | ||
| // Returns the names of all subkeys under the given key. |
Member
Author
There was a problem hiding this comment.
Ah sure, I fixed that.
matejk
approved these changes
Jan 5, 2026
Contributor
matejk
left a comment
There was a problem hiding this comment.
I have just one minor comment about function documentation.
Contributor
|
@frwilckens , is the PR ready to be merged? |
Member
Author
|
Yes, it' ready. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 modernizes the code in Poco::Util by using more C++ 11 and later idioms such as
It also does some refactoring to reduce duplicated code:
In classes
ApplicationandServerApplication, arguments of formint argc, char** argvorint argc, wchar_t** argvare now immediately transformed into a canonicalArgVecbefore doing anything substantial. No longeris there duplicated code in (for example)
int ServerApplication::run(int argc, char** argv),int ServerApplication::run(const ArgVec& args), andint ServerApplication::run(int argc, wchar_t** argv).Since
ConfigurationViewandLocalConfigurationViewhave almost identical code, they now derive from an intermediate classAbstractConfigurationViewthat provides the common methods.SystemConfigurationnow uses an explicit map of functions instead of long if-else chains. Since all tagsare used only once, we no longer need to define them in a list of
static const std::stringvariables.AbstractConfiguration::keys,Application::getApplicationPathandApplication::getApplicationDirectorygot overloads that return the requested information instead of filling a provided data structure. The old
versions still exist for downward compatibility. (I assume they exist because it was expensive before C++11 to return a large data structure from a function.)
Overall the PR reduces the code size by about 500 lines and makes it more maintainable and easier to read.