File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,15 @@ bool UFile::open(String filename, FileMode mode) {
5151 return open (filename.c_str (), mode);
5252}
5353
54+ bool UFile::open (FileMode mode) {
55+ if (path.empty ()) {
56+ // Path is not set
57+ return false ;
58+ }
59+
60+ return open (path.c_str (), mode);
61+ }
62+
5463void UFile::close () {
5564 // Close the file
5665 if (filePointer != nullptr ) {
Original file line number Diff line number Diff line change @@ -52,6 +52,12 @@ class UFile{
5252 */
5353 bool open (String filename, FileMode mode);
5454
55+ /* *
56+ * @brief Opens a file that was already initialized with a path.
57+ * @param mode The file mode (READ, WRITE, or APPEND). The default is READ.
58+ * @return True if the file was opened successfully, false otherwise.
59+ */
60+ bool open (FileMode mode = FileMode::READ);
5561
5662 /* *
5763 * @brief Closes the file and releases any allocated resources.
You can’t perform that action at this time.
0 commit comments