arduino / arduino/ArduinoCore-API
Arduino String class: features missing (feature request)
- 主要言語
- C++
- スター
- 306
- フォーク
- 150
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
hi,
for Arduino C++ Strings some features are missing:
.readStringUntil(EOL) or perhaps a new .readln(): to read an entire textline all at once until end of line, discarding any EoL/CR
(e.g., text lines may have \n or \r\n at EoL, so readStringUntil('\n') or readStringUntil('\r') may fail or mess it up)
additionally also helpful:
.insert(substr, pos, len)
.delete(pos, len)
and especially
.TokenArg(token, delimiter1, delimiter2) // edit: optionally also just named .arg()
// returns the value of a token, e.g. for a String containing analog=1234;
`String myArg = myString.TokenArg("analog", "=", ";") ` would return 1234 as a String.
OTOH, IMO .compareTo() is ambiguous, it returns +/-/0 for after/before/ident but completely unclear if or what when neither and they are completely different. Better if it returned NAN/-1/0/+1 for notIn/smaller/ident/bigger.
PS,
just recalled that the WebServer lib provides a method `.arg()` which works somehow like the requested `String.TokenArg()` functionality:
```
int Analog1=0;
String myArg = webserver.arg("analog");
if (myArg != "") {
Analog1 = myArg.toInt();
}
```
That could be also used as a pattern for a String class TokenArg function.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
このIssueではArduino C++ Stringメソッドが挙げられていますが、ファイルやテストは提供されていません。まず既存のStringクラスとcompareTo/readの動作を確認し、その後、要求されているAPIと改行のセマンティクスをメンテナーと明確にしてください。実装前に、提案された変更のスコープと動作について合意されていれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- cpp
- 領域
- embedded-iot
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100