@@ -58,7 +58,7 @@ namespace SDLib {
5858#define MAX_COMPONENT_LEN 12 // What is max length?
5959#define PATH_COMPONENT_BUFFER_LEN MAX_COMPONENT_LEN+1
6060
61- bool getNextPathComponent (char *path, unsigned int *p_offset,
61+ bool getNextPathComponent (const char *path, unsigned int *p_offset,
6262 char *buffer) {
6363 /*
6464
@@ -117,9 +117,9 @@ bool getNextPathComponent(char *path, unsigned int *p_offset,
117117
118118
119119
120- boolean walkPath (char *filepath, SdFile& parentDir,
120+ boolean walkPath (const char *filepath, SdFile& parentDir,
121121 boolean (*callback)(SdFile& parentDir,
122- char *filePathComponent,
122+ const char *filePathComponent,
123123 boolean isLastComponent,
124124 void *object),
125125 void *object = NULL) {
@@ -232,7 +232,7 @@ boolean walkPath(char *filepath, SdFile& parentDir,
232232
233233 */
234234
235- boolean callback_pathExists (SdFile& parentDir, char *filePathComponent,
235+ boolean callback_pathExists (SdFile& parentDir, const char *filePathComponent,
236236 boolean isLastComponent, void *object) {
237237 /*
238238
@@ -255,7 +255,7 @@ boolean callback_pathExists(SdFile& parentDir, char *filePathComponent,
255255
256256
257257
258- boolean callback_makeDirPath (SdFile& parentDir, char *filePathComponent,
258+ boolean callback_makeDirPath (SdFile& parentDir, const char *filePathComponent,
259259 boolean isLastComponent, void *object) {
260260 /*
261261
@@ -310,15 +310,15 @@ boolean callback_openPath(SdFile& parentDir, char *filePathComponent,
310310
311311
312312
313- boolean callback_remove (SdFile& parentDir, char *filePathComponent,
313+ boolean callback_remove (SdFile& parentDir, const char *filePathComponent,
314314 boolean isLastComponent, void *object) {
315315 if (isLastComponent) {
316316 return SdFile::remove (parentDir, filePathComponent);
317317 }
318318 return true ;
319319}
320320
321- boolean callback_rmdir (SdFile& parentDir, char *filePathComponent,
321+ boolean callback_rmdir (SdFile& parentDir, const char *filePathComponent,
322322 boolean isLastComponent, void *object) {
323323 if (isLastComponent) {
324324 SdFile f;
@@ -517,7 +517,7 @@ File SDClass::open(char *filepath, uint8_t mode) {
517517// }
518518
519519
520- boolean SDClass::exists (char *filepath) {
520+ boolean SDClass::exists (const char *filepath) {
521521 /*
522522
523523 Returns true if the supplied file path exists.
@@ -538,7 +538,7 @@ boolean SDClass::exists(char *filepath) {
538538// }
539539
540540
541- boolean SDClass::mkdir (char *filepath) {
541+ boolean SDClass::mkdir (const char *filepath) {
542542 /*
543543
544544 Makes a single directory or a heirarchy of directories.
@@ -549,7 +549,7 @@ boolean SDClass::mkdir(char *filepath) {
549549 return walkPath (filepath, root, callback_makeDirPath);
550550}
551551
552- boolean SDClass::rmdir (char *filepath) {
552+ boolean SDClass::rmdir (const char *filepath) {
553553 /*
554554
555555 Remove a single directory or a heirarchy of directories.
@@ -560,7 +560,7 @@ boolean SDClass::rmdir(char *filepath) {
560560 return walkPath (filepath, root, callback_rmdir);
561561}
562562
563- boolean SDClass::remove (char *filepath) {
563+ boolean SDClass::remove (const char *filepath) {
564564 return walkPath (filepath, root, callback_remove);
565565}
566566
0 commit comments