Commit Graph

96 Commits

Author SHA1 Message Date
Sasha Szpakowski e94b8c3d04 love.filesystem canonicalizes internal full paths where possible.
resolves #1693.
resolves #1100.
2024-08-03 19:33:55 -03:00
Sasha Szpakowski 2bdadf51d4 Merge branch 'main' into SDL3 2024-03-24 18:53:08 -03:00
Sasha Szpakowski 64a30f177f Merge branch 'main' into 12.0-development 2024-02-10 12:24:48 -04:00
Sasha Szpakowski 94d5864144 update year for copyright notice 2024-02-10 12:13:22 -04:00
Sasha Szpakowski 62ac858f30 Initial source code support for SDL3. No build system support. 2024-02-04 17:02:26 -04:00
Sasha Szpakowski f6cdbdc868 Merge branch 'main' into 12.0-development 2022-12-31 22:46:34 -04:00
Sasha Szpakowski 0b75f6cfa5 Missed some files... 2022-12-31 22:36:48 -04:00
Miku AuahDark b738668e9c Only show deprecation notice of using slash in require if the file is found. 2022-11-22 11:58:30 +08:00
slime 79c879a6b1 Fix love.filesystem.newFileData crashing when an invalid filename is used. 2022-10-25 17:08:10 -03:00
Miku AuahDark c35ceeb223 Add optional load mode parameter to love.filesystem.load. 2022-09-24 14:29:28 +08:00
Alex Szpakowski 07f087c139 Fix newFileData and newThread outputting deprecation warnings.
Fixes #1811.
2022-06-09 19:57:31 -03:00
Alex Szpakowski 4e051c6faa Re-add love.filesystem.exists.
It's still useful sometimes because it's a bit cheaper than getInfo.
2022-04-22 21:11:39 -03:00
Alex Szpakowski b8ff64e9e3 Add love.filesystem.openFile. Deprecate love.filesystem.newFile. 2022-04-22 21:05:20 -03:00
Alex Szpakowski d5865e160c File objects inherit from Stream. 2022-04-21 19:53:27 -03:00
Miku AuahDark 00e4ec1e04 Show deprecation notice when slashes is passed to require.
Closes #1773
2022-03-02 08:01:59 +08:00
Alex Szpakowski 7f3538d2ba Merge branch 'main' into 12.0-development 2022-01-05 21:10:27 -04:00
Alex Szpakowski c8038f22df Merge branch 'main' into 12.0-development 2021-12-24 11:35:35 -04:00
megagrump b359311832 accept Data objects in newFileData 2021-12-13 09:20:17 +01:00
Miku AuahDark b79b99bbaa Use specialized logic when loading C modules in Android. 2021-11-02 17:54:13 +08:00
Alex Szpakowski 9b4aea8f17 Missed some copyright date updates 2021-04-07 20:34:24 -03:00
Alex Szpakowski f151190548 filesystem restructure work.
Add mount/unmountCommonPath, mount/unmountFullPath, getFullCommonPath.

Reimplement identity and save directory code in terms of new commonpath code.

Add internal createRealDirectory function (not exposed, currently).
2021-01-01 16:29:40 -04:00
Alex Szpakowski f61a650a87 Add 'readonly' field to love.filesystem.getInfo's returned table 2020-12-31 00:06:41 -04:00
Alex Szpakowski 0706b6243c Add love.filesystem.mountFullPath. 2020-10-03 19:28:57 -03:00
Alex Szpakowski 5f9b5a21d0 Merge default into minor
--HG--
branch : minor
2020-01-03 22:45:36 -04:00
Alex Szpakowski fc4847c69d Update copyright for the new year 2020-01-03 22:40:36 -04:00
Alex Szpakowski bc12312f0f macOS: rename most internal uses of "macosx" to "macos".
--HG--
branch : minor
2019-12-22 17:54:20 -04:00
Alex Szpakowski 23db4f4a59 Remove functions that were deprecated in LÖVE 11.
--HG--
branch : minor
2019-12-20 00:45:20 -04:00
Alex Szpakowski 2a7e39d58b Rename DroppedFile to NativeFile.
--HG--
branch : minor
2019-12-20 00:32:56 -04:00
Alex Szpakowski d9ec1d8aa4 Clean up some hacky love.filesystem code.
--HG--
branch : minor
2019-12-19 17:47:46 -04:00
Bart van Strien cb625d890a Make sure luax_getfile always returns a retained value
Before it would return a retained value if it returned a freshly constructed file, and an unretained value otherwise.
Also update all (3) call sites, to correctly retain or release as needed.
2019-08-11 11:13:22 +02:00
Alex Szpakowski 639bdb10e9 Fix love.filesystem.mount(data). Resolves issue #1506. 2019-08-02 21:06:07 -03:00
Alex Szpakowski 528c1e2390 love.filesystem's loaders in the package.loaders table error instead of crashing when no argument is given to them (resolves issue #1504). 2019-08-02 21:04:22 -03:00
Alex Szpakowski 459d31db7e Fix the Data-returning variant of love.filesystem.read/File:read to return the size that was read. Now it's consistent with the string-returning variant. 2019-07-31 19:24:17 -03:00
Alex Szpakowski 0752f27bdf Update copyright year for 2019 2019-01-03 21:09:05 -04:00
Alex Szpakowski 0cefb12c13 Add a variant of love.filesystem.getInfo which filters based on file type. getInfo(filename, "directory") will only return info for non-symlinked directories, for example. 2018-03-24 14:43:56 -03:00
Bart van Strien e80247c191 Happy new year! 2018-01-03 19:47:35 +01:00
Alex Szpakowski 0b7cb4a353 Add variants of File:read and love.filesystem.read which take an enum to determine whether they return a FileData or string. 2017-12-22 16:32:54 -04:00
Alex Szpakowski 640e8f0d2e love.filesystem.mount can accept a Data object containing zipped data.
- Add mount(Data, archivename, mountpoint [, appendtopath]). 'archivename' must be a string that has not been used with mount before.
- Add mount(FileData, mountpoint [, appendtopath]). The file path of the FileData is used as the archive name.
- Add unmount(Data).
- unmount(archivename) also works.
2017-12-16 23:09:15 -04:00
Bart van Strien 19ddc27069 Use a seekless implementation of File:lines/love.filesystem.lines
The previous algorithm would seek every time. This meant that although reading
from a filesystem would be quick (especially with disk caching), but reading
from a zip would be extremely slow.

The new version is rouhgly as fast on a filesystem, but appears not to slow
down on zips at all. Not in my tests, at least.

--HG--
branch : minor
2017-11-11 21:42:52 +01:00
Bart van Strien 9e4374935d Show (short) list of possible enum values when an invalid value is encountered (resolves #1318)
All enum errors have (hopefully) been changed to a luax_enumerror, which has a
fixed error message. If additionally a list of valid options is passed, it
lists that in the error message. For every enum error with few options I've
implemented this using a getConstants call.

This solution has been designed specifically to reduce the number of template
instantiations (as I've been told that was a concern). All new template code
happens in places where there already was an instantiation of the relevant
StringMap. Of course there is still std::vector<std::string>...

--HG--
branch : minor
2017-10-02 17:11:53 +02:00
Alex Szpakowski bdc6eb3b29 Fix copy/paste error in the love.filesystem.isDirectory deprecation message.
--HG--
branch : minor
2017-09-25 15:52:49 +00:00
Alex Szpakowski 90e86c329d Add love.data module.
- Moved love.math.compress / decompress / decode / encode / hash to love.data.
- Changed love.data.compress/decompress to take the format argument first instead of second.
- Added love.data.newDataView. Returns a read-only subsection of an existing Data object.
- Added love.data.newByteData. Mostly useful in combination with LuaJIT's FFI as it has no extra methods currently.
- Added implementations of Lua 5.3's data packing APIs: love.data.packString / packData / unpack / getPackedSize.

Resolves issue #1336.
Resolves issue #1331.

--HG--
branch : minor
2017-09-24 19:25:27 -03:00
Alex Szpakowski 4ee85e1793 love get* APIs which return tables with fields can optionally accept a table argument to fill in, instead of creating a new table.
--HG--
branch : minor
2017-09-22 19:47:55 -03:00
Alex Szpakowski 23c9edcc52 Hopefully fix the build
--HG--
branch : minor
2017-08-27 18:17:30 -03:00
Alex Szpakowski 9d0e984c3d Add love.filesystem.getInfo. Deprecate love.filesystem.exists/isDirectory/isFile/isSymlink/getLastModified/getSize. Resolves issue #641.
--HG--
branch : minor
2017-08-27 18:14:54 -03:00
Alex Szpakowski fee157b6b9 Functions that take a boolean argument now properly type-check for it.
--HG--
branch : minor
2017-08-14 22:56:20 -03:00
Alex Szpakowski 2dd6408d00 Images/[Compressed]ImageData can be created using any Data, instead of just files or FileData.
--HG--
branch : minor
2017-08-05 23:55:20 -03:00
Alex Szpakowski 17cf7bba83 Cleaned up love.graphics.newShader's wrapper code a bit.
--HG--
branch : minor
2017-07-29 23:09:45 -03:00
Alex Szpakowski 5ef6730497 Added a variant of love.graphics.captureScreenshot which takes a single filename parameter. Resolves issue #1293.
--HG--
branch : minor
2017-07-29 12:54:53 -03:00
Alex Szpakowski 94ce558126 require now looks for both .dylib and .so extensions for C dynamic libraries in macOS, instead of just .so.
It also now replaces all occurrences of '??' and '?' in the path with the module filename and module name respectively, rather than just the first occurrence.

--HG--
branch : minor
2017-07-27 19:54:56 -03:00