Skip to content

Commit 7d02fec

Browse files
committed
Rename getPathString to getPathAsString
1 parent 34d3bcc commit 7d02fec

File tree

9 files changed

+28
-28
lines changed

9 files changed

+28
-28
lines changed

examples/BackupInternalPartitions/BackupInternalPartitions.ino

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ USBStorage thumbDrive = USBStorage();
3838

3939

4040
void addSomeFakeFiles(Folder * folder){
41-
Serial.println("* adding some fake files to: " + String(folder -> getPathString()));
41+
Serial.println("* adding some fake files to: " + String(folder -> getPathAsString()));
4242

4343
for (int i = 0; i < random(0, 9); i++){
4444
UFile thisFile = folder -> createFile("File_"+ String(random(999)), FileMode::WRITE);
45-
Serial.println("\t * " + thisFile.getPathString());
45+
Serial.println("\t * " + thisFile.getPathAsString());
4646
thisFile.write("writing stuff to the file");
4747
thisFile.close();
4848
}
@@ -51,20 +51,20 @@ void addSomeFakeFiles(Folder * folder){
5151
Folder subfolder = folder -> createSubfolder("ChildFolder_"+ String(random(999)));
5252
for (int i = 0; i < random(0, 9); i++){
5353
UFile thisFile = subfolder.createFile("File_"+ String(random(999)), FileMode::WRITE);
54-
Serial.println("\t * " + thisFile.getPathString());
54+
Serial.println("\t * " + thisFile.getPathAsString());
5555
thisFile.write("writing stuff to the file");
5656
thisFile.close();
5757
}
5858
}
5959

6060
void move(Folder * source, Folder * dest){
6161
for(Folder f: source -> getFolders()){
62-
Serial.println("* copying folder :" + String(f.getPathString()));
62+
Serial.println("* copying folder :" + String(f.getPathAsString()));
6363
f.moveTo(*dest);
6464
}
6565

6666
for(UFile f: source -> getFiles()){
67-
Serial.println("* copying file :" + String(f.getPathString()));
67+
Serial.println("* copying file :" + String(f.getPathAsString()));
6868
f.moveTo(*dest);
6969
}
7070
}
@@ -73,7 +73,7 @@ void move(Folder * source, Folder * dest){
7373
#if defined(ARDUINO_PORTENTA_C33)
7474
void backupPartitionsC33(Folder * backupFolder){
7575

76-
Serial.println("* backup location: " + String(backupFolder -> getPathString()));
76+
Serial.println("* backup location: " + String(backupFolder -> getPathAsString()));
7777

7878
int otaMounted = ota.begin(FS_FAT);
7979
Serial.println("* ota partition mount: " + String(otaMounted));
@@ -108,7 +108,7 @@ void backupPartitionsC33(Folder * backupFolder){
108108

109109
#if defined(ARDUINO_PORTENTA_H7_M7)
110110
void backupPartitionsH7(Folder * backupFolder){
111-
Serial.println("* backup location: " + String(backupFolder -> getPathString()));
111+
Serial.println("* backup location: " + String(backupFolder -> getPathAsString()));
112112

113113
int wifiMounted = wifi.begin(FS_FAT);
114114
Serial.println("* wifi partition mount: " + String(wifiMounted));

extras/tests/TestExisting/TestExisting.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ void setup() {
1919

2020

2121
Folder root = internalStorage.getRootFolder();
22-
Serial.println(root.getPathString());
22+
Serial.println(root.getPathAsString());
2323

2424
// Test copyTo
2525
Serial.println("Testing copyTo...");
@@ -35,8 +35,8 @@ void setup() {
3535
Folder destinationFolder2 = root.createSubfolder("destination_folder");
3636
Serial.println("Folder 2 created");
3737

38-
Serial.println(sourceFolder2.getPathString());
39-
Serial.println(destinationFolder2.getPathString());
38+
Serial.println(sourceFolder2.getPathAsString());
39+
Serial.println(destinationFolder2.getPathAsString());
4040

4141
Serial.println();
4242
Serial.println();

extras/tests/TestFileOperations/TestFileOperations.ino

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ InternalStorage internal = InternalStorage();
2020

2121
bool testFileCreationWithOpen(Folder root) {
2222
UFile file = UFile();
23-
String path = root.getPathString() + "/test_open.txt";
23+
String path = root.getPathAsString() + "/test_open.txt";
2424
Serial.println(path);
2525
if (file.open(path, FileMode::WRITE)) {
2626
Serial.println("\n--- Test creating file using file.open ---");
@@ -104,7 +104,7 @@ bool testReadingAll(Folder root) {
104104
file.write(reinterpret_cast<const uint8_t*>("Hello, World!"), 13);
105105
file.close();
106106

107-
if (file.open(root.getPathString() + "/test_read.txt", FileMode::READ)) {
107+
if (file.open(root.getPathAsString() + "/test_read.txt", FileMode::READ)) {
108108
char buffer[file.available()];
109109
size_t bytesRead = file.read(reinterpret_cast<uint8_t*>(buffer), sizeof(buffer));
110110
buffer[bytesRead] = '\0'; // Null-terminate the string
@@ -136,7 +136,7 @@ bool testSeeking(Folder root) {
136136
file.close();
137137

138138

139-
if (file.open(root.getPathString() + "/test_seek.txt", FileMode::READ)) {
139+
if (file.open(root.getPathAsString() + "/test_seek.txt", FileMode::READ)) {
140140
Serial.println("\n--- Test seeking file ---");
141141
file.seek(7);
142142
char buffer[20];
@@ -163,7 +163,7 @@ bool testAvailableData(Folder root) {
163163
file.write(reinterpret_cast<const uint8_t*>("Hello, World!"), 13);
164164
file.close();
165165

166-
if (file.open(root.getPathString() + "/test_available.txt", FileMode::READ)) {
166+
if (file.open(root.getPathAsString() + "/test_available.txt", FileMode::READ)) {
167167
Serial.println("\n--- Test available data ---");
168168
int availableBytes = file.available();
169169
Serial.println("Available bytes in file (test_available.txt): " + String(availableBytes));
@@ -193,7 +193,7 @@ bool testCopyingFile(Folder root) {
193193

194194
if (destinationFolder.exists()) {
195195
Serial.println("\n--- Test copying a file ---");
196-
Serial.println("Source file name: " + String(sourceFile.getPathString()));
196+
Serial.println("Source file name: " + String(sourceFile.getPathAsString()));
197197

198198
if (sourceFile.copyTo(destinationFolder)) {
199199
Serial.println("File copied successfully!");
@@ -227,8 +227,8 @@ bool testMovingFile(Folder root) {
227227
UFile movedFile = sourceFileMove;
228228
if (movedFile.exists()) {
229229
Serial.println("\n--- Test moving a file ---");
230-
Serial.println("Source file name: " + String(sourceFileMove.getPathString()));
231-
Serial.println("Destination file name: " + String(destinationFolder.getPathString()) + "/test_source_move.txt");
230+
Serial.println("Source file name: " + String(sourceFileMove.getPathAsString()));
231+
Serial.println("Destination file name: " + String(destinationFolder.getPathAsString()) + "/test_source_move.txt");
232232
if (sourceFileMove.moveTo(destinationFolder)) {
233233
Serial.println("File moved successfully!");
234234
sourceFileMove.close();

extras/tests/TestFolderOperations/TestFolderOperations.ino

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ bool testFolderRenaming(Folder root) {
5858
Folder sourceFolder = root.createSubfolder("source_folder");
5959
if (sourceFolder.exists()) {
6060
Serial.println("\n--- Test renaming folder ---");
61-
Serial.println("Source folder name: " + String(sourceFolder.getPathString()));
61+
Serial.println("Source folder name: " + String(sourceFolder.getPathAsString()));
6262
if (sourceFolder.rename("renamed_folder")) {
63-
Serial.println("Folder renamed to: " + String(sourceFolder.getPathString()));
63+
Serial.println("Folder renamed to: " + String(sourceFolder.getPathAsString()));
6464
sourceFolder.remove();
6565
return true;
6666
} else {
@@ -79,8 +79,8 @@ bool testCopyingFolder(Folder root) {
7979

8080
if (sourceFolder.exists()) {
8181
Serial.println("\n--- Test copying a folder ---");
82-
Serial.println("Source folder name: " + String(sourceFolder.getPathString()));
83-
Serial.println("Destination folder name: " + String(copyDestination.getPathString()));
82+
Serial.println("Source folder name: " + String(sourceFolder.getPathAsString()));
83+
Serial.println("Destination folder name: " + String(copyDestination.getPathAsString()));
8484

8585

8686

@@ -108,8 +108,8 @@ bool testMovingFolder(Folder root) {
108108

109109
if (sourceFolderMove.exists()) {
110110
Serial.println("\n--- Test moving a folder ---");
111-
Serial.println("Source folder name: " + String(sourceFolderMove.getPathString()));
112-
Serial.println("Destination folder name: " + String(moveDestination.getPathString()));
111+
Serial.println("Source folder name: " + String(sourceFolderMove.getPathAsString()));
112+
Serial.println("Destination folder name: " + String(moveDestination.getPathAsString()));
113113
if (sourceFolderMove.moveTo(moveDestination)) {
114114
Serial.println("Folder moved successfully!");
115115
sourceFolderMove.remove();

keywords.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ copyTo KEYWORD2
4545
moveTo KEYWORD2
4646
getParentFolder KEYWORD2
4747
getPath KEYWORD2
48-
getPathString KEYWORD2
48+
getPathAsString KEYWORD2
4949

5050
isConnected KEYWORD2
5151
isAvailable KEYWORD2

src/Folder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ const char* Folder::getPath() {
100100
return this->path.c_str();
101101
}
102102

103-
String Folder::getPathString() {
103+
String Folder::getPathAsString() {
104104
return String(this->getPath());
105105
}
106106

src/Folder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class Folder {
8282
* @brief Returns the path of the file.
8383
* @return The path of the file as an Arduino String
8484
*/
85-
String getPathString();
85+
String getPathAsString();
8686

8787
/**
8888
* @brief Creates a subfolder in the directory.

src/UFile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,6 @@ const char* UFile::getPath() {
306306
return path.c_str();
307307
}
308308

309-
String UFile::getPathString() {
309+
String UFile::getPathAsString() {
310310
return String(path.c_str());
311311
}

src/UFile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class UFile{
179179
* @brief Returns the path of the directory.
180180
* @return The path of the file as a String
181181
*/
182-
String getPathString();
182+
String getPathAsString();
183183

184184

185185
/**

0 commit comments

Comments
 (0)