• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/WebCore-7600.1.25/platform/graphics/

Lines Matching defs:string

61 static unsigned centerTruncateToBuffer(const String& string, unsigned length, unsigned keepCount, UChar* buffer, bool shouldInsertEllipsis)
67 NonSharedCharacterBreakIterator it(StringView(string).substring(0, length));
77 if (omitStart > 1 && string[omitStart - 1] != space && omitStart > 2 && string[omitStart - 2] == space)
81 while (omitStart > 1 && string[omitStart - 1] == space)
85 if ((length - omitEnd) > 1 && string[omitEnd] != space && (length - omitEnd) > 2 && string[omitEnd + 1] == space)
88 while ((length - omitEnd) > 1 && string[omitEnd] == space)
95 StringView(string).substring(0, omitStart).getCharactersWithUpconvert(buffer);
98 StringView(string).substring(omitEnd, length - omitEnd).getCharactersWithUpconvert(&buffer[omitStart]);
102 static unsigned rightTruncateToBuffer(const String& string, unsigned length, unsigned keepCount, UChar* buffer, bool shouldInsertEllipsis)
113 if (keepCount > 1 && string[keepCount - 1] != space && keepCount > 2 && string[keepCount - 2] == space)
117 while (keepCount > 1 && string[keepCount - 1] == space)
121 NonSharedCharacterBreakIterator it(StringView(string).substring(0, length));
125 StringView(string).substring(0, keepLength).getCharactersWithUpconvert(buffer);
132 static unsigned rightClipToCharacterBuffer(const String& string, unsigned length, unsigned keepCount, UChar* buffer, bool)
137 NonSharedCharacterBreakIterator it(StringView(string).substring(0, length));
139 StringView(string).substring(0, keepLength).getCharactersWithUpconvert(buffer);
144 static unsigned rightClipToWordBuffer(const String& string, unsigned length, unsigned keepCount, UChar* buffer, bool)
149 TextBreakIterator* it = wordBreakIterator(StringView(string).substring(0, length));
151 StringView(string).substring(0, keepLength).getCharactersWithUpconvert(buffer);
159 while (keepLength && string[keepLength - 1] == space)
166 static unsigned leftTruncateToBuffer(const String& string, unsigned length, unsigned keepCount, UChar* buffer, bool shouldInsertEllipsis)
173 NonSharedCharacterBreakIterator it(string);
178 if (adjustedStartIndex < length && string[adjustedStartIndex] != space
179 && adjustedStartIndex < length - 1 && string[adjustedStartIndex + 1] == space)
183 while (adjustedStartIndex < length && string[adjustedStartIndex] == space)
188 StringView(string).substring(adjustedStartIndex, length - adjustedStartIndex + 1).getCharactersWithUpconvert(&buffer[1]);
191 StringView(string).substring(adjustedStartIndex, length - adjustedStartIndex + 1).getCharactersWithUpconvert(&buffer[0]);
203 static String truncateString(const String& string, float maxWidth, const Font& font, TruncationFunction truncateToBuffer, bool disableRoundingHacks, float* resultWidth = nullptr, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0, bool alwaysTruncate = false)
205 if (string.isEmpty())
206 return string;
218 unsigned length = string.length();
225 truncatedLength = centerTruncateToBuffer(string, length, keepCount, stringBuffer, shouldInsertEllipsis);
228 StringView(string).getCharactersWithUpconvert(stringBuffer);
238 return string;
270 truncatedLength = truncateToBuffer(string, length, keepCount, stringBuffer, shouldInsertEllipsis);
292 truncatedLength = truncateToBuffer(string, length, keepCount, stringBuffer, shouldInsertEllipsis);
298 String StringTruncator::centerTruncate(const String& string, float maxWidth, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks)
300 return truncateString(string, maxWidth, font, centerTruncateToBuffer, !enableRoundingHacks);
303 String StringTruncator::rightTruncate(const String& string, float maxWidth, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks)
305 return truncateString(string, maxWidth, font, rightTruncateToBuffer, !enableRoundingHacks);
308 float StringTruncator::width(const String& string, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks)
310 return stringWidth(font, StringView(string).upconvertedCharacters(), string.length(), !enableRoundingHacks);
313 String StringTruncator::centerTruncate(const String& string, float maxWidth, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)
315 return truncateString(string, maxWidth, font, centerTruncateToBuffer, !enableRoundingHacks, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth);
318 String StringTruncator::rightTruncate(const String& string, float maxWidth, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)
320 return truncateString(string, maxWidth, font, rightTruncateToBuffer, !enableRoundingHacks, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth);
323 String StringTruncator::leftTruncate(const String& string, float maxWidth, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)
325 return truncateString(string, maxWidth, font, leftTruncateToBuffer, !enableRoundingHacks, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth);
328 String StringTruncator::rightClipToCharacter(const String& string, float maxWidth, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)
330 return truncateString(string, maxWidth, font, rightClipToCharacterBuffer, !enableRoundingHacks, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth);
333 String StringTruncator::rightClipToWord(const String& string, float maxWidth, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth, bool alwaysTruncate)
335 return truncateString(string, maxWidth, font, rightClipToWordBuffer, !enableRoundingHacks, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth, alwaysTruncate);