Skip to content

Commit c0877ec

Browse files
fixed javadoc comments according to specs
1 parent 9a8ef51 commit c0877ec

File tree

5 files changed

+102
-100
lines changed

5 files changed

+102
-100
lines changed

Diff for: src/Folder.cpp

+1-12
Original file line numberDiff line numberDiff line change
@@ -264,18 +264,7 @@ bool Folder::moveTo(Folder destination, bool overwrite) {
264264
bool Folder::moveTo(const char* destination, bool overwrite) {
265265
std::string newPath = replaceFirstPathComponent(this->path.c_str(), destination);
266266

267-
/*
268-
DIR* dir = opendir(newPath.c_str());
269-
if (dir != nullptr) {
270-
if(!overwrite){
271-
errno = EEXIST;
272-
return false;
273-
} else {
274-
closedir(dir);
275-
Folder(newPath.c_str()).remove();
276-
}
277-
}
278-
*/
267+
279268

280269
if (!this->copyTo(destination, overwrite)) {
281270
return false; // Return false if the copy operation fails

Diff for: src/Folder.h

+21-21
Original file line numberDiff line numberDiff line change
@@ -14,144 +14,144 @@ class UFile;
1414
class Folder {
1515

1616
public:
17-
/*
17+
/**
1818
* @brief Blank Constructor.
1919
*/
2020
Folder();
2121

22-
/*
22+
/**
2323
* @brief Constructor.
2424
* @param const char * dirname - The name of the directory.
2525
*/
2626
Folder(const char * dirname);
2727

28-
/*
28+
/**
2929
* @brief Constructor.
3030
* @param String dirname - The name of the directory.
3131
*/
3232
Folder(String dirname);
3333

34-
/*
34+
/**
3535
* @brief Creates a file inside the directory.
3636
* @param const char * fileName - The name of the file to create.
3737
* @return A File object if successfull, NULL if not.
3838
*/
3939
UFile createFile(const char * fileName, FileMode fmode);
4040

41-
/*
41+
/**
4242
* @brief Creates a file inside the directory.
4343
* @param String fileName - The name of the file to create.
4444
* @return A File object if successfull, NULL if not.
4545
*/
4646
UFile createFile(String fileName, FileMode fmode);
4747

48-
/*
48+
/**
4949
* @brief Removes a directory.
5050
* @param dirname The name of the directory to remove.
5151
* @return True if the directory was removed successfully, false otherwise.
5252
*/
5353
bool remove();
5454

55-
/*
55+
/**
5656
* @brief Renames a directory.
5757
* @param const char * newDirname The new name of the directory.
5858
* @return True if the directory was renamed successfully, false otherwise.
5959
*/
6060
bool rename(const char * newDirname);
6161

62-
/*
62+
/**
6363
* @brief Renames a directory.
6464
* @param String newDirname The new name of the directory.
6565
* @return True if the directory was renamed successfully, false otherwise.
6666
*/
6767
bool rename(String newDirname);
6868

69-
/*
69+
/**
7070
* @brief Checks if the directory exists.
7171
* @return True if the directory exists, false otherwise.
7272
*/
7373
bool exists();
7474

75-
/*
75+
/**
7676
* @brief Returns the path of the file.
7777
* @return The path of the file as a const char *
7878
*/
7979
const char * getPath();
8080

81-
/*
81+
/**
8282
* @brief Returns the path of the file.
8383
* @return The path of the file as an Arduino String
8484
*/
8585
String getPathString();
8686

87-
/*
87+
/**
8888
* @brief Creates a subfolder in the directory.
8989
* @param const char * subfolderName - he name of the subfolder to create.
9090
* @param overwrite - behaviour in case the folder already exists, default is false
9191
* @return The created subfolder.
9292
*/
9393
Folder createSubfolder(const char * subfolderName, bool overwrite = false);
9494

95-
/*
95+
/**
9696
* @brief Creates a subfolder in the directory.
9797
* @param String subfolderName - he name of the subfolder to create.
9898
* @param overwrite - behaviour in case the folder already exists, default is false
9999
* @return The created subfolder.
100100
*/
101101
Folder createSubfolder(String subfolderName, bool overwrite = false);
102102

103-
/*
103+
/**
104104
* @brief Returns File objects for all files in the current dirctory.
105105
* @return A std::vector of File objects representing the files in the directory.
106106
*/
107107
std::vector<UFile> getFiles();
108108

109-
/*
109+
/**
110110
* @brief Returns Folder objects for all files in the current dirctory.
111111
* @return A std::vector of Folder objects representing the files in the directory.
112112
*/
113113
std::vector<Folder> getFolders();
114114

115-
/*
115+
/**
116116
* @brief Copies the current directory
117117
* @param Folder destination - a Folder object representing the destination
118118
* @return True upon success, false otherwise.
119119
*/
120120
bool copyTo(Folder destination, bool overwrite = false);
121121

122-
/*
122+
/**
123123
* @brief Copies the current directory
124124
* @param const char * destination - the path of the destination location
125125
* @param overwrite - behaviour in case the folder already exists, default is false
126126
* @return True upon success, false otherwise.
127127
*/
128128
bool copyTo(const char * destination, bool overwrite = false);
129129

130-
/*
130+
/**
131131
* @brief Copies the current directory
132132
* @param String destination - the path of the destination location
133133
* @param overwrite - behaviour in case the folder already exists, default is false
134134
* @return True upon success, false otherwise.
135135
*/
136136
bool copyTo(String destination, bool overwrite = false);
137137

138-
/*
138+
/**
139139
* @brief Moves the current directory
140140
* @param Folder destination - a Folder object representing the destination
141141
* @param overwrite - behaviour in case the folder already exists, default is false
142142
* @return True upon success, false otherwise.
143143
*/
144144
bool moveTo(Folder destination, bool overwrite = false);
145145

146-
/*
146+
/**
147147
* @brief Moves the current directory
148148
* @param const char * destination - the path of the destination location
149149
* @param overwrite - behaviour in case the folder already exists, default is false
150150
* @return True upon success, false otherwise.
151151
*/
152152
bool moveTo(const char * destination, bool overwrite = false);
153153

154-
/*
154+
/**
155155
* @brief Move the current directory
156156
* @param String destination - the path of the destination location
157157
* @param overwrite - behaviour in case the folder already exists, default is false

Diff for: src/InternalStorage.h

+11-11
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class InternalStorage : public Arduino_UnifiedStorage {
1010
public:
1111
/**
1212
* Default constructor for the InternalStorage class.
13-
*/
13+
*/
1414
InternalStorage();
1515

1616
/**
@@ -19,71 +19,71 @@ class InternalStorage : public Arduino_UnifiedStorage {
1919
* @param partition The partition number.
2020
* @param name The name of the partition.
2121
* @param fs The desired file system (FS_FAT or FS_LITTLEFS).
22-
*/
22+
*/
2323
InternalStorage(int partition, const char *name, FileSystems fs);
2424

2525
/**
2626
* Initializes the internal storage.
2727
*
2828
* @return 1 if successful, 0 if failed.
29-
*/
29+
*/
3030
int begin() override;
3131

3232
/**
3333
* Initializes the internal storage with the specified file system.
3434
*
3535
* @param fs The desired file system (FS_FAT or FS_LITTLEFS).
3636
* @return 1 if successful, 0 if failed.
37-
*/
37+
*/
3838
int begin(FileSystems fs) override;
3939

4040
/**
4141
* Unmounts the internal storage.
4242
*
4343
* @return 1 if successful, 0 if failed.
44-
*/
44+
*/
4545
int unmount() override;
4646

4747
/**
4848
* Retrieves the root folder of the internal storage.
4949
*
5050
* @return The root folder as a Folder object.
51-
*/
51+
*/
5252
Folder getRootFolder() override;
5353

5454
/**
5555
* Sets the QSPI partition number.
5656
*
5757
* @param partition The partition number.
58-
*/
58+
*/
5959
void setQSPIPartition(int partition);
6060

6161
/**
6262
* Sets the QSPI partition name.
6363
*
6464
* @param name The name of the partition.
65-
*/
65+
*/
6666
void setQSPIPartitionName(const char *name);
6767

6868
/**
6969
* Formats the internal storage with the FAT file system.
7070
*
7171
* @return 1 if successful, 0 if failed.
72-
*/
72+
*/
7373
int formatFAT();
7474

7575
/**
7676
* Formats the internal storage with the LittleFS file system.
7777
*
7878
* @return 1 if successful, 0 if failed.
79-
*/
79+
*/
8080
int formatLittleFS();
8181

8282
/**
8383
* Retrieves the block device associated with the internal storage.
8484
*
8585
* @return The block device as a BlockDevice object.
86-
*/
86+
*/
8787
#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_OPTA)
8888
mbed::BlockDevice *getBlockDevice();
8989
#endif

Diff for: src/SDStorage.h

+10-11
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,37 @@
1313
class SDStorage: public Arduino_UnifiedStorage {
1414
public:
1515
/**
16-
* Default constructor for the SDStorage class.
17-
*/
16+
* Default constructor for the SDStorage class.
17+
*/
1818
SDStorage();
1919

2020
/**
21-
* Initializes the SD card storage.
22-
*
23-
* @return 1 if successful, 0 if failed.
24-
*/
21+
* Initializes the SD card storage.
22+
*
23+
* @return 1 if successful, 0 if failed.
24+
*/
2525
int begin() override ;
2626

2727
/**
2828
* Initializes the SD card storage with the specified file system.
2929
*
3030
* @param fs The desired file system (FS_FAT or FS_LITTLEFS).
3131
* @return 1 if successful, 0 if failed.
32-
*/
32+
*/
3333
int begin(FileSystems fs) override;
3434

3535
/**
3636
* Unmounts the SD card storage.
3737
*
3838
* @return 1 if successful, 0 if failed.
39-
*/
39+
*/
4040
int unmount() override;
4141

4242
/**
4343
* Retrieves the root folder of the SD card storage.
4444
*
4545
* @return The root folder as a Folder object.
46-
*/
46+
*/
4747
Folder getRootFolder() override;
4848

4949
/**
@@ -57,8 +57,7 @@ class SDStorage: public Arduino_UnifiedStorage {
5757
* Formats the SD card storage with the LittleFS file system.
5858
*
5959
* @return 1 if successful, 0 if failed.
60-
*/
61-
60+
*/
6261
int formatLittleFS() override;
6362
private:
6463
FileSystems fs = FS_FAT;

0 commit comments

Comments
 (0)