source: libcf/trunk/include/cf_file.h@ 151

Last change on this file since 151 was 151, checked in by cheese, 11 years ago

#1 fix interface and add util module

File size: 1.3 KB
RevLine 
[4]1/**
[128]2 * \file cf_file.h
[34]3 *
[128]4 * \author myusgun <myusgun@gmail.com>
5 *
[119]6 * \brief 파일 입출력
[73]7 *
[119]8 * \example file.c
[4]9 */
10#ifndef __CF_FILE_H__
11#define __CF_FILE_H__
12
13#include "cf_base.h"
14
[90]15#include <stddef.h>
16
[26]17/** 파일 열기 옵션 플래그 */
[109]18typedef enum
19{
[90]20 CF_FILE_READ = 0x0001, /**< 읽기 전용 */
21 CF_FILE_WRITE = 0x0002, /**< 쓰기 전용 */
22 CF_FILE_RW = 0x0004, /**< 읽기/쓰기 */
23 CF_FILE_CREATE = 0x0008, /**< 파일이 존재하지 않으면 생성 */
24 CF_FILE_TRUNC = 0x0010, /**< 파일이 존재하면 비우기 */
25 CF_FILE_APPEND = 0x0020 /**< 파일이 존재하면 이어서 쓰기 */
[109]26} CF_FILE_FLAG;
[15]27
[4]28#ifdef __cplusplus
29extern "C" {
30#endif
31
32CF_EXPORT int
[151]33CF_File_Open (cf_ctx * ctx,
34 const char * path,
[16]35 const CF_FILE_FLAG flag);
[4]36
37CF_EXPORT int
[151]38CF_File_Close (cf_ctx ctx);
[4]39
40CF_EXPORT int
[151]41CF_File_Read (const cf_ctx ctx,
[4]42 void * buf,
43 const size_t len);
44
45CF_EXPORT int
[151]46CF_File_Write (const cf_ctx ctx,
[4]47 const void * buf,
48 const size_t len);
49
50CF_EXPORT int
[94]51CF_File_GetSize (const char * path);
[4]52
[109]53CF_EXPORT CF_BOOL
54CF_File_Exists (const char * path);
55
[41]56CF_EXPORT int
57CF_File_MakeDirectory (const char * path);
58
[151]59CF_EXPORT int
60CF_File_GetPath (const cf_ctx ctx,
61 char * path);
62
[4]63#ifdef __cplusplus
64}
65#endif
66
67#endif // #ifndef __CF_FILE_H__
Note: See TracBrowser for help on using the repository browser.