Commit graph

11 commits

Author SHA1 Message Date
kleines Filmröllchen
d6571f54d8 LibCore: Make MappedFile a Stream
The internal reuse of FixedMemoryStream makes this straightforward.
There alread is one user of the new API, demonstrating the need for this
change beyond what I said out to use it for :^)
2023-09-27 03:22:56 +02:00
kleines Filmröllchen
062e0db46c LibCore: Make MappedFile OwnPtr-based
Since it will become a stream in a little bit, it should behave like all
non-trivial stream classes, who are not primarily intended to have
shared ownership to make closing behavior more predictable. Across all
uses of MappedFile, there is only one use case of shared mapped files in
LibVideo, which now uses the thin SharedMappedFile wrapper.
2023-09-27 03:22:56 +02:00
Ben Wiederhake
560133a0c6 Everywhere: Remove unused DeprecatedString includes 2023-04-09 22:00:54 +02:00
Lucas CHOLLET
5b6e93f96a LibCore: Add MappedFile::map_from_file()
This method relies on `map_from_fd_and_close()` but takes a `File`
instead of a fd.
2023-02-16 10:56:01 +00:00
Linus Groh
6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00
Ali Mohammad Pur
2110e7cf85 Everywhere: Add support for compilation under emscripten
Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
2022-11-26 02:23:15 +03:30
Hediadyoin1
69aece9279 LibCore+LibGfx: Pass file-path as StringView 2022-06-14 23:00:52 +02:00
Andreas Kling
0ed5f84bd9 LibCore: Use open() wrapper in Core::MappedFile :^) 2021-11-23 12:23:54 +01:00
Andreas Kling
094fa900a3 LibCore: Use mmap() and munmap() wrappers in Core::MappedFile 2021-11-23 11:51:46 +01:00
Andreas Kling
a62d16fbe9 LibCore: Use syscall wrappers in MappedFile::map_from_fd_and_close() 2021-11-23 11:36:00 +01:00
Andreas Kling
58fb3ebf66 LibCore+AK: Move MappedFile from AK to LibCore
MappedFile is strictly a userspace thing, so it doesn't belong in AK
(which is supposed to be user/kernel agnostic.)
2021-11-23 11:33:36 +01:00
Renamed from AK/MappedFile.cpp (Browse further)