nany
Public Attributes | List of all members
nyio_adapter_t Struct Reference

Adapter for a filesystem. More...

#include <nany.h>

Public Attributes

void * internal
 
void * invalid_fd
 
nyio_type_t(* stat )(nyio_adapter_t *, const char *path, uint32_t len)
 
nyio_type_t(* statex )(nyio_adapter_t *, const char *path, uint32_t len, uint64_t *size, int64_t *modified)
 
uint64_t(* file_read )(void *, void *buffer, uint64_t bufsize)
 
uint64_t(* file_write )(void *, const void *buffer, uint64_t bufsize)
 
void *(* file_open )(nyio_adapter_t *, const char *path, uint32_t len, nybool_t readm, nybool_t writem, nybool_t appendm, nybool_t truncm)
 
void(* file_close )(void *)
 
nybool_t(* file_eof )(void *)
 
nyio_err_t(* file_seek )(void *, uint64_t offset)
 
nyio_err_t(* file_seek_from_end )(void *, int64_t offset)
 
nyio_err_t(* file_seek_cur )(void *, int64_t offset)
 
uint64_t(* file_tell )(void *)
 
void(* file_flush )(void *)
 
uint64_t(* file_size )(nyio_adapter_t *, const char *path, uint32_t len)
 
nyio_err_t(* file_erase )(nyio_adapter_t *, const char *path, uint32_t len)
 
nyio_err_t(* file_exists )(nyio_adapter_t *, const char *path, uint32_t len)
 
nyio_err_t(* file_resize )(nyio_adapter_t *, const char *path, uint32_t len, uint64_t newsize)
 
nyio_err_t(* file_get_contents )(nyio_adapter_t *, char **content, uint64_t *size, uint64_t *capacity, const char *path, uint32_t len)
 
nyio_err_t(* file_set_contents )(nyio_adapter_t *, const char *path, uint32_t len, const char *content, uint32_t ctlen)
 
nyio_err_t(* file_append_contents )(nyio_adapter_t *, const char *path, uint32_t len, const char *content, uint32_t ctlen)
 
nyio_err_t(* folder_create )(nyio_adapter_t *, const char *path, uint32_t len)
 
nyio_err_t(* folder_erase )(nyio_adapter_t *, const char *path, uint32_t len)
 
nyio_err_t(* folder_clear )(nyio_adapter_t *, const char *path, uint32_t len)
 
uint64_t(* folder_size )(nyio_adapter_t *, const char *path, uint32_t len)
 
nyio_err_t(* folder_exists )(nyio_adapter_t *, const char *path, uint32_t len)
 
nyio_iterator_t *(* folder_iterate )(nyio_adapter_t *, const char *path, uint32_t len, nybool_t recursive, nybool_t files, nybool_t folders)
 
nyio_iterator_t *(* folder_next )(nyio_iterator_t *)
 
const char *(* folder_iterator_fullpath )(nyio_adapter_t *, nyio_iterator_t *)
 
const char *(* folder_iterator_name )(nyio_iterator_t *)
 
uint64_t(* folder_iterator_size )(nyio_iterator_t *)
 
nyio_type_t(* folder_iterator_type )(nyio_iterator_t *)
 
void(* folder_iterator_close )(nyio_iterator_t *)
 
void(* clone )(nyio_adapter_t *parent, nyio_adapter_t *dst)
 
void(* release )(nyio_adapter_t *)
 

Detailed Description

Adapter for a filesystem.

Warning
The implementation MUST consider that input strings are NOT zero-terminated

Member Data Documentation

§ clone

void(* nyio_adapter_t::clone) (nyio_adapter_t *parent, nyio_adapter_t *dst)

Clone the adapter, most likely for a new thread

§ file_append_contents

nyio_err_t(* nyio_adapter_t::file_append_contents) (nyio_adapter_t *, const char *path, uint32_t len, const char *content, uint32_t ctlen)

Append the content to a file

§ file_close

void(* nyio_adapter_t::file_close) (void *)

Close a file

§ file_eof

nybool_t(* nyio_adapter_t::file_eof) (void *)

End of file

§ file_erase

nyio_err_t(* nyio_adapter_t::file_erase) (nyio_adapter_t *, const char *path, uint32_t len)

Get the file size or the folder size (in bytes)

§ file_exists

nyio_err_t(* nyio_adapter_t::file_exists) (nyio_adapter_t *, const char *path, uint32_t len)

Get if a file exists

§ file_flush

void(* nyio_adapter_t::file_flush) (void *)

Flush a file

§ file_get_contents

nyio_err_t(* nyio_adapter_t::file_get_contents) (nyio_adapter_t *, char **content, uint64_t *size, uint64_t *capacity, const char *path, uint32_t len)

Retrieve the content of a file

§ file_open

void*(* nyio_adapter_t::file_open) (nyio_adapter_t *, const char *path, uint32_t len, nybool_t readm, nybool_t writem, nybool_t appendm, nybool_t truncm)

Open a local file for the current thread

§ file_read

uint64_t(* nyio_adapter_t::file_read) (void *, void *buffer, uint64_t bufsize)

Read content from a file

§ file_resize

nyio_err_t(* nyio_adapter_t::file_resize) (nyio_adapter_t *, const char *path, uint32_t len, uint64_t newsize)

Resize a file

§ file_seek

nyio_err_t(* nyio_adapter_t::file_seek) (void *, uint64_t offset)

Seek from the begining of the file

§ file_seek_cur

nyio_err_t(* nyio_adapter_t::file_seek_cur) (void *, int64_t offset)

Seek from the current cursor position

§ file_seek_from_end

nyio_err_t(* nyio_adapter_t::file_seek_from_end) (void *, int64_t offset)

Seek from the end of the file

§ file_set_contents

nyio_err_t(* nyio_adapter_t::file_set_contents) (nyio_adapter_t *, const char *path, uint32_t len, const char *content, uint32_t ctlen)

Set the content of a file

§ file_size

uint64_t(* nyio_adapter_t::file_size) (nyio_adapter_t *, const char *path, uint32_t len)

Get the file size or the folder size (in bytes)

§ file_tell

uint64_t(* nyio_adapter_t::file_tell) (void *)

Tell the current cursor position

§ file_write

uint64_t(* nyio_adapter_t::file_write) (void *, const void *buffer, uint64_t bufsize)

Write content to an opened file

§ folder_clear

nyio_err_t(* nyio_adapter_t::folder_clear) (nyio_adapter_t *, const char *path, uint32_t len)

Delete the contents of a folder

§ folder_create

nyio_err_t(* nyio_adapter_t::folder_create) (nyio_adapter_t *, const char *path, uint32_t len)

Create a new folder

§ folder_erase

nyio_err_t(* nyio_adapter_t::folder_erase) (nyio_adapter_t *, const char *path, uint32_t len)

Delete a folder and all its content

§ folder_exists

nyio_err_t(* nyio_adapter_t::folder_exists) (nyio_adapter_t *, const char *path, uint32_t len)

Get if a folder exists

§ folder_iterate

nyio_iterator_t*(* nyio_adapter_t::folder_iterate) (nyio_adapter_t *, const char *path, uint32_t len, nybool_t recursive, nybool_t files, nybool_t folders)

Iterate through folder

§ folder_iterator_close

void(* nyio_adapter_t::folder_iterator_close) (nyio_iterator_t *)

Close an iterator

§ folder_iterator_fullpath

const char*(* nyio_adapter_t::folder_iterator_fullpath) (nyio_adapter_t *, nyio_iterator_t *)

Get the full path (i.e. /baz/foo,txt) of the current element

§ folder_iterator_name

const char*(* nyio_adapter_t::folder_iterator_name) (nyio_iterator_t *)

Get the filename (i.e. foo.txt) of the current element

§ folder_iterator_size

uint64_t(* nyio_adapter_t::folder_iterator_size) (nyio_iterator_t *)

Get the size in bytes of the current element

§ folder_iterator_type

nyio_type_t(* nyio_adapter_t::folder_iterator_type) (nyio_iterator_t *)

Get the type of the current element

§ folder_next

nyio_iterator_t*(* nyio_adapter_t::folder_next) (nyio_iterator_t *)

Go to the next element

§ folder_size

uint64_t(* nyio_adapter_t::folder_size) (nyio_adapter_t *, const char *path, uint32_t len)

Get the folder size (in bytes)

§ internal

void* nyio_adapter_t::internal

Internal opaque pointer

§ invalid_fd

void* nyio_adapter_t::invalid_fd

Value considered as invalid file descriptor

§ release

void(* nyio_adapter_t::release) (nyio_adapter_t *)

Release the adapter

§ stat

nyio_type_t(* nyio_adapter_t::stat) (nyio_adapter_t *, const char *path, uint32_t len)

Stat a node

§ statex

nyio_type_t(* nyio_adapter_t::statex) (nyio_adapter_t *, const char *path, uint32_t len, uint64_t *size, int64_t *modified)

Stat a node


The documentation for this struct was generated from the following file: