Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 4c122d2

Browse files
committed
[[ Foundation ]] Added MCListAppendSubstring.
1 parent 5a68322 commit 4c122d2

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

libfoundation/include/foundation.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,6 +1751,9 @@ bool MCListCreateMutable(char_t delimiter, MCListRef& r_list);
17511751
// Eventually this will accept any value type, but for now - just strings, names, and booleans.
17521752
bool MCListAppend(MCListRef list, MCValueRef value);
17531753

1754+
// Append a substring to the list.
1755+
bool MCListAppendSubstring(MCListRef list, MCStringRef value, MCRange range);
1756+
17541757
// Append a sequence of native chars as an element.
17551758
bool MCListAppendNativeChars(MCListRef list, const char_t *chars, uindex_t char_count);
17561759

libfoundation/src/foundation-list.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ bool MCListAppendNativeChars(MCListRef self, const char_t *p_chars, uindex_t p_c
138138
return MCStringAppendNativeChars(self -> buffer, p_chars, p_char_count);
139139
}
140140

141+
bool MCListAppendSubstring(MCListRef self, MCStringRef p_string, MCRange p_range)
142+
{
143+
return MCListAppendFormat(self, "%*@", &p_range, p_string);
144+
}
145+
141146
bool MCListIsEmpty(MCListRef self)
142147
{
143148
return self -> buffer == nil;

0 commit comments

Comments
 (0)