mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[PR #1772] [CLOSED] WiFiManagerParameter max length and encapsulation #1826
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#1826
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/tzapu/WiFiManager/pull/1772
Author: @dmadison
Created: 10/28/2024
Status: ❌ Closed
Base:
master← Head:param-max-length📝 Commits (6)
d17f73fAdd param setValue function without lengthbaf99e4Deprecate parameter friendshipf8da7b8Refactor parameter 'length' as 'maxLength'd507b97Change param value length function name2b34425Add negative check to param max length0111a05Remove parameter friendship📊 Changes
3 files changed (+39 additions, -26 deletions)
View changed files
📝
WiFiManager.cpp(+29 -17)📝
WiFiManager.h(+9 -8)📝
keywords.txt(+1 -1)📄 Description
This PR performs a few fixes around the
WiFiManagerParameterclass to improve clarity, usability, and encapsulation:lengthparameter has been changed tomaxLengthfor all class functions_length) has not been changed to maintain compatibility with user code, as it's exposed as a protected value and through friendship withWiFiManager.setValue()now has a version without a max length argumentgetValueLength()has been changed togetValueMaxLength()WiFiManagerParameterandWiFiManagerhas been removedWiFiManagerhave been changed to use the public functions and there is no remaining reason for the friendship to exist. Removing the friendship boosts encapsulation.setValue()now checks for a negative max lengthsize_t). Again, this was not changed so-as not to break backwards-compatibility.This PR should have no breaking changes. The few items marked deprecated should be removed on the next major release.
If this is merged, here are the changes to make on the next major release:
WiFiManagerParameter::_lengthshould be refactored to_maxLengthWiFiManagerParameter::getValueLength() constshould be removedWiFiManagerParametermaxLengtharguments should usesize_tinstead ofint🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.