Commit Graph

27 Commits

Author SHA1 Message Date
Jared Boone
86f672af2b File: Add misc useful API from C++17. 2016-10-01 10:44:11 -07:00
Jared Boone
b87d1456a2 File: Make path a first-class object, add some methods from C++17. 2016-09-08 12:57:34 -07:00
Jared Boone
f80706cb34 File: Extract function to convert path to string. 2016-09-07 22:20:51 -07:00
Jared Boone
79330015ed File: Clean up directory_iterator construction, preserve pattern.
FatFs requires pattern pointer to be stable during search.
2016-09-07 20:46:45 -07:00
Jared Boone
ed791ac5bd File: Widen size/offset types for 64-bit filesystems. 2016-08-21 22:15:19 -07:00
Jared Boone
f7bfde73b6 FatFs: Enable long file name support.
Lots of re-plumbing to make this work, including a bunch of Unicode stuff now in the binary. Bloat City, I'm sure.

TODO: FatFs using unsigned (uint16_t) for UTF16 representation is kinda inconvenient. Lots of reinterpret_cast<>().
2016-08-21 18:06:39 -07:00
Jared Boone
ffa797b926 File: Remove puts(), add write_line(), cascade changes in interface. 2016-07-24 20:39:21 -07:00
Jared Boone
931853a55f Make File::Result::value() const. 2016-07-24 19:12:09 -07:00
Jared Boone
c990963298 Expose filesystem_error code. 2016-06-21 10:54:13 -07:00
Jared Boone
682a1706a3 Improve File error handling. Massive effects...
API is somewhat stolen from Rust std::fs::File. Static factories didn't work out so well, though. Move semantics made my head explode.
TODO: Still a lot of places where errors aren't handled, but it's an improvement...
2016-05-16 14:01:44 -07:00
Jared Boone
8655b6d915 Adapt filesystem_error to new File error handling, expose on File. 2016-05-12 21:55:39 -07:00
Jared Boone
b21758781c Preserve File error state once error occurs. 2016-05-12 21:54:13 -07:00
Jared Boone
0f1ae96ba4 Move File definition below std::filesystem. 2016-05-12 21:44:37 -07:00
Jared Boone
4567db2fdb Add std::filesystem::filesystem_error object.
Not a standards-compliant implementation, but has the same vague shape, so should be easier to port later(?).
2016-05-12 18:19:28 -07:00
Jared Boone
f157c13442 Implement std::filesystem::space(). 2016-05-11 10:58:57 -07:00
Jared Boone
80f94cbc29 Add File seek support. 2016-05-01 11:29:44 -07:00
Jared Boone
0d6103916d Converge File object with std::fstream. Simplify LogFile.
LogFile no longer watches SD card presence and tries to open/close files dynamically.
2016-04-30 15:09:34 -07:00
Jared Boone
12b8a1b2a9 Change next-file naming functions to work on filename stems.
This paves the way for writing metadata files with similar prefixes, and avoids confusing numbering of capture files with different extensions (e.g. BAD_0000.S16 and BBD_0000.S8).
2016-04-29 11:27:12 -07:00
Jared Boone
f49d04fe7a Functions to select next filename based on matching pattern.
Used for capture, audio, screenshot file naming.
2016-04-20 09:57:17 -07:00
Jared Boone
7492984144 Add filesystem directory enumeration.
Borrow API from std::filesystem -- Boost and C++17.
2016-04-20 09:56:35 -07:00
Jared Boone
0a9d7ec8d8 Add File::open_for_reading().
Barf.
2016-04-10 15:56:34 -07:00
Jared Boone
38ba02a68f Change File::open to File::open_for_writing.
Not thrilled about the File API right now...
2016-04-10 15:55:01 -07:00
Jared Boone
7cf55cef52 Add File::write() that takes std::array. 2016-02-18 21:34:03 -08:00
Jared Boone
083711ceb2 Add File::open(), use inside File::open_for_append(). 2016-02-18 21:33:38 -08:00
Jared Boone
cd56847326 Remove some unused member variables. 2016-02-06 16:23:38 -08:00
Jared Boone
3172fb1ad6 Make assorted arguments pass-by-reference. 2016-02-06 16:23:20 -08:00
Jared Boone
fc7a7d753d Extract general File class from LogFile. 2016-01-17 14:20:02 -08:00