source: XIOS3/trunk/src/uuid.cpp

Last change on this file was 2629, checked in by jderouillat, 6 weeks ago

Delete boost dependencies, the few features used are replaced by functions stored in extern/boost_extraction

File size: 518 bytes
Line 
1#include <string>
2#include <boost_uuid.hpp>
3
4namespace xios
5{
6 
7  std::string getUuidStr(void)
8  {
9    boost_uuid uuid = gen_boost_uuid();
10    return to_string(uuid) ;
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.