2022-10-27 15:16:54 -06:00
|
|
|
#ifndef ARC_STD_IO_H_
|
|
|
|
|
#define ARC_STD_IO_H_
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2023-01-17 01:59:08 -07:00
|
|
|
#include "arc/std/string.h"
|
2022-10-27 15:16:54 -06:00
|
|
|
|
2024-01-27 03:14:04 -07:00
|
|
|
/**
|
|
|
|
|
* @brief get string and size from file
|
|
|
|
|
*
|
|
|
|
|
* @param path a string to path of target file
|
|
|
|
|
* @param data pointer to where uint8_t array will be created
|
|
|
|
|
* this will need to be freed once done using it
|
|
|
|
|
* @param length length of the data read in
|
|
|
|
|
*/
|
|
|
|
|
void ARC_IO_ReadFileToUint8t(ARC_String *path, uint8_t **data, uint64_t *length);
|
|
|
|
|
|
2022-10-27 15:16:54 -06:00
|
|
|
/**
|
|
|
|
|
* @brief get string and size from file
|
|
|
|
|
*
|
|
|
|
|
* @param path a string to path of target file
|
|
|
|
|
* @param data pointer to where string will be created
|
|
|
|
|
* this will need to be freed once done using it
|
|
|
|
|
*/
|
2023-01-17 01:59:08 -07:00
|
|
|
void ARC_IO_FileToStr(ARC_String *path, ARC_String **data);
|
2022-10-27 15:16:54 -06:00
|
|
|
|
2024-01-23 21:16:43 -07:00
|
|
|
/**
|
|
|
|
|
* @brief write string to file
|
|
|
|
|
*
|
|
|
|
|
* @param path a string to path of target file
|
|
|
|
|
* @param data data to be written
|
|
|
|
|
*/
|
|
|
|
|
void ARC_IO_WriteStrToFile(ARC_String *path, ARC_String *data);
|
|
|
|
|
|
2022-10-27 15:16:54 -06:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif //ARC_STD_IO_H_
|