Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Files | Typedefs | Enumerations | Functions

Files

file  afw_file.h
 Header file for Adaptive Framework file support.
 

Typedefs

typedef enum afw_file_mode_e afw_file_mode_t
 

Enumerations

enum  afw_file_mode_e { afw_file_mode_read , afw_file_mode_write , afw_file_mode_write_new , afw_file_mode_write_existing }
 

Functions

const afw_utf8_tafw_file_insure_full_path (const afw_utf8_t *path, const afw_pool_t *p, afw_xctx_t *xctx)
 Return full file path. More...
 
const afw_adaptor_factory_tafw_file_adaptor_factory_get ()
 Get the factory for file adaptor. More...
 
const afw_adaptor_tafw_file_adaptor_create_cede_p (const afw_object_t *properties, const afw_pool_t *p, afw_xctx_t *xctx)
 Create a file adaptor. More...
 
const afw_memory_tafw_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. More...
 
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. More...
 
void afw_file_delete (const afw_utf8_t *file_path, afw_xctx_t *xctx)
 Delete file. More...
 

Detailed Description

Adaptive Framework adaptor for storing objects in file system.

Typedef Documentation

◆ afw_file_mode_t

File mode.

Enumeration Type Documentation

◆ afw_file_mode_e

File mode.

Definition at line 31 of file afw_file.h.

Function Documentation

◆ afw_file_adaptor_create_cede_p()

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.

Parameters
propertiesconfiguration.
pto use for adaptor resources.
xctxof caller.
Returns
New instance of file adaptor.

Definition at line 285 of file afw_file.c.

◆ afw_file_adaptor_factory_get()

const afw_adaptor_factory_t* afw_file_adaptor_factory_get ( )

Get the factory for file adaptor.

Returns
factory singleton instance.

Definition at line 261 of file afw_file.c.

◆ afw_file_delete()

void afw_file_delete ( const afw_utf8_t file_path,
afw_xctx_t xctx 
)

Delete file.

Parameters
file_pathfile path
xctxof caller.

◆ afw_file_from_memory()

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.

Parameters
file_pathfile path
xctxof caller.
Returns
value

Definition at line 136 of file afw_file.c.

◆ afw_file_insure_full_path()

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.

Parameters
pathis a full or relative path.
pto use for adaptor resources.
xctxof caller.
Returns
full path.

The current working directory will be prepended if path is a relative path.

Definition at line 40 of file afw_file.c.

◆ afw_file_to_memory()

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.

Parameters
file_pathfile path
file_sizesize of file if already known or 0.
pPool for memory.
xctxof caller.
Returns
value

Definition at line 71 of file afw_file.c.