Files
Plugin/Source/SenseGloveCore/Private/SGCore/SGLibrary.cpp
T

89 lines
2.5 KiB
C++

/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2026 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#include "SGCore/SGLibrary.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_ESGBackendType.h"
#include "SGInterop/SGIC_FString.h"
bool FSGLibrary::IsInitialized()
{
return SGCoreImpl_FSGLibraryImpl_IsInitialized();
}
bool FSGLibrary::Initialize(FString& OutError)
{
FSGIC_FString Container;
const bool bResult = SGCoreImpl_FSGLibraryImpl_Initialize(&Container);
OutError = MoveTemp(Container.String);
return bResult;
}
bool FSGLibrary::Terminate(FString& OutError)
{
FSGIC_FString Container;
const bool bResult = SGCoreImpl_FSGLibraryImpl_Terminate(&Container);
OutError = MoveTemp(Container.String);
return bResult;
}
FString FSGLibrary::GetVersion()
{
FSGIC_FString Container;
SGCoreImpl_FSGLibraryImpl_Version(&Container);
return Container.String;
}
ESGBackendType FSGLibrary::GetBackendType()
{
FSGIC_ESGBackendType Container;
SGCoreImpl_FSGLibraryImpl_GetBackendType(&Container);
return Container.Type;
}
FString FSGLibrary::GetBackendVersion()
{
FSGIC_FString Container;
SGCoreImpl_FSGLibraryImpl_BackendVersion(&Container);
return Container.String;
}
FString FSGLibrary::GetSGConnectVersion()
{
FSGIC_FString Container;
SGCoreImpl_FSGLibraryImpl_SGConnectVersion(&Container);
return Container.String;
}