mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-27 19:10:20 +01:00
added Environment::nodeId()
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// Environment.cpp
|
||||
//
|
||||
// $Id: //poco/svn/Foundation/src/Environment.cpp#2 $
|
||||
// $Id: //poco/1.3/Foundation/src/Environment.cpp#2 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Core
|
||||
@@ -35,6 +35,7 @@
|
||||
|
||||
|
||||
#include "Poco/Environment.h"
|
||||
#include <cstdlib>
|
||||
|
||||
|
||||
#if defined(POCO_OS_FAMILY_VMS)
|
||||
@@ -102,4 +103,26 @@ std::string Environment::nodeName()
|
||||
}
|
||||
|
||||
|
||||
std::string Environment::nodeId()
|
||||
{
|
||||
NodeId id;
|
||||
nodeId(id);
|
||||
char result[18];
|
||||
std::sprintf(result, "%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
id[0],
|
||||
id[1],
|
||||
id[2],
|
||||
id[3],
|
||||
id[4],
|
||||
id[5]);
|
||||
return std::string(result);
|
||||
}
|
||||
|
||||
|
||||
void Environment::nodeId(NodeId& id)
|
||||
{
|
||||
return EnvironmentImpl::nodeIdImpl(id);
|
||||
}
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
Reference in New Issue
Block a user