RDI/include/RDI.h

71 lines
1.6 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
namespace RDI {
/**
* @brief Get the current library version.
* @return String of the version.
*/
RDI_EXTERN std::string getLibVersion( void );
/**
* @brief Create a new Rogue Data file instance.
* @details Try to open DATA.DAT file at location specified by roguePath.
* If file can be opened, it's mapped in memory and process files list.
*
* @param[in] roguePath Path to DATA.DAT and DATA.HDR location.
*
* @return Handler of RogueData file, should be used with other function of this lib.
*/
RDI_EXTERN void CreateRDatHandler( std::string roguePath );
RDI_EXTERN unsigned char getSectionCount( void );
RDI_EXTERN std::string getSectionName( unsigned char id );
RDI_EXTERN unsigned int getSectionOffset( unsigned char id );
/**
* @brief Clean up global resources.
*/
RDI_EXTERN void DestroyRDatHandler( void );
}
#endif /* RDI_H_ */