Soldered SD Card Arduino Library 1.0.0
Easily read and write files to and form the SD card breakout! A fork of the original SDFat library by Bill Greiman.
Loading...
Searching...
No Matches
ExFatVolume Class Reference

exFAT volume. More...

#include <ExFatVolume.h>

Inherits ExFatPartition.

Inherited by SdBase< ExFatVolume >.

Public Member Functions

 ExFatVolume ()
 
bool begin (BlockDevice *dev, bool setCwv=true, uint8_t part=1)
 
bool chdir ()
 
bool chdir (const ExChar_t *path)
 
void chvol ()
 
bool exists (const ExChar_t *path)
 
bool ls (print_t *pr, uint8_t flags=0)
 
bool ls (print_t *pr, const ExChar_t *path, uint8_t flags)
 
bool mkdir (const ExChar_t *path, bool pFlag=true)
 
ExFile open (const ExChar_t *path, oflag_t oflag=O_RDONLY)
 
bool remove (const ExChar_t *path)
 
bool rename (const ExChar_t *oldPath, const ExChar_t *newPath)
 
bool rmdir (const ExChar_t *path)
 
bool truncate (const ExChar_t *path, uint64_t length)
 
bool ls ()
 
bool ls (uint8_t flags)
 
bool ls (const ExChar_t *path, uint8_t flags=0)
 
bool chdir (const String &path)
 
bool exists (const String &path)
 
bool mkdir (const String &path, bool pFlag=true)
 
ExFile open (const String &path, oflag_t oflag=O_RDONLY)
 
bool remove (const String &path)
 
bool rename (const String &oldPath, const String &newPath)
 
bool rmdir (const String &path)
 
bool truncate (const String &path, uint64_t length)
 
bool exists (const char *path)
 
bool mkdir (const char *path, bool pFlag=true)
 
bool remove (const char *path)
 
bool rename (const char *oldPath, const char *newPath)
 
bool rmdir (const char *path)
 
- Public Member Functions inherited from ExFatPartition
 ExFatPartition ()
 
uint32_t bytesPerCluster () const
 
uint8_t bytesPerClusterShift () const
 
uint16_t bytesPerSector () const
 
uint8_t bytesPerSectorShift () const
 
uint8_t * cacheClear ()
 
uint32_t clusterCount () const
 
uint32_t clusterHeapStartSector () const
 
uint32_t fatLength () const
 
uint32_t fatStartSector () const
 
uint8_t fatType () const
 
uint32_t freeClusterCount ()
 
bool init (BlockDevice *dev, uint8_t part)
 
bool isBusy ()
 
uint32_t rootDirectoryCluster () const
 
uint32_t rootLength ()
 
uint32_t sectorsPerCluster () const
 
uint32_t blocksPerCluster () __attribute__((deprecated))
 
uint8_t sectorsPerClusterShift () const
 
void checkUpcase (print_t *pr)
 
bool printDir (print_t *pr, ExFatFile *file)
 
void dmpBitmap (print_t *pr)
 
void dmpCluster (print_t *pr, uint32_t cluster, uint32_t offset, uint32_t count)
 
void dmpFat (print_t *pr, uint32_t start, uint32_t count)
 
void dmpSector (print_t *pr, uint32_t sector)
 
bool printVolInfo (print_t *pr)
 
void printFat (print_t *pr)
 
void printUpcase (print_t *pr)
 

Private Member Functions

ExFatFilevwd ()
 

Static Private Member Functions

static ExFatVolumecwv ()
 

Private Attributes

friend ExFatFile
 
ExFatFile m_vwd
 

Static Private Attributes

static ExFatVolumem_cwv = nullptr
 

Detailed Description

exFAT volume.

Constructor & Destructor Documentation

◆ ExFatVolume()

ExFatVolume::ExFatVolume ( )
inline

Member Function Documentation

◆ begin()

bool ExFatVolume::begin ( BlockDevice dev,
bool  setCwv = true,
uint8_t  part = 1 
)
inline

Initialize an FatVolume object.

Parameters
[in]devDevice block driver.
[in]setCwvSet current working volume if true.
[in]partpartition to initialize.
Returns
true for success or false for failure.

◆ chdir() [1/3]

bool ExFatVolume::chdir ( )
inline

Set volume working directory to root.

Returns
true for success or false for failure.

◆ chdir() [2/3]

bool ExFatVolume::chdir ( const ExChar_t path)

Set volume working directory.

Parameters
[in]pathPath for volume working directory.
Returns
true for success or false for failure.

◆ chdir() [3/3]

bool ExFatVolume::chdir ( const String &  path)
inline

Set volume working directory.

Parameters
[in]pathPath for volume working directory.
Returns
true for success or false for failure.

◆ chvol()

void ExFatVolume::chvol ( )
inline

Change global working volume to this volume.

◆ cwv()

static ExFatVolume * ExFatVolume::cwv ( )
inlinestaticprivate

◆ exists() [1/3]

bool ExFatVolume::exists ( const char *  path)

◆ exists() [2/3]

bool ExFatVolume::exists ( const ExChar_t path)
inline

Test for the existence of a file.

Parameters
[in]pathPath of the file to be tested for.
Returns
true if the file exists else false.

◆ exists() [3/3]

bool ExFatVolume::exists ( const String &  path)
inline

Test for the existence of a file in a directory

Parameters
[in]pathPath of the file to be tested for.
Returns
true if the file exists else false.

◆ ls() [1/5]

bool ExFatVolume::ls ( )
inline

List the directory contents of the root directory to Serial.

Returns
true for success or false for failure.

◆ ls() [2/5]

bool ExFatVolume::ls ( const ExChar_t path,
uint8_t  flags = 0 
)
inline

List the directory contents of a directory to Serial.

Parameters
[in]pathdirectory to list.
[in]flagsThe inclusive OR of

LS_DATE - Print file modification date

LS_SIZE - Print file size.

LS_R - Recursive list of subdirectories.

Returns
true for success or false for failure.

◆ ls() [3/5]

bool ExFatVolume::ls ( print_t pr,
const ExChar_t path,
uint8_t  flags 
)
inline

List the contents of a directory.

Parameters
[in]prPrint stream for list.
[in]pathdirectory to list.
[in]flagsThe inclusive OR of

LS_DATE - Print file modification date

LS_SIZE - Print file size.

LS_R - Recursive list of subdirectories.

Returns
true for success or false for failure.

◆ ls() [4/5]

bool ExFatVolume::ls ( print_t pr,
uint8_t  flags = 0 
)
inline

List the directory contents of the root directory.

Parameters
[in]prPrint stream for list.
[in]flagsThe inclusive OR of

LS_DATE - Print file modification date

LS_SIZE - Print file size.

LS_R - Recursive list of subdirectories.

Returns
true for success or false for failure.

◆ ls() [5/5]

bool ExFatVolume::ls ( uint8_t  flags)
inline

List the directory contents of the volume root to Serial.

Parameters
[in]flagsThe inclusive OR of

LS_DATE - Print file modification date

LS_SIZE - Print file size.

LS_R - Recursive list of subdirectories.

Returns
true for success or false for failure.

◆ mkdir() [1/3]

bool ExFatVolume::mkdir ( const char *  path,
bool  pFlag = true 
)

◆ mkdir() [2/3]

bool ExFatVolume::mkdir ( const ExChar_t path,
bool  pFlag = true 
)
inline

Make a subdirectory in the volume root directory.

Parameters
[in]pathA path with a valid 8.3 DOS name for the subdirectory.
[in]pFlagCreate missing parent directories if true.
Returns
true for success or false for failure.

◆ mkdir() [3/3]

bool ExFatVolume::mkdir ( const String &  path,
bool  pFlag = true 
)
inline

Make a subdirectory in the volume root directory.

Parameters
[in]pathA path with a valid 8.3 DOS name for the subdirectory.
[in]pFlagCreate missing parent directories if true.
Returns
true for success or false for failure.

◆ open() [1/2]

ExFile ExFatVolume::open ( const ExChar_t path,
oflag_t  oflag = O_RDONLY 
)
inline

open a file

Parameters
[in]pathlocation of file to be opened.
[in]oflagopen flags.
Returns
a ExFile object.

◆ open() [2/2]

ExFile ExFatVolume::open ( const String &  path,
oflag_t  oflag = O_RDONLY 
)
inline

open a file

Parameters
[in]pathlocation of file to be opened.
[in]oflagopen oflag flags.
Returns
a ExFile object.

◆ remove() [1/3]

bool ExFatVolume::remove ( const char *  path)

◆ remove() [2/3]

bool ExFatVolume::remove ( const ExChar_t path)
inline

Remove a file from the volume root directory.

Parameters
[in]pathA path with a valid 8.3 DOS name for the file.
Returns
true for success or false for failure.

◆ remove() [3/3]

bool ExFatVolume::remove ( const String &  path)
inline

Remove a file from the volume root directory.

Parameters
[in]pathA path with a valid name for the file.
Returns
true for success or false for failure.

◆ rename() [1/3]

bool ExFatVolume::rename ( const char *  oldPath,
const char *  newPath 
)

◆ rename() [2/3]

bool ExFatVolume::rename ( const ExChar_t oldPath,
const ExChar_t newPath 
)
inline

Rename a file or subdirectory.

Parameters
[in]oldPathPath name to the file or subdirectory to be renamed.
[in]newPathNew path name of the file or subdirectory.

The newPath object must not exist before the rename call.

The file to be renamed must not be open. The directory entry may be moved and file system corruption could occur if the file is accessed by a file object that was opened before the rename() call.

Returns
true for success or false for failure.

◆ rename() [3/3]

bool ExFatVolume::rename ( const String &  oldPath,
const String &  newPath 
)
inline

Rename a file or subdirectory.

Parameters
[in]oldPathPath name to the file or subdirectory to be renamed.
[in]newPathNew path name of the file or subdirectory.

The newPath object must not exist before the rename call.

The file to be renamed must not be open. The directory entry may be moved and file system corruption could occur if the file is accessed by a file object that was opened before the rename() call.

Returns
true for success or false for failure.

◆ rmdir() [1/3]

bool ExFatVolume::rmdir ( const char *  path)

◆ rmdir() [2/3]

bool ExFatVolume::rmdir ( const ExChar_t path)
inline

Remove a subdirectory from the volume's working directory.

Parameters
[in]pathA path with a valid 8.3 DOS name for the subdirectory.

The subdirectory file will be removed only if it is empty.

Returns
true for success or false for failure.

◆ rmdir() [3/3]

bool ExFatVolume::rmdir ( const String &  path)
inline

Remove a subdirectory from the volume's working directory.

Parameters
[in]pathA path with a valid name for the subdirectory.

The subdirectory file will be removed only if it is empty.

Returns
true for success or false for failure.

◆ truncate() [1/2]

bool ExFatVolume::truncate ( const ExChar_t path,
uint64_t  length 
)
inline

Truncate a file to a specified length. The current file position will be at the new EOF.

Parameters
[in]pathA path with a valid 8.3 DOS name for the file.
[in]lengthThe desired length for the file.
Returns
true for success or false for failure.

◆ truncate() [2/2]

bool ExFatVolume::truncate ( const String &  path,
uint64_t  length 
)
inline

Truncate a file to a specified length. The current file position will be at the new EOF.

Parameters
[in]pathA path with a valid name for the file.
[in]lengthThe desired length for the file.
Returns
true for success or false for failure.

◆ vwd()

ExFatFile * ExFatVolume::vwd ( )
inlineprivate

Member Data Documentation

◆ ExFatFile

friend ExFatVolume::ExFatFile
private

◆ m_cwv

ExFatVolume * ExFatVolume::m_cwv = nullptr
staticprivate

Copyright (c) 2011-2020 Bill Greiman This file is part of the SdFat library for SD memory cards.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

◆ m_vwd

ExFatFile ExFatVolume::m_vwd
private

The documentation for this class was generated from the following files: