IFS Namespace Reference

Namespaces

 Debug
 
 Error
 
 FAT
 
 FWFS
 
 Gdb
 
 Host
 
 HYFS
 

Classes

class  DirectoryTemplate
 Directory stream class. More...
 
class  FileStream
 File stream class. More...
 
class  HtmlDirectoryTemplate
 Read-only stream access to directory listing with HTML output. More...
 
class  JsonDirectoryTemplate
 Read-only stream providing directory listing in JSON format. More...
 
struct  ACL
 
struct  AttributeEnum
 Attribute information passed to enumeration callback. More...
 
struct  Compression
 A compression descriptor. More...
 
class  Directory
 Wrapper class for enumerating a directory. More...
 
struct  Extent
 Defines the location of a contiguous run of file data. More...
 
class  File
 Wraps up all file access methods. More...
 
class  FileCopier
 Class to manage copying of files and directories including attributes. More...
 
class  FileSystem
 Installable File System base class. More...
 
class  FsBase
 
class  IFileSystem
 Installable File System base class. More...
 
struct  NameBuffer
 defines a 'safe' name buffer More...
 
struct  FileNameBuffer
 a quick'n'dirty name buffer with maximum path allocation More...
 
class  IProfiler
 Filesystems may optionally provide performance statistics. More...
 
class  Profiler
 
struct  Stat
 File Status structure. More...
 
struct  NameStat
 version of Stat with integrated name buffer More...
 
struct  TimeStamp
 Manage IFS timestamps stored as an unsigned 32-bit value. More...
 

Typedefs

using AttributeEnumCallback = Delegate< bool(AttributeEnum &e)>
 Return true to continue enumeration, false to stop. More...
 
using ErrorCode = int
 
using FileAttributes = BitSet< uint8_t, FileAttribute, size_t(FileAttribute::MAX)>
 File attributes are stored as a bitmask. More...
 
using DirHandle = struct ImplFileDir *
 
using OpenFlags = BitSet< uint8_t, OpenFlag, size_t(OpenFlag::MAX)>
 
using FileHandle = int16_t
 File handle. More...
 
using FileID = uint32_t
 File identifier. More...
 

Enumerations

enum class  AttributeTag : uint16_t { XX , User = 16 }
 Identifies a specific attribute. More...
 
enum  ControlCode : uint16_t { FCNTL_GET_MD5_HASH = 1 , FCNTL_SET_VOLUME_LABEL = 2 , FCNTL_USER_BASE = 0x8000 }
 See IFS::IFileSystem::fcontrol More...
 
enum class  FileAttribute { XX , MAX }
 
enum class  OpenFlag { XX , MAX }
 
enum class  UserRole : uint8_t { XX , MAX }
 

Functions

String getAclString (const IFS::ACL &acl)
 Return a brief textual representation for an ACL Suitable for inclusion in a file listing. More...
 
AttributeTag getUserAttributeTag (uint8_t value)
 
size_t getAttributeSize (AttributeTag tag)
 
String getFileAttributeString (FileAttributes attr)
 Get the string representation for the given set of file attributes suitable for inclusion in a file listing. More...
 
FileSystemgetDefaultFileSystem ()
 Framework should implement this method. More...
 
FileSystemcreateFirmwareFilesystem (Storage::Partition partition)
 Create a firmware filesystem. More...
 
FileSystemcreateHybridFilesystem (Storage::Partition fwfsPartition, IFileSystem *flashFileSystem)
 Create a hybrid filesystem. More...
 
FileSystemmountArchive (FileSystem &fs, const String &filename)
 Mount an FWFS archive. More...
 
constexpr OpenFlags operator| (OpenFlag a, OpenFlag b)
 
time_t fsGetTimeUTC ()
 Get current timestamp in UTC. More...
 
char getChar (UserRole role)
 
UserRole getUserRole (char code, UserRole defaultRole)
 
bool isRootPath (const char *&path)
 Check if path is root directory. More...
 
void checkStat (Stat &stat)
 
FileSystemcreateFatFilesystem (Storage::Partition partition)
 Create a FAT filesystem. More...
 
Return compression corresponding to given string
Parameters
str
Return values
Compression::Type
Compression::Type getCompressionType (const char *str, Compression::Type defaultValue=Compression::Type::None)
 
Compression::Type getCompressionType (const String &str, Compression::Type defaultValue=Compression::Type::None)
 
Return the access type value for the given string.
Parameters
str
defaultRoleReturned if string isn't recognsed
Return values
UserRole
UserRole getUserRole (const char *str, UserRole defaultRole)
 
UserRole getUserRole (const String &str, UserRole defaultRole)
 

Variables

constexpr ErrorCode FS_OK = Error::Success
 

Typedef Documentation

◆ AttributeEnumCallback

Return true to continue enumeration, false to stop.

◆ DirHandle

using IFS::DirHandle = typedef struct ImplFileDir*

◆ FileAttributes

using IFS::FileAttributes = typedef BitSet<uint8_t, FileAttribute, size_t(FileAttribute::MAX)>

File attributes are stored as a bitmask.

◆ FileHandle

using IFS::FileHandle = typedef int16_t

File handle.

References an open file

◆ FileID

using IFS::FileID = typedef uint32_t

File identifier.

Contained within Stat, uniquely identifies any file on the file system.

◆ OpenFlags

using IFS::OpenFlags = typedef BitSet<uint8_t, OpenFlag, size_t(OpenFlag::MAX)>

Enumeration Type Documentation

◆ AttributeTag

enum IFS::AttributeTag : uint16_t
strong

Identifies a specific attribute.

Enumerator
XX 
User 

First user attribute.

◆ ControlCode

enum IFS::ControlCode : uint16_t

See IFS::IFileSystem::fcontrol

These are weakly typed as values may be defined elsewhere.

Enumerator
FCNTL_GET_MD5_HASH 

Get stored MD5 hash for file.

FWFS calculates this when the filesystem image is built and can be used by applications to verify file integrity.

On success, returns size of the hash itself (16) If the file is zero-length then Error::NotFound will be returned as the hash is not stored for empty files.

FCNTL_SET_VOLUME_LABEL 

Set volume label.

FCNTL_USER_BASE 

Start of user-defined codes.

Codes before this are reserved for system use

◆ FileAttribute

enum IFS::FileAttribute
strong
Enumerator
XX 
MAX 

◆ OpenFlag

enum IFS::OpenFlag
strong
Enumerator
XX 
MAX 

◆ UserRole

enum IFS::UserRole : uint8_t
strong
Enumerator
XX 
MAX 

Actually maxmimum value + 1...

Function Documentation

◆ checkStat()

void IFS::checkStat ( Stat stat)

◆ createFatFilesystem()

FileSystem* IFS::createFatFilesystem ( Storage::Partition  partition)

Create a FAT filesystem.

Parameters
partition
Return values
FileSystem*constructed filesystem object

◆ createFirmwareFilesystem()

FileSystem* IFS::createFirmwareFilesystem ( Storage::Partition  partition)

Create a firmware filesystem.

Parameters
partition
Return values
FileSystem*constructed filesystem object

◆ createHybridFilesystem()

FileSystem* IFS::createHybridFilesystem ( Storage::Partition  fwfsPartition,
IFileSystem flashFileSystem 
)

Create a hybrid filesystem.

Parameters
fwfsPartitionBase read-only filesystem partition
flashFileSystemThe filesystem to use for writing
Return values
FileSystem*constructed filesystem object

◆ fsGetTimeUTC()

time_t IFS::fsGetTimeUTC ( )

Get current timestamp in UTC.

Return values
time_t
Note
Filing systems must store timestamps in UTC Use this function; makes porting easier.

◆ getAclString()

String IFS::getAclString ( const IFS::ACL acl)

Return a brief textual representation for an ACL Suitable for inclusion in a file listing.

Parameters
acl
Return values
String

◆ getAttributeSize()

size_t IFS::getAttributeSize ( AttributeTag  tag)

◆ getChar()

char IFS::getChar ( UserRole  role)

◆ getCompressionType() [1/2]

Compression::Type IFS::getCompressionType ( const char *  str,
Compression::Type  defaultValue = Compression::Type::None 
)

◆ getCompressionType() [2/2]

Compression::Type IFS::getCompressionType ( const String str,
Compression::Type  defaultValue = Compression::Type::None 
)
inline

◆ getDefaultFileSystem()

FileSystem* IFS::getDefaultFileSystem ( )

Framework should implement this method.

◆ getFileAttributeString()

String IFS::getFileAttributeString ( FileAttributes  attr)

Get the string representation for the given set of file attributes suitable for inclusion in a file listing.

Parameters
attr
Return values
String

◆ getUserAttributeTag()

AttributeTag IFS::getUserAttributeTag ( uint8_t  value)
inline

◆ getUserRole() [1/3]

UserRole IFS::getUserRole ( char  code,
UserRole  defaultRole 
)

◆ getUserRole() [2/3]

UserRole IFS::getUserRole ( const char *  str,
UserRole  defaultRole 
)

◆ getUserRole() [3/3]

UserRole IFS::getUserRole ( const String str,
UserRole  defaultRole 
)
inline

◆ isRootPath()

bool IFS::isRootPath ( const char *&  path)

Check if path is root directory.

Parameters
Pathto check, set to nullptr if it's the root directory
Return values
booltrue if path is root directory

Paths equal to "/" or "" are empty and considered equivalent to nullptr. Methods or functions can use this macro to resolve these for simpler parsing.

◆ mountArchive()

FileSystem* IFS::mountArchive ( FileSystem fs,
const String filename 
)

Mount an FWFS archive.

Parameters
fsFilesystem where file is located
filenameName of archive file
Return values
FileSystem*constructed filesystem object

◆ operator|()

constexpr OpenFlags IFS::operator| ( OpenFlag  a,
OpenFlag  b 
)
inlineconstexpr