Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
atlas
athena
Merge requests
!75546
use string::ends_with()
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
use string::ends_with()
mnowak/athena:aux.io.cxx20
into
main
Overview
7
Commits
1
Pipelines
1
Changes
2
Merged
Marcin Nowak
requested to merge
mnowak/athena:aux.io.cxx20
into
main
5 months ago
Overview
7
Commits
1
Pipelines
1
Changes
2
Expand
tiny update to c++20
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
a4a0a0ed
1 commit,
5 months ago
2 files
+
18
−
6
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
Database/AthenaRoot/RootAuxDynIO/RootAuxDynIO/RootAuxDynDefs.h
+
17
−
5
Options
@@ -18,7 +18,15 @@ namespace RootAuxDynIO
* @brief Check if a string ends with AUX_POSTFIX
* @param str the string to check
*/
bool
endsWithAuxPostfix
(
std
::
string_view
str
);
inline
bool
endsWithAuxPostfix
(
std
::
string_view
str
)
{
return
str
.
ends_with
(
AUX_POSTFIX
);
}
/**
* @brief if a string ends with AUX_POSTFIX then remove it
* @param str the string to modify
*/
bool
removeAuxPostfix
(
std
::
string
str
);
/**
* @brief Construct branch name for a given dynamic attribute
@@ -37,13 +45,17 @@ namespace RootAuxDynIO
}
// namespace
/// check if a string ends with AUX_POSTFIX
inline
bool
RootAuxDynIO
::
endsWithAuxPostfix
(
std
::
string_view
str
)
{
return
str
.
size
()
>=
AUX_POSTFIX_LEN
and
str
.
compare
(
str
.
size
()
-
AUX_POSTFIX_LEN
,
AUX_POSTFIX_LEN
,
AUX_POSTFIX
)
==
0
;
RootAuxDynIO
::
removeAuxPostfix
(
std
::
string
str
)
{
if
(
endsWithAuxPostfix
(
str
)
)
{
str
.
resize
(
str
.
size
()
-
AUX_POSTFIX_LEN
);
return
true
;
}
return
false
;
}
inline
std
::
string
RootAuxDynIO
::
auxBranchName
(
const
std
::
string
&
attr_name
,
const
std
::
string
&
baseBranchName
)
{
Loading