| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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 {
11 uuid_t uuid;
12 ::uuid_generate_time( uuid );
13 struct Guid {
14 unsigned int Data1;
15 unsigned short Data2;
16 unsigned short Data3;
17 unsigned char Data4[8];
18 }* g = (Guid*)&uuid;
19
20 boost::format text( "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X" );
21 text % g->Data1 % g->Data2 % g->Data3;
22 for ( int i = 0; i < 8; ++i ) text % (unsigned short)g->Data4[i];
23 return text.str();
24 }
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:120
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:439
createGuidAsString.h