Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
afw_file.h
Go to the documentation of this file.
1 // See the 'COPYING' file in the project root for licensing information.
2 /*
3  * Adaptive Framework file support
4  *
5  * Copyright (c) 2010-2023 Clemson University
6  *
7  */
8 
9 #ifndef __AFW_FILE_H__
10 #define __AFW_FILE_H__
11 
12 #include "afw_interface.h"
13 
29 
31 typedef enum afw_file_mode_e {
32  afw_file_mode_read,
33  afw_file_mode_write,
34  afw_file_mode_write_new,
35  afw_file_mode_write_existing
37 
38 
50 AFW_DECLARE(const afw_utf8_t *)
52  const afw_pool_t *p, afw_xctx_t *xctx);
53 
54 
61 
71  const afw_object_t *properties,
72  const afw_pool_t *p, afw_xctx_t *xctx);
73 
74 
85  const afw_utf8_t * file_path,
86  apr_size_t file_size,
87  const afw_pool_t *p,
88  afw_xctx_t *xctx);
89 
90 
91 
98 AFW_DECLARE(void)
100  const afw_utf8_t * file_path,
101  const afw_memory_t * from_memory,
102  afw_file_mode_t mode,
103  afw_xctx_t *xctx);
104 
105 
111 AFW_DECLARE(void)
113  const afw_utf8_t * file_path,
114  afw_xctx_t *xctx);
115 
116 
117 AFW_END_DECLARES
118 
121 #endif /* __AFW_FILE_H__ */
#define AFW_BEGIN_DECLARES
#define AFW_DECLARE(type)
Declare a public afw function.
Interfaceafw_interface header.
afw_file_mode_e
Definition: afw_file.h:31
const afw_utf8_t * afw_file_insure_full_path(const afw_utf8_t *path, const afw_pool_t *p, afw_xctx_t *xctx)
Return full file path.
Definition: afw_file.c:40
void afw_file_from_memory(const afw_utf8_t *file_path, const afw_memory_t *from_memory, afw_file_mode_t mode, afw_xctx_t *xctx)
Write a file from a memory.
Definition: afw_file.c:136
const afw_memory_t * afw_file_to_memory(const afw_utf8_t *file_path, apr_size_t file_size, const afw_pool_t *p, afw_xctx_t *xctx)
Read a file into a memory in a specifed pool.
Definition: afw_file.c:71
const afw_adaptor_t * afw_file_adaptor_create_cede_p(const afw_object_t *properties, const afw_pool_t *p, afw_xctx_t *xctx)
Create a file adaptor.
Definition: afw_file.c:285
void afw_file_delete(const afw_utf8_t *file_path, afw_xctx_t *xctx)
Delete file.
enum afw_file_mode_e afw_file_mode_t
const afw_adaptor_factory_t * afw_file_adaptor_factory_get()
Get the factory for file adaptor.
Definition: afw_file.c:261
Interface afw_adaptor_factory public struct.
Interface afw_adaptor public struct.
Struct for memory pointer and size.
Definition: afw_common.h:505
Interface afw_object public struct.
Interface afw_pool public struct.
NFC normalized UTF-8 string.
Definition: afw_common.h:545
Interface afw_xctx public struct.