Commit Graph

113 Commits

Author SHA1 Message Date
Rosen Penev
e2bf207477 add various moves
More efficient

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-03-13 23:01:14 -07:00
Rosen Penev
725875497b SonarLint cleanups 2023-03-03 19:35:42 -08:00
Rosen Penev
a7a9835431 more std::find to Exiv2::find
The latter is simpler.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-01-27 07:47:18 -08:00
Rosen Penev
842ef05ee6 return nullptr instead of reset
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-01-05 23:29:31 -08:00
Rosen Penev
d856ca7d82 cland-tidy: simplify booleans
Found with readability-simplify-boolean-expr

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-09-27 06:40:37 -07:00
Rosen Penev
71dc04ebb1 misc sonarlint stuff
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-08-22 23:00:32 -07:00
Rosen Penev
235b1e0d19 move structured bindings up
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-08-21 14:37:12 -07:00
Rosen Penev
b8855fb3b5 misc sonarlint cleanups
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-08-05 01:01:25 -07:00
Kevin Backhouse
b0040e3bbe
Convert type of depth parameter to size_t. 2022-07-30 22:22:50 -04: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
Rosen Penev
9ca7f861cf remove string_view from headers
This should allow usage with C++11 projects. It's also wrong. The only
user of this assigns an std::string from a string_view, which is not
safe.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-07-24 16:37:25 -07:00
Kevin Backhouse
ad4e13b827
Change return type of BasicIo::tell() to size_t. 2022-06-21 17:05:10 +01:00
Luis Díaz Más
d4ffcb9497 utils are in Internal namespace 2022-04-14 10:41:07 +02:00
Rosen Penev
fdfcde5e4b structured binding conversions
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-09 10:49:02 +02:00
Rosen Penev
5d5354edee clang-tidy: C array to std::array conversions
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-18 13:19:45 +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 Díaz Más
96f7f2e4c5 Convert Exiv2::ErrorCode into an enum class 2022-03-12 16:58:40 +01: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
ae3e28c62a make array constexpr
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-04 15:54:03 -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
8b3da36f42 Improvements from code review 2022-02-19 17:27:29 +01:00
Luis Díaz Más
476a5e23f9 Replace raw loop for any_of 2022-02-18 18:16:03 +01:00
Luis Díaz Más
a6185d29c6 Image::setComment now takes string_view 2022-02-18 18:01:02 +01:00
Luis Diaz
8e0e00c459 make startsWith constexpr and use string_view 2022-02-18 13:51:39 +01:00
Luis Díaz Más
405f4b5f1b Remove Util::dirname and finally the util files 2022-02-18 13:51:38 +01:00
Luis Díaz Más
49fbfb44a3 Remove startsWith from utils 2022-02-18 13:51:37 +01:00
Luis Díaz Más
0f03e77634 Simplify code around UniquePtr(s) & use make_unique over new 2022-02-05 11:02:04 +01:00
Kevin Backhouse
c9d0cf3643
Make fields of DataBuf private. 2021-08-29 15:43:10 +01:00
Rosen Penev
f3fcffd6e6 remove most usages of std::make_pair
Better alternatives exist with C++11.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-08-17 19:11:28 -07:00
postscript-dev
510a38e27d
Move all startsWith() funcs to Util namespace
The function checks if a string is in the beginning of another. This
is intended for use until the move to C++20 when
`std::basic_string<>::starts_with()` becomes available. Suggested in
https://github.com/Exiv2/exiv2/pull/1777 .

Separate identical definitions have been moved into a single copy.
2021-07-18 12:00:05 +01:00
Rosen Penev
fdf9d3799c clang-tidy: don't use else after return
Found with llvm-else-after-return

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-15 17:32:56 +02:00
Rosen Penev
5dc4292b40 fix bad for range loop
This loop is supposed to break when it encounters a match.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-13 11:08:29 +02:00
Rosen Penev
8337462032 clang-tidy: use empty() instead of comparing size
Found with readability-container-size-empty

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-11 22:02:47 +02:00
Rosen Penev
4ceb325c8f clang-tidy: range for loop conversions
Found with modernize-loop-convert

Ran through git clang-format.

Also removed several questionable loops and replaced with simpler
algorithms.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-03 14:50:04 +02:00
Luis Díaz Más
e366c786b9 Fix -Werror=shadow warning after recovering EPS 2021-04-22 20:24:59 +02:00
Luis Díaz Más
d5240a4bda eps: Fix code after usage of unique_ptr. Remove deprecation tags 2021-04-22 18:39:31 +02:00
Luis Díaz Más
8314030604 Revert "Remove deprecated EPS format"
This reverts commit 537cdad99e.
2021-04-22 18:39:31 +02:00
Luis Díaz Más
537cdad99e Remove deprecated EPS format 2021-04-15 06:56:11 +02:00
Robin Mills
d632988bbd Massive code prolog cleanup. 2021-03-17 13:34:21 +00:00
Luis Díaz Más
ab6aac054a Remove deprecated code from version source files 2018-09-14 07:43:21 +02:00
Luis Díaz Más
603692a1d8 Copyright to Exiv2 authors 2018-09-12 19:22:31 +02:00
tbeu
75cdbc8b91 Use pre-increment on iterators
V803 Decreased performance. In case 'userEnd' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. futils.cpp 405
V803 Decreased performance. In case 'authEnd' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. futils.cpp 410
V803 Decreased performance. In case 'hostEnd' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. futils.cpp 428
V803 Decreased performance. In case 'e' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. epsimage.cpp 711
V803 Decreased performance. In case 'e' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. epsimage.cpp 841
V803 Decreased performance. In case 'e' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. epsimage.cpp 958
V803 Decreased performance. In case 'i' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. epsimage.cpp 855
V803 Decreased performance. In case 'it' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. jpgimage.cpp 817
V803 Decreased performance. In case 'lib' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. version.cpp 508
V803 Decreased performance. In case 'it' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. version.cpp 563
V803 Decreased performance. In case 'it' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. xmpsidecar.cpp 138
2018-06-02 09:43:20 +02:00
Dan Čermák
bc58752d18 Remove useless casts
This commit removes only casts where type A is cast to the exactly same
type (and not to a platform dependent typedefs)
2018-05-16 10:15:53 +02:00
Dan Čermák
efe2ccdcb6 Replaced all hardcoded error codes with ker... constants 2018-02-18 09:28:57 +01:00
tbeu
5b5987a596 Remove obsolete EXIV2_RCSID 2017-11-19 11:17:12 +01:00
tbeu
5df8b01b77 Remove obsolete svn revision 2017-11-19 11:17:11 +01:00
Robin Mills
6d5c2c3256 Getting ready to release v0.26 2017-03-08 20:42:28 +00:00
Robin Mills
2ebacb6b0b #1272 Use in-memory temporary files. 2017-03-05 17:42:12 +00:00
Robin Mills
b15a401569 #1187 Thank You to Taras for the patch. 2016-05-30 14:45:28 +00:00