Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve FlashString portability #2796

Merged
merged 4 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Sming/Core/FileSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ template <typename TFileName> inline int fileSetContent(const TFileName& fileNam
return fileSystem->setContent(fileName, content, length);
}

template <typename TFileName, typename TContent> inline int fileSetContent(const TFileName& fileName, TContent content)
template <typename TFileName, typename TContent>
inline int fileSetContent(const TFileName& fileName, const TContent& content)
{
CHECK_FS(setContent)
return fileSystem->setContent(fileName, content);
Expand Down
16 changes: 16 additions & 0 deletions docs/source/upgrading/5.1-5.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,19 @@ Applications must explicitly call :cpp:func:`HttpRequest::onSslInit` and set the
This extra step ensures that security checks are not unintentionally bypassed.

The same behaviour is now presented when using Bearssl, and will now fail with ``X509_NOT_TRUSTED``.


**FlashString copy support removed**

The :library:`FlashString` previously supported copies (references) like this::

FlashString emptyString;
FlashString stringCopy(FS("Inline string"));

DEFINE_FSTR_DATA_LOCAL(flashHelloData, "Hello");
auto myCopy = flashHelloData;

These will now fail to compile.
Copy construction and assignment has been explicitly deleted so avoid unintentional side-effects.

Objects should always be passed by reference.
Loading