/**
* @file CM_IniFile.h
* @brief 读取ini配置文件
* @author GT-BU
* @date 2021.02.01
* @version V1.0
* @copyright TCT
* @par 修改日志
* <table>
* <tr><th>Date        <th>Version  <th>Author     <th>Description
* <tr><td>2021.02.01  <td>V1.0     <td>GT-BU      <td>创建初始版本
* </table>
*/
#ifndef CM_INIFILE_H_
#define CM_INIFILE_H_

#include "CM_Types.h"
#include "CM_Memory.h"

#ifdef __cplusplus
extern "C"
{
#endif



    /* 读取指定的字符串键值 */
    ENUM_CM_RETURN CM_GetProfileString(IN const CM_CHAR *profile, IN const CM_CHAR *appName, IN const CM_CHAR *keyName, OUT CM_CHAR *keyVal);
    /* 读取指定的整型键值 */
    CM_INT32 CM_GetProfileInt(IN const CM_CHAR *profile,IN const CM_CHAR *AppName,IN const CM_CHAR *KeyName);

    /* 读取指定的HEX键值 */
    CM_UINT32 CM_GetProfileHex(IN const CM_CHAR *profile, OUT const CM_CHAR *AppName, IN const CM_CHAR *KeyName);

    CM_INT32 CM_ReadFile(IN const CM_CHAR *profile, IN CM_UINT32 offset, IN CM_INT64 len, OUT CM_UINT8 *pFileBuf);
	
	/* 获取文件大小*/
    CM_INT64 CM_GetFileSize(IN const CM_CHAR *profile);
    CM_INT32 CM_ReadOpenFile(IN  FILE *pfile, OUT CM_UINT8 *pFileBuf ,IN CM_INT64 len );
    void l_trim(OUT CM_CHAR *szOutput, IN const CM_CHAR *szInput);
    void a_trim(OUT CM_CHAR *szOutput, IN const CM_CHAR *szInput);
#ifdef __cplusplus
}
#endif

#endif


