File tree 2 files changed +15
-0
lines changed
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) {
51
51
return open (filename.c_str (), mode);
52
52
}
53
53
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
+
54
63
void UFile::close () {
55
64
// Close the file
56
65
if (filePointer != nullptr ) {
Original file line number Diff line number Diff line change @@ -52,6 +52,12 @@ class UFile{
52
52
*/
53
53
bool open (String filename, FileMode mode);
54
54
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);
55
61
56
62
/* *
57
63
* @brief Closes the file and releases any allocated resources.
You can’t perform that action at this time.
0 commit comments