Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Gaudi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
Gaudi
Gaudi
Commits
7de16bb2
Commit
7de16bb2
authored
5 years ago
by
Marco Clemencic
Browse files
Options
Downloads
Patches
Plain Diff
use uuid_unparse instead of boost::format
parent
fdd53511
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1046
Use fmtlib instead of boost::format (where possible)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GaudiUtils/src/component/createGuidAsString.cpp
+5
-17
5 additions, 17 deletions
GaudiUtils/src/component/createGuidAsString.cpp
with
5 additions
and
17 deletions
GaudiUtils/src/component/createGuidAsString.cpp
+
5
−
17
View file @
7de16bb2
...
...
@@ -9,25 +9,13 @@
* or submit itself to any jurisdiction. *
\***********************************************************************************/
// External include(s):
#include
<boost/format.hpp>
#include
<uuid/uuid.h>
// Local include(s):
#include
"createGuidAsString.h"
#include
<uuid/uuid.h>
std
::
string
Gaudi
::
createGuidAsString
()
{
uuid_t
uuid
;
uuid_t
uuid
;
std
::
string
uuid_s
(
36
,
'0'
);
::
uuid_generate_time
(
uuid
);
struct
Guid
{
unsigned
int
Data1
;
unsigned
short
Data2
;
unsigned
short
Data3
;
unsigned
char
Data4
[
8
];
}
*
g
=
(
Guid
*
)
&
uuid
;
boost
::
format
text
(
"%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X"
);
text
%
g
->
Data1
%
g
->
Data2
%
g
->
Data3
;
for
(
int
i
=
0
;
i
<
8
;
++
i
)
text
%
(
unsigned
short
)
g
->
Data4
[
i
];
return
text
.
str
();
::
uuid_unparse_upper
(
uuid
,
uuid_s
.
data
()
);
return
uuid_s
;
}
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