Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Arduino String/Stream add features#201

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
PiotrekB416 wants to merge10 commits intoarduino:master
base:master
Choose a base branch
Loading
fromPiotrekB416:Feat/more-string-functions
Open
Show file tree
Hide file tree
Changes from1 commit
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
PrevPrevious commit
NextNext commit
Fix Valgrind errors
  • Loading branch information
@PiotrekB416
PiotrekB416 committedSep 2, 2023
commitc091a9f28adb647415067dc1be1bee795b2e7a1e
4 changes: 2 additions & 2 deletionsapi/String.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -636,8 +636,8 @@ void String::insert(const String &str, unsigned int index, unsigned int length)
if (index > len) return;
length = length < str.len ? length : str.len;
unsigned int size = len + length;
if (size > capacity && !changeBuffer(size)) return; // XXX: tell user!
memmove(buffer + index + length, buffer + index, len - index +length);
if (size > capacity && !reserve(size)) return; // XXX: tell user!
memmove(buffer + index + length, buffer + index, len - index +1);
memcpy(buffer + index, str.buffer, length);
len += length;
return;
Expand Down
2 changes: 1 addition & 1 deletionapi/String.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -206,7 +206,7 @@ class String
String substring( unsigned int beginIndex, unsigned int endIndex ) const;

// modification
void insert(char c, unsigned int index) { return insert(&c, index, 1); };
void insert(char c, unsigned int index) { return insert(String(c), index, 1); };
void insert(const String &str, unsigned int index, unsigned int length);
void replace(char find, char replace);
void replace(const String& find, const String& replace);
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp