Skip to content

Commit 835619d

Browse files
committed
Theme and dependency updates 🌺
Contains minorly breaking changes. - Updated Readme - Updated config value names for a more readable .ini file - Set editor shadow, line number area and indicator fallbacks to true - Updated bit7z to v4-RC - Updated Dark and Solarized themes' scroll bar colors
1 parent 249b4ee commit 835619d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1010
-620
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
</kbd>
88
</p>
99
<p align="center">
10-
<a href="https://github.com/fairybow/fernanda/releases/"><img src="https://img.shields.io/github/v/release/fairybow/fernanda?include_prereleases&color=f34b7d" alt="release"/></a>
11-
<a href="LICENSE"><img src="https://img.shields.io/github/license/fairybow/fernanda?color=orange" alt="license: GPL-3.0"/></a>
10+
<a href="https://github.com/fairybow/fernanda/releases/"><img src="https://img.shields.io/github/v/release/fairybow/fernanda?include_prereleases&color=f34b7d" alt="Latest Release"/></a>
11+
<a href="LICENSE"><img src="https://img.shields.io/github/license/fairybow/fernanda?color=orange" alt="License: GPL-3.0"/></a>
1212
<br>
1313
<a href="https://www.qt.io/"><img src="https://img.shields.io/badge/Qt-v6.4.1-brightgreen?logo=qt" alt="Qt v6.4.1"/></a>
14-
<a href="https://github.com/rikyoz/bit7z"><img src="https://img.shields.io/badge/Bit7z-v4.0.0--beta-blue" alt="Bit7z v4.0.0-beta"/></a>
14+
<a href="https://github.com/rikyoz/bit7z"><img src="https://img.shields.io/badge/Bit7z-v4.0.0--RC-blue" alt="Bit7z v4.0.0-RC"/></a>
1515
<a href="https://www.7-zip.org/"><img src="https://img.shields.io/badge/7zip-v22.01-ffbf00" alt="7zip v22.01"/></a>
1616
<br>
1717
<a href="#install"><img src="https://img.shields.io/badge/Windows%20(x64)-5B5B5B?logo=windows" alt="Platform Windows (x64)"/></a>

fernanda/docs/bit7z/BUILD.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v4.0.0-beta msvc2019_x64
1+
v4.0.0-rc msvc2019_x64

fernanda/docs/bit7z/README.md

Lines changed: 191 additions & 111 deletions
Large diffs are not rendered by default.
Binary file not shown.
Binary file not shown.

fernanda/fernanda.vcxproj.filters

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,24 @@
215215
<ClInclude Include="src\keyfilter.h">
216216
<Filter>Header Files</Filter>
217217
</ClInclude>
218+
<ClInclude Include="src\archiver.h">
219+
<Filter>Header Files</Filter>
220+
</ClInclude>
221+
<ClInclude Include="src\dom.h">
222+
<Filter>Header Files</Filter>
223+
</ClInclude>
224+
<ClInclude Include="src\story.h">
225+
<Filter>Header Files</Filter>
226+
</ClInclude>
227+
<ClInclude Include="src\icon.h">
228+
<Filter>Header Files</Filter>
229+
</ClInclude>
230+
<ClInclude Include="src\layout.h">
231+
<Filter>Header Files</Filter>
232+
</ClInclude>
233+
<ClInclude Include="src\style.h">
234+
<Filter>Header Files</Filter>
235+
</ClInclude>
218236
<ClInclude Include="include\bit7z\include\bit7z.hpp">
219237
<Filter>Header Files\Includes\bit7z</Filter>
220238
</ClInclude>
@@ -314,24 +332,6 @@
314332
<ClInclude Include="include\bit7z\include\bitwindows.hpp">
315333
<Filter>Header Files\Includes\bit7z</Filter>
316334
</ClInclude>
317-
<ClInclude Include="src\archiver.h">
318-
<Filter>Header Files</Filter>
319-
</ClInclude>
320-
<ClInclude Include="src\dom.h">
321-
<Filter>Header Files</Filter>
322-
</ClInclude>
323-
<ClInclude Include="src\story.h">
324-
<Filter>Header Files</Filter>
325-
</ClInclude>
326-
<ClInclude Include="src\icon.h">
327-
<Filter>Header Files</Filter>
328-
</ClInclude>
329-
<ClInclude Include="src\layout.h">
330-
<Filter>Header Files</Filter>
331-
</ClInclude>
332-
<ClInclude Include="src\style.h">
333-
<Filter>Header Files</Filter>
334-
</ClInclude>
335335
</ItemGroup>
336336
<ItemGroup>
337337
<QtMoc Include="src\fernanda.h">

fernanda/include/bit7z/include/bit7zlibrary.hpp

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,39 @@ struct IOutArchive;
2222
struct GUID;
2323
#endif
2424

25-
//! \cond IGNORE_BLOCK_IN_DOXYGEN
25+
//! @cond IGNORE_BLOCK_IN_DOXYGEN
2626
template< typename T >
2727
class CMyComPtr;
28-
//! \endcond
28+
//! @endcond
2929

30+
/**
31+
* @brief The main namespace of the bit7z library.
32+
*/
3033
namespace bit7z {
31-
#ifdef _WIN32
32-
constexpr auto default_library = BIT7Z_STRING("7z.dll");
34+
35+
/**
36+
* @brief The default file path for the 7-zip shared library to be used by bit7z
37+
* in case the user doesn't pass a path to the constructor of the Bit7zLibrary class.
38+
*
39+
* @note On Windows, the default library is "7z.dll", and it is searched following the Win32 API rules
40+
* (https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order).
41+
*
42+
* @note On Linux, the default library is the absolute path to the "7z.so" installed by p7zip.
43+
*
44+
* @note In all other cases, the value will be the relative path to a "7z.so" in the working directory of the program.
45+
*/
46+
#ifdef __DOXYGEN__
47+
constexpr auto default_library = "<platform-dependent value>";
48+
#elif defined( _WIN32 )
49+
constexpr auto default_library = BIT7Z_STRING( "7z.dll" );
3350
#elif defined( __linux__ )
34-
constexpr auto default_library = "/usr/lib/p7zip/7z.so"; //default installation path of p7zip shared library
51+
constexpr auto default_library = "/usr/lib/p7zip/7z.so"; // Default installation path of the p7zip shared library.
3552
#else
3653
constexpr auto default_library = "./7z.so";
3754
#endif
3855

3956
/**
40-
* @brief The Bit7zLibrary class allows the access to the basic functionalities provided by the 7z DLLs.
57+
* @brief The Bit7zLibrary class allows accessing the basic functionalities provided by the 7z DLLs.
4158
*/
4259
class Bit7zLibrary final {
4360
public:
@@ -66,10 +83,11 @@ class Bit7zLibrary final {
6683
/**
6784
* @brief Initiates the 7-zip object needed to create a new archive or use an old one.
6885
*
69-
* @note Usually this method should not be called directly by users of the bit7z library.
86+
* @note Usually, this method should not be called directly by users of the bit7z library.
7087
*
71-
* @param format_ID GUID of the archive format (see BitInFormat's guid() method).
72-
* @param interface_ID ID of the archive interface to be requested (IID_IInArchive or IID_IOutArchive).
88+
* @param format_ID Pointer to the GUID of the archive format (see BitInFormat's guid() method).
89+
* @param interface_ID Pointer to the GUID of the archive interface to be requested
90+
* (IID_IInArchive or IID_IOutArchive).
7391
* @param out_object Pointer to a CMyComPtr of an object implementing the requested interface.
7492
*/
7593
void createArchiveObject( const GUID* format_ID, const GUID* interface_ID, void** out_object ) const;
@@ -85,6 +103,7 @@ class Bit7zLibrary final {
85103
HMODULE mLibrary;
86104
CreateObjectFunc mCreateObjectFunc;
87105
};
106+
88107
} // namespace bit7z
89108

90109
#endif // BIT7ZLIBRARY_HPP

fernanda/include/bit7z/include/bitabstractarchivecreator.hpp

Lines changed: 59 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#ifndef BITABSTRACTARCHIVECREATOR_HPP
1111
#define BITABSTRACTARCHIVECREATOR_HPP
1212

13+
#include <map>
1314
#include <memory>
1415

1516
#include "bitabstractarchivehandler.hpp"
@@ -22,17 +23,19 @@ struct IOutStream;
2223
struct ISequentialOutStream;
2324

2425
namespace bit7z {
26+
2527
using std::ostream;
2628

27-
struct ArchiveProperties {
28-
vector< const wchar_t* > names;
29-
vector< BitPropVariant > values;
30-
};
29+
class ArchiveProperties;
3130

31+
/**
32+
* @brief Enumeration representing how an archive creator should deal when the output archive already exists.
33+
*/
3234
enum struct UpdateMode {
33-
None,
34-
Append,
35-
Overwrite
35+
None, ///< The creator will throw an exception (unless the OverwriteMode is not None).
36+
Append, ///< The creator will append the new items to the existing archive.
37+
Update, ///< New items whose path already exists in the archive will overwrite the old ones, other will be appended.
38+
BIT7Z_DEPRECATED_ENUMERATOR( Overwrite, Update, "Since v4.0; please use the UpdateMode::Update enumerator." ) ///< @deprecated since v4.0; please use the UpdateMode::Update enumerator.
3639
};
3740

3841
/**
@@ -131,7 +134,7 @@ class BitAbstractArchiveCreator : public BitAbstractArchiveHandler {
131134
*
132135
* When setting a password, the produced archive will be encrypted using the default
133136
* cryptographic method of the output format. If the format is 7z, and the option
134-
* "crypt_headers" is set to true, also the headers of the archive will be encrypted,
137+
* "crypt_headers" is set to true, the headers of the archive will be encrypted,
135138
* resulting in a password request every time the output file will be opened.
136139
*
137140
* @note Calling setPassword when the output format doesn't support archive encryption
@@ -199,6 +202,19 @@ class BitAbstractArchiveCreator : public BitAbstractArchiveHandler {
199202
*/
200203
virtual void setUpdateMode( UpdateMode mode );
201204

205+
/**
206+
* @brief Sets whether the creator can update existing archives or not.
207+
*
208+
* @deprecated since v4.0; it is provided just for an easier transition from the old v3 API.
209+
*
210+
* @note If set to false, a subsequent compression operation may throw an exception
211+
* if it targets an existing archive.
212+
*
213+
* @param can_update if true, compressing operations will update existing archives.
214+
*/
215+
BIT7Z_DEPRECATED_MSG( "Since v4.0; please use the overloaded function that takes an UpdateMode enumerator." )
216+
void setUpdateMode( bool can_update );
217+
202218
/**
203219
* @brief Sets the volume_size (in bytes) of the output archive volumes.
204220
*
@@ -215,9 +231,38 @@ class BitAbstractArchiveCreator : public BitAbstractArchiveHandler {
215231
*/
216232
void setThreadsCount( uint32_t threads_count ) noexcept;
217233

218-
protected:
219-
const BitInOutFormat& mFormat;
234+
/**
235+
* @brief Sets a property for the output archive format as described by the 7-zip documentation
236+
* (e.g. https://sevenzip.osdn.jp/chm/cmdline/switches/method.htm).
237+
*
238+
* @tparam T An integral type (i.e., a bool or an integer type).
239+
*
240+
* @param name The string name of the property to be set.
241+
* @param value The value to be used for the property.
242+
*/
243+
template< std::size_t N, typename T, typename = typename std::enable_if< std::is_integral< T >::value >::type >
244+
void setFormatProperty( const wchar_t (&name)[N], T value ) noexcept { // NOLINT(*-avoid-c-arrays)
245+
mExtraProperties[ name ] = value;
246+
}
220247

248+
/**
249+
* @brief Sets a property for the output archive format as described by the 7-zip documentation
250+
* (e.g. https://sevenzip.osdn.jp/chm/cmdline/switches/method.htm).
251+
*
252+
* For example, passing the string L"tm" with a false value while creating a .7z archive
253+
* will disable storing the last modified timestamps of the compressed files.
254+
*
255+
* @tparam T A non-integral type (i.e., a string).
256+
*
257+
* @param name The string name of the property to be set.
258+
* @param value The value to be used for the property.
259+
*/
260+
template< std::size_t N, typename T, typename = typename std::enable_if< !std::is_integral< T >::value >::type >
261+
void setFormatProperty( const wchar_t (&name)[N], const T& value ) noexcept { // NOLINT(*-avoid-c-arrays)
262+
mExtraProperties[ name ] = value;
263+
}
264+
265+
protected:
221266
BitAbstractArchiveCreator( const Bit7zLibrary& lib,
222267
const BitInOutFormat& format,
223268
tstring password = {},
@@ -228,6 +273,8 @@ class BitAbstractArchiveCreator : public BitAbstractArchiveHandler {
228273
friend class BitOutputArchive;
229274

230275
private:
276+
const BitInOutFormat& mFormat;
277+
231278
UpdateMode mUpdateMode;
232279
BitCompressionLevel mCompressionLevel;
233280
BitCompressionMethod mCompressionMethod;
@@ -237,7 +284,9 @@ class BitAbstractArchiveCreator : public BitAbstractArchiveHandler {
237284
bool mSolidMode;
238285
uint64_t mVolumeSize;
239286
uint32_t mThreadsCount;
287+
std::map< std::wstring, BitPropVariant > mExtraProperties;
240288
};
289+
241290
} // namespace bit7z
242291

243292
#endif // BITABSTRACTARCHIVECREATOR_HPP

fernanda/include/bit7z/include/bitabstractarchivehandler.hpp

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "bitdefines.hpp"
1818

1919
namespace bit7z {
20+
2021
using std::function;
2122

2223
class BitInFormat;
@@ -49,6 +50,17 @@ using FileCallback = function< void( tstring ) >;
4950
*/
5051
using PasswordCallback = function< tstring() >;
5152

53+
/**
54+
* @brief Enumeration representing how a handler should deal when an output file already exists.
55+
*/
56+
enum struct OverwriteMode {
57+
None = 0, ///< The handler will throw an exception if the output file or buffer already exists.
58+
Overwrite, ///< The handler will overwrite the old file or buffer with the new one.
59+
Skip, ///< The handler will skip writing to the output file or buffer.
60+
//TODO: RenameOutput,
61+
//TODO: RenameExisting
62+
};
63+
5264
/**
5365
* @brief Abstract class representing a generic archive handler.
5466
*/
@@ -80,13 +92,13 @@ class BitAbstractArchiveHandler {
8092
BIT7Z_NODISCARD tstring password() const;
8193

8294
/**
83-
* @return true if the directory structure must be preserved while extracting or compressing
84-
* the archive, false otherwise.
95+
* @return a boolean value indicating whether the directory structure must be preserved while extracting
96+
* or compressing the archive.
8597
*/
8698
BIT7Z_NODISCARD bool retainDirectories() const noexcept;
8799

88100
/**
89-
* @return true if a password is defined, false otherwise.
101+
* @return a boolean value indicating whether a password is defined or not.
90102
*/
91103
BIT7Z_NODISCARD bool isPasswordDefined() const noexcept;
92104

@@ -115,13 +127,18 @@ class BitAbstractArchiveHandler {
115127
*/
116128
BIT7Z_NODISCARD PasswordCallback passwordCallback() const;
117129

130+
/**
131+
* @return the current OverwriteMode.
132+
*/
133+
BIT7Z_NODISCARD OverwriteMode overwriteMode() const;
134+
118135
/**
119136
* @brief Sets up a password to be used by the archive handler.
120137
*
121138
* The password will be used to encrypt/decrypt archives by using the default
122139
* cryptographic method of the archive format.
123140
*
124-
* @note Calling setPassword when the input archive is not encrypted does not have effect on
141+
* @note Calling setPassword when the input archive is not encrypted does not have any effect on
125142
* the extraction process.
126143
*
127144
* @note Calling setPassword when the output format doesn't support archive encryption
@@ -130,7 +147,7 @@ class BitAbstractArchiveHandler {
130147
*
131148
* @note After a password has been set, it will be used for every subsequent operation.
132149
* To disable the use of the password, you need to call the clearPassword method, which is equivalent
133-
* to call setPassword(L"").
150+
* to calling setPassword(L"").
134151
*
135152
* @param password the password to be used.
136153
*/
@@ -146,7 +163,7 @@ class BitAbstractArchiveHandler {
146163
void clearPassword() noexcept;
147164

148165
/**
149-
* @brief Sets whether methods output will preserve the input's directory structure or not.
166+
* @brief Sets whether the operations' output will preserve the input's directory structure or not.
150167
*
151168
* @param retain the setting for preserving or not the input directory structure
152169
*/
@@ -163,7 +180,7 @@ class BitAbstractArchiveHandler {
163180
* @brief Sets the function to be called when the processed size of the ongoing operation is updated.
164181
*
165182
* @note The completion percentage of the current operation can be obtained by calculating
166-
* static_cast<int>( ( 100.0 * processed_size ) / total_size ).
183+
* `static_cast<int>( ( 100.0 * processed_size ) / total_size )`.
167184
*
168185
* @param callback the progress callback to be used.
169186
*/
@@ -174,7 +191,7 @@ class BitAbstractArchiveHandler {
174191
* ongoing operation are known.
175192
*
176193
* @note The ratio percentage of a compression operation can be obtained by calculating
177-
* static_cast<int>( ( 100.0 * output_size ) / input_size ).
194+
* `static_cast<int>( ( 100.0 * output_size ) / input_size )`.
178195
*
179196
* @param callback the ratio callback to be used.
180197
*/
@@ -194,21 +211,32 @@ class BitAbstractArchiveHandler {
194211
*/
195212
void setPasswordCallback( const PasswordCallback& callback );
196213

214+
/**
215+
* @brief Sets how the handler should behave when it tries to output to an existing file or buffer.
216+
*
217+
* @param mode the OverwriteMode to be used by the handler.
218+
*/
219+
void setOverwriteMode( OverwriteMode mode );
220+
197221
protected:
222+
explicit BitAbstractArchiveHandler( const Bit7zLibrary& lib,
223+
tstring password = {},
224+
OverwriteMode overwrite_mode = OverwriteMode::None );
225+
226+
private:
198227
const Bit7zLibrary& mLibrary;
199228
tstring mPassword;
200229
bool mRetainDirectories;
230+
OverwriteMode mOverwriteMode;
201231

202-
explicit BitAbstractArchiveHandler( const Bit7zLibrary& lib, tstring password = {} );
203-
204-
private:
205232
//CALLBACKS
206233
TotalCallback mTotalCallback;
207234
ProgressCallback mProgressCallback;
208235
RatioCallback mRatioCallback;
209236
FileCallback mFileCallback;
210237
PasswordCallback mPasswordCallback;
211238
};
239+
212240
} // namespace bit7z
213241

214242
#endif // BITABSTRACTARCHIVEHANDLER_HPP

0 commit comments

Comments
 (0)