| The Gaudi Framework v28r2-patches (bc4ad17a)

- 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 <uuid/uuid.h>
4 #include <boost/format.hpp>
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)
22 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:119
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:420
createGuidAsString.h