Commit Graph

231 Commits

Author SHA1 Message Date
Rosen Penev
d874fc4dd8 use __has_include
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-01-29 12:21:47 -08:00
Rosen Penev
376638259d namespace enforce.hpp functions to Internal
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-01-29 11:14:59 -08:00
Rosen Penev
77834807c2 add support for gcc and clang 7
Uses std::experimental::filesystem

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-01-29 09:29:46 -08:00
Rosen Penev
bb311ba728 clang-tidy on Windows
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-01-04 01:40:27 -08:00
Kevin Backhouse
335e13251e Add #error so the build fails if mmap isn't supported. 2022-10-31 03:01:26 -07:00
Kevin Backhouse
5cabd97373 Fix issue 2380: bug in (unused) non-mmap code. 2022-10-31 03:01:26 -07:00
Kevin Backhouse
c96bc47509 Change return type of getFileLength() to int64_t. 2022-10-31 02:59:34 -07:00
Rosen Penev
e151daa0fc fix compilation without mmap and non win32
buf was refactored not to be a pointer.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-08-08 23:23:31 -07:00
Rosen Penev
5c90684441 simplify some defines
As far as I can tell, _WIN32 is defined for true Windows platforms.
Cygwin is a POSIX platform.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-08-08 15:31:05 -07:00
Rosen Penev
f3b572d211 fix iconv handling and windows
WIN32 as a define is wrong. _WIN32 is the correct one.

Which opens up the issue of the used functions and the wrong logic.
Changed the function logic to use if and elif, as done later in the
code.

Also changed all usages of WIN32 with _WIN32

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-08-08 15:31:05 -07:00
Rosen Penev
306424f589 remove c_str for fs stuff
fs::path is convertable to a string.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-08-05 01:01:25 -07:00
Rosen Penev
b8855fb3b5 misc sonarlint cleanups
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-08-05 01:01:25 -07:00
Rosen Penev
5d2d47032b replace [0] with front() where applicable
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-07-27 11:29:57 -07:00
Kevin Backhouse
a5c521ea57
Merge pull request #2252 from neheb/2
clang-tidy: use default member init
2022-07-05 23:07:08 +01:00
Rosen Penev
bae7da19ca clang-tidy: use default member init
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-07-03 12:24:41 -07:00
Kevin Backhouse
ad4e13b827
Change return type of BasicIo::tell() to size_t. 2022-06-21 17:05:10 +01:00
Rosen Penev
0dcd8605c9 fix mmap compilation
CI doesn't catch all cases failing.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-29 10:49:14 +02:00
Rosen Penev
d789968e90 replace malloc/free with new/delete
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-10 01:40:39 -07:00
Rosen Penev
e9896d1f99 clang-tidy: fix inconsistent decleration
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-01 17:33:13 -07:00
Rosen Penev
9f67620503 clang-tidy: add more nodiscard
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-01 16:38:03 -07:00
Rosen Penev
fafe999c6e remove unused var from deleted stuff
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-31 08:47:37 +02:00
Luis Díaz Más
d7f35e33f0 Remove useless static_casts 2022-03-25 08:43:37 +01:00
Luis Díaz Más
b05573fadc Remove most of the asserts from codebase 2022-03-23 16:55:18 +01:00
Luis Díaz Más
30bf563f4d Update .clang-format file & apply clang-format to whole project 2022-03-16 22:30:53 +01:00
Luis Diaz
7576a2757b More size_t for sizes 2022-03-14 11:50:42 +01:00
Luis Díaz Más
96f7f2e4c5 Convert Exiv2::ErrorCode into an enum class 2022-03-12 16:58:40 +01:00
Luis Díaz Más
c115d4daf7
Merge pull request #2131 from Exiv2/mainCleanups
Include what you use + more SPDX identifiers + few other cleanups
2022-03-11 21:02:45 +01:00
Rosen Penev
8dadcdf72a manual nullptr removals
unique_ptr has a bool overload. It's also easier to reason about.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-09 17:12:29 -08:00
Rosen Penev
9f949195e4 clang-tidy: add ending namespace comment
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-07 14:38:05 -08:00
Luis Díaz Más
8b1fe379a1 Removing unused headers thanks to IWYU 2022-03-07 22:25:47 +01:00
Rosen Penev
f0d23eca9b clang-tidy: add some missing operators
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-06 01:17:12 -08:00
Rosen Penev
daf7c890e2 misc stuff
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-06 01:17:12 -08:00
Rosen Penev
5833101b9b manual nullptr conversions
Mostly not caught because I'm not running clang-tidy on Windows.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-05 16:21:25 -08:00
Rosen Penev
a25bbe133f constexpr string conversions
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-04 15:54:05 -08:00
Rosen Penev
04bacdedd6 clang-tidy: use auto
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-04 15:54:05 -08:00
Rosen Penev
f65848a590 simplify ReplaceStringInPlace slightly
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-04 15:54:05 -08:00
Rosen Penev
5d60a91ebc move initializations to class
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-04 15:54:05 -08:00
Rosen Penev
a67e0d525f move namespace fs below includes
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-04 15:54:05 -08:00
Luis Díaz Más
b17828b454
Use SPDX for licenses (#2122)
* Use SPDX identifier in header files

* Use SPDX identifier in rest of source files

* Fix usage of SPDX for files with 2 licenses

* Add global license file

* Fix compilation
2022-03-04 11:44:39 +01:00
Luis Díaz Más
b9f9d041ea Several transformations on DataBuf + migration to size_t
- Provide begin/end iterators to DataBuf and simplify code
- Adapt test output after last changes
- Replacing long by size_t in value.hpp
- Use size_t in some Photoshop functions
- Remove some static_casts
2022-02-27 09:41:47 +01:00
Luis Díaz Más
f1e04ee866 Replace DataBuf internal buffer with std::vector 2022-02-27 09:36:46 +01:00
Luis Díaz Más
aec36f86d7 Replace naked new operators 2022-02-27 09:36:46 +01:00
Luis Díaz Más
8b3da36f42 Improvements from code review 2022-02-19 17:27:29 +01:00
Luis Díaz Más
d11479e53c Replace dynamic C array by std::vector 2022-02-18 18:01:02 +01:00
Luis Díaz Más
ea201ce613 Remove dead code 2022-02-18 18:01:02 +01:00
Luis Díaz Más
1d243ed40e Remove dead code: copyXattrFrom 2022-02-18 18:01:02 +01:00
Luis Díaz Más
c0b663b7ea Remove dead code (LSTAT) 2022-02-18 18:01:02 +01:00
Luis Díaz Más
798cf9baeb Remove dead code (winNumberOfLinks) 2022-02-18 18:01:02 +01:00
Luis Díaz Más
56b5ab9a29 Use remove from filesystem 2022-02-18 18:01:02 +01:00
Luis Díaz Más
9b3a643d33 Use rename from filesystem 2022-02-18 18:00:55 +01:00