Skip to content

Commit 29e2534

Browse files
committed
Merge pull request #3193 from Chris--A/SD_Strings
Added String handling to SD class
2 parents 9d13023 + 36f320b commit 29e2534

File tree

1 file changed

+5
-0
lines changed
  • libraries/SD/src

1 file changed

+5
-0
lines changed

libraries/SD/src/SD.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,23 @@ class SDClass {
7171
// write, etc). Returns a File object for interacting with the file.
7272
// Note that currently only one file can be open at a time.
7373
File open(const char *filename, uint8_t mode = FILE_READ);
74+
File open(const String &filename, uint8_t mode = FILE_READ) { return open( filename.c_str(), mode ); }
7475

7576
// Methods to determine if the requested file path exists.
7677
boolean exists(char *filepath);
78+
boolean exists(const String &filepath) { return exists(filepath.c_str()); }
7779

7880
// Create the requested directory heirarchy--if intermediate directories
7981
// do not exist they will be created.
8082
boolean mkdir(char *filepath);
83+
boolean mkdir(const String &filepath) { return mkdir(filepath.c_str()); }
8184

8285
// Delete the file.
8386
boolean remove(char *filepath);
87+
boolean remove(const String &filepath) { return remove(filepath.c_str()); }
8488

8589
boolean rmdir(char *filepath);
90+
boolean rmdir(const String &filepath) { return rmdir(filepath.c_str()); }
8691

8792
private:
8893

0 commit comments

Comments
 (0)