Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
dCache
cta
Commits
85920389
Commit
85920389
authored
5 years ago
by
Michael Davis
Browse files
Options
Downloads
Patches
Plain Diff
[cta-admin] Displays boolean output correctly as true/false
parent
04394f90
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmdline/CtaAdminTextFormatter.hpp
+16
-6
16 additions, 6 deletions
cmdline/CtaAdminTextFormatter.hpp
with
16 additions
and
6 deletions
cmdline/CtaAdminTextFormatter.hpp
+
16
−
6
View file @
85920389
...
...
@@ -86,20 +86,30 @@ private:
buildVector
(
line
,
args
...);
}
//! Base case method to add one item to the log, with specialisations by type
template
<
typename
T
>
void
buildVector
(
std
::
vector
<
std
::
string
>
&
line
,
const
T
&
item
)
{
line
.
push_back
(
std
::
to_string
(
item
));
}
//! Base case method to add one item to the log
void
buildVector
(
std
::
vector
<
std
::
string
>
&
line
,
const
std
::
string
&
item
)
{
line
.
push_back
(
item
);
}
//! Base case method to add one item to the log, overloaded for char*
void
buildVector
(
std
::
vector
<
std
::
string
>
&
line
,
const
char
*
item
)
{
line
.
push_back
(
std
::
string
(
item
));
}
//! Base case method to add one item to the log, overloaded for bool
void
buildVector
(
std
::
vector
<
std
::
string
>
&
line
,
bool
item
)
{
line
.
push_back
(
item
?
"true"
:
"false"
);
}
/*!
* Base case method to add one item to the log, with partial specialisation
* (works for all integer and floating-point types)
*/
template
<
typename
T
>
void
buildVector
(
std
::
vector
<
std
::
string
>
&
line
,
const
T
&
item
)
{
line
.
push_back
(
std
::
to_string
(
item
));
}
//! Flush buffer to stdout
void
flush
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment