Implement Utility::NewUUID().

Fixes #3589
This commit is contained in:
Gunnar Beutner 2013-01-30 09:08:48 +01:00
parent 6721f681e2
commit 7c65757219
3 changed files with 21 additions and 0 deletions

View File

@ -131,6 +131,9 @@ using std::type_info;
#include <boost/lexical_cast.hpp>
#include <boost/foreach.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>
using boost::shared_ptr;
using boost::weak_ptr;

View File

@ -373,3 +373,19 @@ Utility::LoadIcingaLibrary(const String& library, bool module)
return hModule;
}
/**
* Generates a new UUID.
*
* @returns The new UUID in text form.
*/
String Utility::NewUUID(void)
{
boost::uuids::uuid uuid = boost::uuids::random_generator()();
stringstream us;
us << uuid;
return us.str();
}

View File

@ -53,6 +53,8 @@ public:
static void Sleep(double timeout);
static String NewUUID(void);
static
#ifdef _WIN32
HMODULE