Skip to content

Commit 922b742

Browse files
authored
V2025.7.0 (#82)
* feat: Replace `curl` with `cpr` * feat: Remove `IApp::nterProcessCommunicator` * feat: Portable configs * feat: Narrow down dependency search * fix: Windows process pause * feat: Update changelog
1 parent e77d3ae commit 922b742

38 files changed

Lines changed: 492 additions & 1051 deletions

.github/workflows/linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
uses: johnwason/vcpkg-action@v6
5050
id: vcpkg
5151
with:
52-
pkgs: boost-json curl gettext-libintl glib gtest libsecret maddy
52+
pkgs: boost-json cpr gettext-libintl glib gtest libsecret maddy
5353
triplet: ${{ matrix.variant.triplet }}
5454
revision: 47313591da1d14a8a9b209f4bee39d29acc39b31
5555
token: ${{ github.token }}

.github/workflows/macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
uses: johnwason/vcpkg-action@v6
3030
id: vcpkg
3131
with:
32-
pkgs: boost-json curl gettext-libintl glib gtest maddy
32+
pkgs: boost-json cpr gettext-libintl glib gtest maddy
3333
triplet: arm64-osx
3434
revision: 47313591da1d14a8a9b209f4bee39d29acc39b31
3535
token: ${{ github.token }}

.github/workflows/windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
uses: johnwason/vcpkg-action@v6
3737
id: vcpkg
3838
with:
39-
pkgs: boost-json curl gettext-libintl gtest maddy sqlcipher
39+
pkgs: boost-json cpr gettext-libintl gtest maddy sqlcipher
4040
triplet: ${{ matrix.variant.triplet }}
4141
revision: 47313591da1d14a8a9b209f4bee39d29acc39b31
4242
token: ${{ github.token }}

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
# Changelog
22

3+
## 2025.7.0
4+
### Breaking Changes
5+
#### App
6+
- Removed `App:InterProcessCommunicator` (can be easily recreated using the `Network::Socket` class)
7+
#### Logging
8+
- Removed module
9+
#### Network
10+
- Replaced dependency of `libcurl` with `cpr`
11+
- Renamed `Web::fetchJson()` to `Web::getJson()`
12+
- Removed `CurlEasy` class
13+
### New APIs
14+
#### App
15+
- Added `isPortable` parameter to `DataFileManager` to store config files in the executable directory instead
16+
#### Helpers
17+
- Added `PairHash` class
18+
- Added `CodeHelpers::combineHash()` function
19+
#### System
20+
- Added `DependencySearchOption` enum
21+
- Added `search` parameter to `Environment::findDependency()` to specify a `DependencySearchOption`
22+
### Fixes
23+
#### System
24+
- Fixed `Process::pause()` and `Process::resume()` not working
25+
326
## 2025.6.5
427
### Breaking Changes
528
None

CMakeLists.txt

Lines changed: 62 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ endif()
2020
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
2121

2222
#libnick Definition
23-
project ("libnick" LANGUAGES C CXX VERSION 2025.6.5 DESCRIPTION "A cross-platform base for native Nickvision applications.")
23+
project ("libnick" LANGUAGES C CXX VERSION 2025.7.0 DESCRIPTION "A cross-platform base for native Nickvision applications.")
2424
include(CMakePackageConfigHelpers)
2525
include(GNUInstallDirs)
2626
include(CTest)
@@ -35,10 +35,68 @@ if(NOT WIN32)
3535
add_compile_definitions(HAVE_USLEEP)
3636
endif()
3737
add_library (${PROJECT_NAME}
38+
"include/app/appinfo.h"
39+
"include/app/datafilebase.h"
40+
"include/app/datafilemanager.h"
41+
"include/app/windowgeometry.h"
42+
"include/database/sqlcontext.h"
43+
"include/database/sqldatabase.h"
44+
"include/database/sqlstatement.h"
45+
"include/database/sqlvalue.h"
46+
"include/events/event.h"
47+
"include/events/eventargs.h"
48+
"include/events/parameventargs.h"
49+
"include/filesystem/applicationuserdirectory.h"
50+
"include/filesystem/fileaction.h"
51+
"include/filesystem/filesystemchangedeventargs.h"
52+
"include/filesystem/filesystemwatcher.h"
53+
"include/filesystem/userdirectories.h"
54+
"include/filesystem/userdirectory.h"
55+
"include/filesystem/watcherflags.h"
56+
"include/helpers/codehelpers.h"
57+
"include/helpers/pairhash.h"
58+
"include/helpers/stringhelpers.h"
59+
"include/keyring/credential.h"
60+
"include/keyring/credentialcheckstatus.h"
61+
"include/keyring/keyring.h"
62+
"include/keyring/passwordcontent.h"
63+
"include/keyring/passwordgenerator.h"
64+
"include/keyring/passwordstrength.h"
65+
"include/keyring/systemcredentials.h"
66+
"include/localization/documentation.h"
67+
"include/localization/gettext.h"
68+
"include/network/addressfamily.h"
69+
"include/network/dns.h"
70+
"include/network/ipv4address.h"
71+
"include/network/macaddress.h"
72+
"include/network/networkmonitor.h"
73+
"include/network/networkstate.h"
74+
"include/network/networkstatechangedeventargs.h"
75+
"include/network/socket.h"
76+
"include/network/sockettype.h"
77+
"include/network/web.h"
78+
"include/notifications/appnotification.h"
79+
"include/notifications/notificationsenteventargs.h"
80+
"include/notifications/notificationseverity.h"
81+
"include/notifications/shellnotification.h"
82+
"include/notifications/shellnotificationsenteventargs.h"
83+
"include/system/dependencysearchoption.h"
84+
"include/system/deploymentmode.h"
85+
"include/system/environment.h"
86+
"include/system/hardwareinfo.h"
87+
"include/system/operatingsystem.h"
88+
"include/system/process.h"
89+
"include/system/processexitedeventargs.h"
90+
"include/system/processstate.h"
91+
"include/system/suspendinhibitor.h"
92+
"include/taskbar/progressstate.h"
93+
"include/taskbar/taskbaritem.h"
94+
"include/update/updater.h"
95+
"include/update/version.h"
96+
"include/update/versiontype.h"
3897
"src/app/appinfo.cpp"
3998
"src/app/datafilebase.cpp"
4099
"src/app/datafilemanager.cpp"
41-
"src/app/interprocesscommunicator.cpp"
42100
"src/app/windowgeometry.cpp"
43101
"src/database/sqlcontext.cpp"
44102
"src/database/sqldatabase.cpp"
@@ -56,8 +114,6 @@ add_library (${PROJECT_NAME}
56114
"src/keyring/systemcredentials.cpp"
57115
"src/localization/documentation.cpp"
58116
"src/localization/gettext.cpp"
59-
"src/logging/logger.cpp"
60-
"src/network/curleasy.cpp"
61117
"src/network/dns.cpp"
62118
"src/network/ipv4address.cpp"
63119
"src/network/macaddress.cpp"
@@ -88,9 +144,9 @@ endif()
88144

89145
#libnick Packages
90146
find_package(Boost REQUIRED COMPONENTS json)
91-
find_package(CURL REQUIRED)
147+
find_package(cpr CONFIG REQUIRED)
92148
find_package(Intl REQUIRED)
93-
target_link_libraries(${PROJECT_NAME} PUBLIC Boost::json CURL::libcurl Intl::Intl)
149+
target_link_libraries(${PROJECT_NAME} PUBLIC Boost::json cpr::cpr Intl::Intl)
94150
if(USING_VCPKG)
95151
find_package(unofficial-maddy CONFIG REQUIRED)
96152
target_link_libraries(${PROJECT_NAME} PRIVATE unofficial::maddy::maddy)
@@ -154,10 +210,8 @@ if (BUILD_TESTING)
154210
"tests/eventtests.cpp"
155211
"tests/filewatchertests.cpp"
156212
"tests/hardwaretests.cpp"
157-
"tests/ipctests.cpp"
158213
"tests/keyringtests.cpp"
159214
"tests/localizationtests.cpp"
160-
"tests/loggingtests.cpp"
161215
"tests/main.cpp"
162216
"tests/networktests.cpp"
163217
"tests/notificationtests.cpp"

Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ PROJECT_NAME = "libnick"
4848
# could be handy for archiving the generated documentation or if some version
4949
# control system is used.
5050

51-
PROJECT_NUMBER = "2025.6.5"
51+
PROJECT_NUMBER = "2025.7.0"
5252

5353
# Using the PROJECT_BRIEF tag one can provide an optional one line description
5454
# for a project that appears at the top of each page and should give viewer a

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ The recommendation is to (and below commands will) use vcpkg to pull these depen
1717

1818
### All Platforms
1919
- boost-json
20+
- cpr
2021
- gtest
21-
- libcurl
2222
- libintl
2323
- maddy
2424
- sqlcipher (Must be provided by the system on Linux and macOS as sqlcipher is not available via vcpkg for these systems)
@@ -53,13 +53,13 @@ A C++20 compiler is also required to build libnick.
5353
1. Set the `VCPKG_ROOT` environment variable to the path of your vcpkg installation's root directory.
5454
#### Windows
5555
1. Set the `VCPKG_DEFAULT_TRIPLET` environment variable to `x64-windows`
56-
1. Run `vcpkg install boost-json curl gettext-libintl gtest maddy sqlcipher`
56+
1. Run `vcpkg install boost-json cpr gettext-libintl gtest maddy sqlcipher`
5757
#### Linux
5858
1. Set the `VCPKG_DEFAULT_TRIPLET` environment variable to `x64-linux`
59-
1. Run `vcpkg install boost-json curl gettext-libintl glib gtest libsecret maddy`
59+
1. Run `vcpkg install boost-json cpr gettext-libintl glib gtest libsecret maddy`
6060
#### macOS (Apple Silicon)
6161
1. Set the `VCPKG_DEFAULT_TRIPLET` environment variable to `arm64-osx`
62-
1. Run `vcpkg install boost-json curl gettext-libintl glib gtest libsecret maddy`
62+
1. Run `vcpkg install boost-json cpr gettext-libintl glib gtest libsecret maddy`
6363

6464
### Building
6565
1. First, clone/download the repo.
@@ -91,4 +91,4 @@ A C++20 compiler is also required to build libnick.
9191
```
9292
find_package(libnick CONFIG REQUIRED)
9393
target_link_libraries(main PRIVATE libnick::libnick)
94-
```
94+
```

cmake/config.cmake.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if(DEFINED ENV{VCPKG_ROOT})
1515
endif()
1616

1717
find_dependency(Boost REQUIRED COMPONENTS json)
18-
find_dependency(CURL REQUIRED)
18+
find_dependency(cpr CONFIG REQUIRED)
1919
find_dependency(Intl REQUIRED)
2020
if(USING_VCPKG)
2121
find_dependency(unofficial-maddy REQUIRED)

include/app/datafilebase.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ namespace Nickvision::App
4040
* @brief Constructs a DataFileBase, loading the file from disk.
4141
* @param key The key of the config file
4242
* @param appName The name of the application the data file belongs to
43+
* @param isPortable Whether or not the config file is portable
4344
* @throw std::invalid_argument Thrown if key is empty
4445
* @throw std::invalid_argument Thrown if appName is empty
4546
*/
46-
DataFileBase(const std::string& key, const std::string& appName);
47+
DataFileBase(const std::string& key, const std::string& appName, bool isPortable);
4748
/**
4849
* @brief Destructs a DataFileBase.
4950
*/
@@ -74,4 +75,4 @@ namespace Nickvision::App
7475
};
7576
}
7677

77-
#endif //DATAFILEBASE_H
78+
#endif //DATAFILEBASE_H

include/app/datafilemanager.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ namespace Nickvision::App
4343
/**
4444
* @brief Constructs a DataFileManager.
4545
* @param appName The name of the application (used in determining the path to store data files on disk)
46+
* @param isPortable Whether or not the application is portable (the config files should live in the same exe directory)
4647
*/
47-
DataFileManager(const std::string& appName);
48+
DataFileManager(const std::string& appName, bool isPortable);
4849
// Delete copy and move constructors and assignment operators
4950
DataFileManager(const DataFileManager&) = delete;
5051
DataFileManager(DataFileManager&&) = delete;
@@ -66,15 +67,16 @@ namespace Nickvision::App
6667
}
6768
if (!m_files.contains(key))
6869
{
69-
m_files[key] = std::make_unique<T>(key, m_appName);
70+
m_files[key] = std::make_unique<T>(key, m_appName, m_isPortable);
7071
}
7172
return *static_cast<T*>(m_files[key].get());
7273
}
7374

7475
private:
7576
std::string m_appName;
77+
bool m_isPortable;
7678
std::unordered_map<std::string, std::unique_ptr<DataFileBase>> m_files;
7779
};
7880
}
7981

80-
#endif //DATAFILEMANAGER_H
82+
#endif //DATAFILEMANAGER_H

0 commit comments

Comments
 (0)