clang 20.0.0git
|
Enumerations | |
enum | Encoding { Encoding_UTF8 , Encoding_Unknown } |
Functions | |
Encoding | detectEncoding (StringRef Text) |
Detects encoding of the Text. | |
unsigned | columnWidth (StringRef Text, Encoding Encoding) |
Returns the number of columns required to display the Text on a generic Unicode-capable terminal. | |
unsigned | columnWidthWithTabs (StringRef Text, unsigned StartColumn, unsigned TabWidth, Encoding Encoding) |
Returns the number of columns required to display the Text , starting from the StartColumn on a terminal with the TabWidth . | |
unsigned | getCodePointNumBytes (char FirstChar, Encoding Encoding) |
Gets the number of bytes in a sequence representing a single codepoint and starting with FirstChar in the specified Encoding. | |
bool | isOctDigit (char c) |
bool | isHexDigit (char c) |
unsigned | getEscapeSequenceLength (StringRef Text) |
Gets the length of an escape sequence inside a C++ string literal. | |
Enumerator | |
---|---|
Encoding_UTF8 | |
Encoding_Unknown |
Definition at line 26 of file Encoding.h.
Returns the number of columns required to display the Text
on a generic Unicode-capable terminal.
Text is assumed to use the specified Encoding
.
Definition at line 44 of file Encoding.h.
References Encoding_UTF8, and Text.
Referenced by clang::format::BreakableLineCommentSection::BreakableLineCommentSection(), and columnWidthWithTabs().
|
inline |
Returns the number of columns required to display the Text
, starting from the StartColumn
on a terminal with the TabWidth
.
The text is assumed to use the specified Encoding
.
Definition at line 60 of file Encoding.h.
References columnWidth(), and Text.
Referenced by clang::format::BreakableBlockComment::BreakableBlockComment(), clang::format::BreakableLineCommentSection::BreakableLineCommentSection(), clang::format::getCommentSplit(), clang::format::getLastLineEndColumn(), clang::format::BreakableBlockComment::getRangeLength(), clang::format::BreakableLineCommentSection::getRangeLength(), clang::format::BreakableStringLiteral::getRemainingLength(), clang::format::BreakableStringLiteralUsingOperators::getRemainingLength(), and clang::format::getStringSplit().
|
inline |
Detects encoding of the Text.
If the Text can be decoded using UTF-8, it is considered UTF8, otherwise we treat it as some 8-bit encoding.
Definition at line 33 of file Encoding.h.
References Encoding_Unknown, Encoding_UTF8, and Text.
Gets the number of bytes in a sequence representing a single codepoint and starting with FirstChar in the specified Encoding.
Definition at line 77 of file Encoding.h.
References Encoding_UTF8.
Referenced by clang::format::BreakableLineCommentSection::BreakableLineCommentSection(), clang::format::getCommentSplit(), and clang::format::getStringSplit().
|
inline |
Gets the length of an escape sequence inside a C++ string literal.
Text should span from the beginning of the escape sequence (starting with a backslash) to the end of the string literal.
Definition at line 96 of file Encoding.h.
References isHexDigit(), isOctDigit(), and Text.
Referenced by clang::format::getStringSplit().
|
inline |
|
inline |