Fabric: non-const AttributedString::getFragments()

Summary:
This diff adds a non-const method to AttributedString that allows accessing a list of fragments by reference.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D20268040

fbshipit-source-id: cd0c8be126607b99686f7f596106b38fbe3da230
This commit is contained in:
Valentin Shergin
2020-03-09 16:36:44 -07:00
committed by Facebook Github Bot
parent f18358dda6
commit e1b8841c7a
2 changed files with 12 additions and 3 deletions
@@ -82,7 +82,11 @@ void AttributedString::prependAttributedString(
attributedString.fragments_.end());
}
const Fragments &AttributedString::getFragments() const {
Fragments const &AttributedString::getFragments() const {
return fragments_;
}
Fragments &AttributedString::getFragments() {
return fragments_;
}
@@ -73,9 +73,14 @@ class AttributedString : public Sealable, public DebugStringConvertible {
void prependAttributedString(const AttributedString &attributedString);
/*
* Returns read-only reference to a list of fragments.
* Returns a read-only reference to a list of fragments.
*/
const Fragments &getFragments() const;
Fragments const &getFragments() const;
/*
* Returns a reference to a list of fragments.
*/
Fragments &getFragments();
/*
* Returns a string constructed from all strings in all fragments.