@@ -58,7 +58,7 @@ namespace SDLib {
58
58
#define MAX_COMPONENT_LEN 12 // What is max length?
59
59
#define PATH_COMPONENT_BUFFER_LEN MAX_COMPONENT_LEN+1
60
60
61
- bool getNextPathComponent (char *path, unsigned int *p_offset,
61
+ bool getNextPathComponent (const char *path, unsigned int *p_offset,
62
62
char *buffer) {
63
63
/*
64
64
@@ -117,9 +117,9 @@ bool getNextPathComponent(char *path, unsigned int *p_offset,
117
117
118
118
119
119
120
- boolean walkPath (char *filepath, SdFile& parentDir,
120
+ boolean walkPath (const char *filepath, SdFile& parentDir,
121
121
boolean (*callback)(SdFile& parentDir,
122
- char *filePathComponent,
122
+ const char *filePathComponent,
123
123
boolean isLastComponent,
124
124
void *object),
125
125
void *object = NULL) {
@@ -232,7 +232,7 @@ boolean walkPath(char *filepath, SdFile& parentDir,
232
232
233
233
*/
234
234
235
- boolean callback_pathExists (SdFile& parentDir, char *filePathComponent,
235
+ boolean callback_pathExists (SdFile& parentDir, const char *filePathComponent,
236
236
boolean isLastComponent, void *object) {
237
237
/*
238
238
@@ -255,7 +255,7 @@ boolean callback_pathExists(SdFile& parentDir, char *filePathComponent,
255
255
256
256
257
257
258
- boolean callback_makeDirPath (SdFile& parentDir, char *filePathComponent,
258
+ boolean callback_makeDirPath (SdFile& parentDir, const char *filePathComponent,
259
259
boolean isLastComponent, void *object) {
260
260
/*
261
261
@@ -310,15 +310,15 @@ boolean callback_openPath(SdFile& parentDir, char *filePathComponent,
310
310
311
311
312
312
313
- boolean callback_remove (SdFile& parentDir, char *filePathComponent,
313
+ boolean callback_remove (SdFile& parentDir, const char *filePathComponent,
314
314
boolean isLastComponent, void *object) {
315
315
if (isLastComponent) {
316
316
return SdFile::remove (parentDir, filePathComponent);
317
317
}
318
318
return true ;
319
319
}
320
320
321
- boolean callback_rmdir (SdFile& parentDir, char *filePathComponent,
321
+ boolean callback_rmdir (SdFile& parentDir, const char *filePathComponent,
322
322
boolean isLastComponent, void *object) {
323
323
if (isLastComponent) {
324
324
SdFile f;
@@ -517,7 +517,7 @@ File SDClass::open(char *filepath, uint8_t mode) {
517
517
// }
518
518
519
519
520
- boolean SDClass::exists (char *filepath) {
520
+ boolean SDClass::exists (const char *filepath) {
521
521
/*
522
522
523
523
Returns true if the supplied file path exists.
@@ -538,7 +538,7 @@ boolean SDClass::exists(char *filepath) {
538
538
// }
539
539
540
540
541
- boolean SDClass::mkdir (char *filepath) {
541
+ boolean SDClass::mkdir (const char *filepath) {
542
542
/*
543
543
544
544
Makes a single directory or a heirarchy of directories.
@@ -549,7 +549,7 @@ boolean SDClass::mkdir(char *filepath) {
549
549
return walkPath (filepath, root, callback_makeDirPath);
550
550
}
551
551
552
- boolean SDClass::rmdir (char *filepath) {
552
+ boolean SDClass::rmdir (const char *filepath) {
553
553
/*
554
554
555
555
Remove a single directory or a heirarchy of directories.
@@ -560,7 +560,7 @@ boolean SDClass::rmdir(char *filepath) {
560
560
return walkPath (filepath, root, callback_rmdir);
561
561
}
562
562
563
- boolean SDClass::remove (char *filepath) {
563
+ boolean SDClass::remove (const char *filepath) {
564
564
return walkPath (filepath, root, callback_remove);
565
565
}
566
566
0 commit comments