RDI/include/RDI.h
2022-09-17 12:26:51 +02:00

98 lines
2.1 KiB
C++

/**
* @file RDI.h
* @date 15/09/2022
* @author JackCarterSmith
* @copyright GPL-v3.0
* @brief Rogue Data Interface library main entry file.
*
*/
#ifndef RDI_H_
#define RDI_H_
#if defined(_MSC_VER)
# define RDI_ABI_EXPORT __declspec(dllexport)
# define RDI_ABI_IMPORT __declspec(dllimport)
#elif __GNUC__ >= 4
# define RDI_ABI_EXPORT __attribute__ ((visibility("default")))
# define RDI_ABI_IMPORT __attribute__ ((visibility("default")))
#else
# define RDI_ABI_EXPORT
# define RDI_ABI_IMPORT
#endif
#if defined(RDI_DLL)
# if defined(WIN32)
# if defined(RDI_DLLBUILD)
# define RDI_EXTERN RDI_ABI_EXPORT
# else
# define RDI_EXTERN RDI_ABI_IMPORT
# endif
# endif
#endif
#ifndef RDI_EXTERN
# define RDI_EXTERN
#endif
///////////////////////////////////////////////////////////////////////////////
// Library's functions declaration
///////////////////////////////////////////////////////////////////////////////
namespace RDI
{
class RDI_EXTERN RDI {
private:
std::string libVersion;
std::string workingDir = ".";
public:
RDI();
virtual ~RDI();
/**
* @brief Get the current library version.
* @return String of the version.
*/
inline std::string getLibVersion() {
return libVersion;
}
/**
* @brief Get the current working directory of the library instance.
* @return Path string of the current working directory.
*/
std::string getWorkingDirectory() {
return workingDir;
}
/**
* @brief Set the current working directory of the library instance.
* @param[in] newPath Path string without final slash.
*/
void setWorkingDirectory( std::string newPath ) {
workingDir = newPath;
}
};
/**
* @brief Search for Rogue data file, try to open it and map it in memory.
* @return Error status, return RDI_SUCCESS in nominal case.
*/
RDI_EXTERN unsigned short OpenRogueDat( void );
/**
* @brief Try to open Rogue data file and map it in memory.
*
* @param[in] filePath Path to Rogue data file.
*
* @return Error status, return RDI_SUCCESS in nominal case.
*/
RDI_EXTERN unsigned short OpenRogueDat( const char* filePath );
}
#endif /* RDI_H_ */