Skip to content

Conversation

@pnoltes
Copy link
Contributor

@pnoltes pnoltes commented Dec 5, 2021

This PR updates the std::string arguments in the (C++17) methods to std::string_view and if applicable also update the
std::string return types to std::string_view.

This make it possible to use std::string_view objects as input and as result use constructions like:
constexpr std::string_view MY_CONSTANT = "value"; for constants.

Currently string_view arguments are assumed to refer to null-terminated strings. This is essential the same as with handling const char* arguments.

Technically string_view objects can refer to not null-terminated strings and this is also detectable (using string_view::size() and looking for the '\0'), but expensive. IMO this is not really necessary. Mainly, because we also assume const char* arguments are null-terminated.

@codecov-commenter
Copy link

codecov-commenter commented Dec 5, 2021

Codecov Report

Merging #382 (4d659e3) into master (82d45eb) will increase coverage by 0.08%.
The diff coverage is 97.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #382      +/-   ##
==========================================
+ Coverage   72.13%   72.21%   +0.08%     
==========================================
  Files         234      234              
  Lines       39474    39611     +137     
==========================================
+ Hits        28473    28605     +132     
- Misses      11001    11006       +5     
Impacted Files Coverage Δ
libs/framework/include/celix/ServiceRegistration.h 96.39% <ø> (-0.13%) ⬇️
libs/utils/include/celix/Properties.h 95.37% <94.28%> (-3.40%) ⬇️
libs/framework/include/celix/Bundle.h 100.00% <100.00%> (ø)
libs/framework/include/celix/BundleContext.h 100.00% <100.00%> (ø)
...amework/include/celix/ServiceRegistrationBuilder.h 100.00% <100.00%> (ø)
libs/framework/include/celix/TrackerBuilders.h 100.00% <100.00%> (ø)
libs/framework/include/celix/Trackers.h 90.90% <100.00%> (-0.13%) ⬇️
libs/framework/include/celix/UseServiceBuilder.h 100.00% <100.00%> (ø)
libs/utils/include/celix/Filter.h 94.44% <100.00%> (ø)
libs/utils/include/celix/Utils.h 95.00% <100.00%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 82d45eb...4d659e3. Read the comment docs.

@pnoltes pnoltes merged commit 70d6219 into master Dec 24, 2021
@pnoltes pnoltes deleted the feature/apply_use_stringview branch May 18, 2022 08:48
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.

3 participants