| The Gaudi Framework v32r1 (f65d50dc)

createGuidAsString.cpp
Go to the documentation of this file.
1
2 // External include(s):
3 #include <boost/format.hpp>
4 #include <uuid/uuid.h>
5
6 // Local include(s):
7 #include "createGuidAsString.h"
8
9 std::string Gaudi::createGuidAsString() {
10 uuid_t uuid;
11 ::uuid_generate_time( uuid );
12 struct Guid {
13 unsigned int Data1;
14 unsigned short Data2;
15 unsigned short Data3;
16 unsigned char Data4[8];
17 }* g = (Guid*)&uuid;
18
19 boost::format text( "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X" );
20 text % g->Data1 % g->Data2 % g->Data3;
21 for ( int i = 0; i < 8; ++i ) text % (unsigned short)g->Data4[i];
22 return text.str();
23 }
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:109
std::string
STL class.
Gaudi::createGuidAsString
std::string createGuidAsString()
Helper function creating file identifier using the UUID mechanism.
gaudirun.g
dictionary g
Definition: gaudirun.py:520
createGuidAsString.h