src: refactor UUIDUtility to conform with our coding conventions
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
#include "UUIDUtility.h"
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/uuid/uuid_generators.hpp>
|
||||
#include <boost/uuid/uuid_io.hpp>
|
||||
|
||||
boost::uuids::uuid UUIDUtility::getUUID()
|
||||
{
|
||||
return boost::uuids::random_generator()();
|
||||
}
|
||||
|
||||
std::string UUIDUtility::UUIDtoString(const boost::uuids::uuid& uuid)
|
||||
{
|
||||
return boost::lexical_cast<std::string>(uuid);
|
||||
}
|
||||
|
||||
std::string UUIDUtility::getUUIDString()
|
||||
{
|
||||
return UUIDtoString(getUUID());
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#ifndef UUID_UTILITY_H
|
||||
#define UUID_UTILITY_H
|
||||
|
||||
#include <boost/uuid/uuid.hpp>
|
||||
#include <string>
|
||||
|
||||
class UUIDUtility
|
||||
{
|
||||
public:
|
||||
static boost::uuids::uuid getUUID();
|
||||
static std::string UUIDtoString(const boost::uuids::uuid& uuid);
|
||||
static std::string getUUIDString();
|
||||
};
|
||||
|
||||
#endif // UUID_UTILITY_H
|
||||
@@ -0,0 +1,20 @@
|
||||
#include "utility/utilityUuid.h"
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/uuid/uuid_generators.hpp>
|
||||
#include <boost/uuid/uuid_io.hpp>
|
||||
|
||||
boost::uuids::uuid utility::getUuid()
|
||||
{
|
||||
return boost::uuids::random_generator()();
|
||||
}
|
||||
|
||||
std::string utility::uuidToString(const boost::uuids::uuid& uuid)
|
||||
{
|
||||
return boost::lexical_cast<std::string>(uuid);
|
||||
}
|
||||
|
||||
std::string utility::getUuidString()
|
||||
{
|
||||
return utility::uuidToString(utility::getUuid());
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#ifndef UTILITY_UUID_H
|
||||
#define UTILITY_UUID_H
|
||||
|
||||
#include <boost/uuid/uuid.hpp>
|
||||
#include <string>
|
||||
|
||||
namespace utility
|
||||
{
|
||||
boost::uuids::uuid getUuid();
|
||||
std::string uuidToString(const boost::uuids::uuid& uuid);
|
||||
std::string getUuidString();
|
||||
};
|
||||
|
||||
#endif // UTILITY_UUID_H
|
||||
Reference in New Issue
Block a user