Noodle
Loading...
Searching...
No Matches
noodle_fs.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define NOODLE_FS_NEEDS_LEADING_SLASH   1
 
#define NOODLE_MAX_FILENAME   20
 

Functions

void noodle_copy_name (char *dst, size_t cap, const char *src)
 Copy a C string into a bounded buffer with NUL-termination.
 
const char * noodle_norm_filename (const char *name)
 Normalize a filename/path for the selected filesystem backend.
 
NDL_File noodle_fs_open_read (const char *path)
 Open a file for reading using the selected backend.
 
NDL_File noodle_fs_open_write (const char *path)
 Open a file for writing (create or truncate) using the selected backend.
 
bool noodle_fs_remove (const char *path)
 Remove a file using the selected backend.
 
void noodle_rewind_file (NDL_File &fi)
 Rewind a file handle to position 0.
 

Macro Definition Documentation

◆ NOODLE_FS_NEEDS_LEADING_SLASH

#define NOODLE_FS_NEEDS_LEADING_SLASH   1

◆ NOODLE_MAX_FILENAME

#define NOODLE_MAX_FILENAME   20

Function Documentation

◆ noodle_copy_name()

void noodle_copy_name ( char *  dst,
size_t  cap,
const char *  src 
)
inline

Copy a C string into a bounded buffer with NUL-termination.

◆ noodle_fs_open_read()

NDL_File noodle_fs_open_read ( const char *  path)
inline

Open a file for reading using the selected backend.

◆ noodle_fs_open_write()

NDL_File noodle_fs_open_write ( const char *  path)
inline

Open a file for writing (create or truncate) using the selected backend.

◆ noodle_fs_remove()

bool noodle_fs_remove ( const char *  path)
inline

Remove a file using the selected backend.

◆ noodle_norm_filename()

const char * noodle_norm_filename ( const char *  name)
inline

Normalize a filename/path for the selected filesystem backend.

For backends that require a leading '/', this function prepends it. For SdFat, the input is returned as-is.

Parameters
nameInput filename, e.g. "w01.txt".
Returns
Pointer to a normalized path string.
Warning
For slash-requiring backends, the returned pointer refers to a static buffer.

◆ noodle_rewind_file()

void noodle_rewind_file ( NDL_File &  fi)
inline

Rewind a file handle to position 0.

Different backends expose different seek APIs (seekSet vs seek).