source:
XIOS3/trunk/src/uuid.cpp
@
2633
Last change on this file since 2633 was 2629, checked in by jderouillat, 2 months ago | |
---|---|
File size: 518 bytes |
Rev | Line | |
---|---|---|
[2629] | 1 | #include <string> |
2 | #include <boost_uuid.hpp> | |
[1174] | 3 | |
4 | namespace xios | |
5 | { | |
6 | ||
7 | std::string getUuidStr(void) | |
8 | { | |
[2629] | 9 | boost_uuid uuid = gen_boost_uuid(); |
10 | return to_string(uuid) ; | |
[1174] | 11 | } |
12 | ||
13 | std::string getUuidStr(const std::string& format) | |
14 | { | |
15 | size_t pos ; | |
16 | std::string retStr(format) ; | |
17 | std::string uuid(getUuidStr()) ; | |
18 | std::string id("%uuid%"); | |
19 | pos=retStr.find(id) ; | |
20 | while(pos!=std::string::npos) | |
21 | { | |
22 | retStr.replace(pos,id.size(),uuid) ; | |
23 | pos=retStr.find(id) ; | |
24 | } | |
25 | return retStr; | |
26 | } | |
27 | } | |
28 |
Note: See TracBrowser
for help on using the repository browser.