//----------------------------------------------------------------------------//
RenderedString DefaultRenderedStringParser::parse(
    const String& input_string,
    const Font* initial_font,
    const ColourRect* initial_colours)
{
    RenderedString rs;

    size_t epos, spos = 0;

    while ((epos = input_string.find('\n', spos)) != String::npos)
    {
        appendSubstring(rs, input_string.substr(spos, epos - spos),
                        initial_font, initial_colours);
        rs.appendLineBreak();

        // set new start position (skipping the previous \n we found)
        spos = epos + 1;
    }

    if (spos < input_string.length())
        appendSubstring(rs, input_string.substr(spos),
                        initial_font, initial_colours);

    return rs;
}
Exemplo n.º 2
0
void ScummEngine_v71he::o71_concatString() {
	int dst, size;

	int src2 = pop();
	int src1 = pop();

	size = resStrLen(getStringAddress(src1));
	size += resStrLen(getStringAddress(src2)) + 1;
	dst = setupStringArray(size);

	appendSubstring(dst, src1, 0, -1);
	appendSubstring(dst, src2, 0, -1);

	push(dst);
}
Exemplo n.º 3
0
void ScummEngine_v71he::o71_copyString() {
	int dst, size;
	int src = pop();

	size = resStrLen(getStringAddress(src)) + 1;
	dst = setupStringArray(size);

	appendSubstring(dst, src, -1, -1);

	push(dst);
}
Exemplo n.º 4
0
void ScummEngine_v71he::o71_appendString() {
	int dst, size;

	int len = pop();
	int srcOffs = pop();
	int src = pop();

	size = len - srcOffs + 2;
	dst = setupStringArray(size);

	appendSubstring(dst, src, srcOffs, len);

	push(dst);
}
Exemplo n.º 5
0
void SegmentedString::append(const String& string)
{
    appendSubstring(String { string });
}
Exemplo n.º 6
0
void SegmentedString::append(String&& string)
{
    appendSubstring(WTFMove(string));
}
Exemplo n.º 7
0
void SegmentedString::append(SegmentedString&& string)
{
    appendSubstring(WTFMove(string.m_currentSubstring));
    for (auto& substring : string.m_otherSubstrings)
        m_otherSubstrings.append(WTFMove(substring));
}
Exemplo n.º 8
0
void SegmentedString::append(const SegmentedString& string)
{
    appendSubstring(Substring { string.m_currentSubstring });
    for (auto& substring : string.m_otherSubstrings)
        m_otherSubstrings.append(substring);
}