mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2026-07-16 05:27:10 +02:00
Major plugin refactor and cleanup.
Switched to POCO library for unified platform/library interface. Deprecated the external module API. It was creating more problems than solving. Removed most built-in libraries in favor of system libraries for easier maintenance. Cleaned and secured code with help from static analyzers.
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// uuidgen.cpp
|
||||
//
|
||||
// This sample demonstrates the UUIDGenerator and UUID classes.
|
||||
//
|
||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#include "Poco/UUID.h"
|
||||
#include "Poco/UUIDGenerator.h"
|
||||
#include "Poco/Exception.h"
|
||||
#include <iostream>
|
||||
|
||||
|
||||
using Poco::UUID;
|
||||
using Poco::UUIDGenerator;
|
||||
using Poco::Exception;
|
||||
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
UUID uuid;
|
||||
|
||||
std::string arg;
|
||||
if (argc > 1)
|
||||
arg = argv[1];
|
||||
|
||||
try
|
||||
{
|
||||
if (arg == "-random")
|
||||
uuid = UUIDGenerator::defaultGenerator().createRandom();
|
||||
else if (arg.empty())
|
||||
uuid = UUIDGenerator::defaultGenerator().create();
|
||||
else
|
||||
uuid = UUIDGenerator::defaultGenerator().createFromName(UUID::uri(), arg);
|
||||
|
||||
std::cout << uuid.toString() << std::endl;
|
||||
}
|
||||
catch (Exception& exc)
|
||||
{
|
||||
std::cerr << exc.displayText() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user