summaryrefslogtreecommitdiffstats
path: root/core/io/file_access_compressed.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Reduce code duplication in FileAccessBlueCube33102024-09-011-35/+4
|
* [FileAccess] Add methods to get/set "hidden" and "read-only" attributes on ↵bruvzg2023-08-081-2/+30
| | | | macOS/BSD and Windows.
* Merge pull request #72288 from MewPurPur/use-string-repeatClay John2023-05-051-7/+1
|\ | | | | Use `String.repeat()` to optimize several String methods
| * Use String.repeat() in more placesVolTer2023-05-011-7/+1
| |
* | Restore FileAccess.close method.bruvzg2023-02-161-0/+4
|/
* Merge pull request #70726 from heppocogne/Fix-open_compressed-get_pathRémi Verschelde2023-01-101-0/+16
|\ | | | | | | Fix `get_path()` is not working when files are opend with `open_compressed`
| * Fix `get_path()` is not working when files are opend with `open_compressed`heppocogne2022-12-301-0/+16
| | | | | | | | And also fixed `get_absolute_path()` in the same way
* | One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
|/ | | | | | | | | | | | | | | | | | | | As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
* Replace File/Directory with FileAccess/DirAccesskobewi2022-09-191-1/+1
|
* Remove or make private `FileAccess` `close()` methods.bruvzg2022-04-121-8/+3
|
* Narrow FileAccess scope to prevent deadlocks.bruvzg2022-04-121-4/+4
|
* Make FileAccess and DirAccess classes reference counted.bruvzg2022-04-111-28/+23
|
* Fix decompression functions not returning errcodesRicardo Subtil2022-02-181-7/+11
|
* Merge pull request #53434 from Faless/io/4.x_file_access_compressedRémi Verschelde2022-01-061-2/+2
|\ | | | | [File] Fix FileAccessCompressed::get_buffer return value.
| * [File] Fix FileAccessCompressed::get_buffer return value.Fabio Alessandrelli2021-10-051-2/+2
| | | | | | | | | | It used to return the write index instead of the written bytes (i.e. index + 1) when reading until last block.
* | Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | | | | | Happy new year to the wonderful Godot community!
* | Fix some LGTM errors of "Multiplication result converted to larger type"Aaron Franke2021-10-121-1/+1
|/
* Rename File::get_len() get_length()Marcel Admiraal2021-05-251-1/+1
|
* Make all file access 64-bit (uint64_t)Pedro J. Estébanez2021-05-171-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the types of a big number of variables. General rules: - Using `uint64_t` in general. We also considered `int64_t` but eventually settled on keeping it unsigned, which is also closer to what one would expect with `size_t`/`off_t`. - We only keep `int64_t` for `seek_end` (takes a negative offset from the end) and for the `Variant` bindings, since `Variant::INT` is `int64_t`. This means we only need to guard against passing negative values in `core_bind.cpp`. - Using `uint32_t` integers for concepts not needing such a huge range, like pages, blocks, etc. In addition: - Improve usage of integer types in some related places; namely, `DirAccess`, core binds. Note: - On Windows, `_ftelli64` reports invalid values when using 32-bit MinGW with version < 8.0. This was an upstream bug fixed in 8.0. It breaks support for big files on 32-bit Windows builds made with that toolchain. We might add a workaround. Fixes #44363. Fixes godotengine/godot-proposals#400. Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
* Allow nullptr with zero length in FileAccess get_bufferAlex Hirsch2021-03-161-1/+1
| | | | fix #47071
* Add parameter checkes to FileAccess get_buffer functionsAlex Hirsch2021-03-091-2/+4
| | | | fix #46540
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* Quick fix to incorrect error messages when writing to compressed or ↵Andy Savage2020-12-151-2/+2
| | | | encrypted files.
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-1/+1
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-12/+21
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+4
| | | | | | | | | | | | | | | | | | | | | | | I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-31/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Port member initialization from constructor to declaration (C++11)Rémi Verschelde2020-05-141-19/+0
| | | | | | | | | | Using `clang-tidy`'s `modernize-use-default-member-init` check and manual review of the changes, and some extra manual changes that `clang-tidy` failed to do. Also went manually through all of `core` to find occurrences that `clang-tidy` couldn't handle, especially all initializations done in a constructor without using initializer lists.
* Replace NULL with nullptrlupoDharkael2020-04-021-8/+8
|
* Fixes crash when resource file is corruptedHaoyu Qiu2020-02-111-3/+5
|
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Added some obvious errors explanationsqarmin2019-09-251-13/+13
|
* Fixed EOF flag not resetting on seek backTGRCDev2019-08-051-1/+2
|
* Add FileAccess::set_unix_permissions for Unix platformsJuan Linietsky2019-04-071-0/+13
|
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Moved member variables to initializer listWilson E. Alvarez2018-12-111-18/+17
|
* Fix FileAccessCompressed::get_8 returning 0 for the last byte of a fileelasota2018-09-131-1/+0
|
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-1/+3
| | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
* Revert "added get_creation_time function for gdscript"Juan Linietsky2018-08-101-9/+0
|
* added get_creation_time function for gdscriptDaniele Giuliani2018-05-161-0/+9
|
* Add missing copyright headers and fix formattingRémi Verschelde2018-01-051-0/+1
| | | | | | Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
* Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Made Vector::ptrw explicit for writing, compiler was sometimes using the ↵Juan Linietsky2017-11-251-12/+12
| | | | | | wrong function, leading to unnecesary copy on writes and reduced performance.
* Extract logging logicRuslan Mustakov2017-09-251-0/+7
| | | | | | | | | | | | | | | | | | | Previously logging logic was scattered over OS class implementations with plenty of duplication. Major changes in this commit: - Extracted logging logic into a separate Logger hierarchy. It allows easy configuration of logging mechanism depending on compile-time or run-time configuration. - Implemented RotatedFileLogger which is usually used with StdLogger, providing persistency of logs. It is often important to be able to obtain logs of the game even in production to be able to understand what happened prior to some problem. On mobile there previously was no way to obtain the logs aside from having the device connected to your machine. - flush() is not performed in release mode for every logged line. It is only performed for errors.
* Rename pos to position in user facing methods and variablesletheed2017-09-201-2/+2
| | | | | | | | | | | Rename user facing methods and variables as well as the corresponding C++ methods according to the folloming changes: * pos -> position * rot -> rotation * loc -> location C++ variables are left as is.
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|
* Removed unnecessary assignmentsWilson E. Alvarez2017-08-211-1/+0
|
* Add closest_power_of_2 func and implement mix_rate/latency on OS XMarcelo Fernandez2017-08-171-10/+10
|
* Add zstd compression support.Ferenc Arn2017-06-081-1/+1
| | | | | zstd has much better compression speed and ratio, and better decompression speed than currently available methods. Also set zstd as the default compression method for Compression as well as FileAccessCompressed functions.
* Add "Godot Engine contributors" copyright lineRémi Verschelde2017-04-081-0/+1
|