Lines Matching full:text
10 /// Contains functions for text encoding manipulation. Supports UTF-8,
31 /// Detects encoding of the Text. If the Text can be decoded using UTF-8,
33 inline Encoding detectEncoding(StringRef Text) { in detectEncoding() argument
34 const llvm::UTF8 *Ptr = reinterpret_cast<const llvm::UTF8 *>(Text.begin()); in detectEncoding()
35 const llvm::UTF8 *BufEnd = reinterpret_cast<const llvm::UTF8 *>(Text.end()); in detectEncoding()
41 /// Returns the number of columns required to display the \p Text on a
42 /// generic Unicode-capable terminal. Text is assumed to use the specified
44 inline unsigned columnWidth(StringRef Text, Encoding Encoding) { in columnWidth() argument
46 int ContentWidth = llvm::sys::unicode::columnWidthUTF8(Text); in columnWidth()
54 return Text.size(); in columnWidth()
57 /// Returns the number of columns required to display the \p Text,
59 /// text is assumed to use the specified \p Encoding.
60 inline unsigned columnWidthWithTabs(StringRef Text, unsigned StartColumn, in columnWidthWithTabs() argument
63 StringRef Tail = Text; in columnWidthWithTabs()
94 /// Text should span from the beginning of the escape sequence (starting with a
96 inline unsigned getEscapeSequenceLength(StringRef Text) { in getEscapeSequenceLength() argument
97 assert(Text[0] == '\\'); in getEscapeSequenceLength()
98 if (Text.size() < 2) in getEscapeSequenceLength()
101 switch (Text[1]) { in getEscapeSequenceLength()
108 while (I < Text.size() && isHexDigit(Text[I])) in getEscapeSequenceLength()
113 if (isOctDigit(Text[1])) { in getEscapeSequenceLength()
115 while (I < Text.size() && I < 4 && isOctDigit(Text[I])) in getEscapeSequenceLength()
119 return 1 + llvm::getNumBytesForUTF8(Text[1]); in getEscapeSequenceLength()