first commit

This commit is contained in:
Jose Caban
2025-06-07 11:34:38 -04:00
commit 0eb2d7c07d
4708 changed files with 1500614 additions and 0 deletions

View File

@@ -0,0 +1,88 @@
/** Includes ***********************/
#include <stdio.h>
#include "vector"
#include "EventManager/EventLoaders/EventLoaderSimple.h"
/** Macros *************************/
/** Variables **********************/
/** Forward Declarations ***********/
/** Implementations ****************/
namespace CKG
{
namespace Lib
{
namespace EventManager
{
namespace EventLoaders
{
EventLoaderSimple::EventLoaderSimple()
{
}
EventLoaderSimple::~EventLoaderSimple()
{
}
/*!
*/
bool EventLoaderSimple::IsFileValid(const FileName fileName)
{
FILE *fp = fopen(fileName, "r");
if (fp != NULL)
{
fclose(fp);
return true;
}
else
{
return false;
}
}
/*!
\brief Loads an event in the simple format described below
\param fileName - file to load
\param outNumEvents - [out] Number of events loaded
\param outEvents - [out] Array of loaded events
\return - void.
File Format:
E:<value>:<description>
T:<trigger, in seconds>:<TriggerDescription>
<1 .. N triggers>
<1 .. N Events>
*/
void EventLoaderSimple::LoadEvents(const FileName fileName, int *outNumEvents, Event **outEvents)
{
// Protect the function call
if (!outNumEvents || !outEvents)
{
return;
}
// Open the file
FILE *fp = fopen(fileName, "r");
if (fp != NULL)
{
fclose(fp);
}
else
{
outNumEvents = NULL;
outEvents = NULL;
}
}
}
}
}
}