Home | History | Annotate | Download | only in Format

Lines Matching refs:Encoding

1 //===--- Encoding.h - Format C++ code -------------------------------------===//
11 /// \brief Contains functions for text encoding manipulation. Supports UTF-8,
25 namespace encoding {
27 enum Encoding {
32 /// \brief Detects encoding of the Text. If the Text can be decoded using UTF-8,
33 /// it is considered UTF8, otherwise we treat it as some 8-bit encoding.
34 inline Encoding detectEncoding(StringRef Text) {
51 /// Encoding.
52 inline unsigned getCodePointCount(StringRef Text, Encoding Encoding) {
53 switch (Encoding) {
63 /// \p Encoding.
64 inline unsigned columnWidth(StringRef Text, Encoding Encoding) {
65 if (Encoding == Encoding_UTF8) {
79 /// text is assumed to use the specified \p Encoding.
81 unsigned TabWidth, Encoding Encoding) {
87 return TotalWidth + columnWidth(Tail, Encoding);
88 TotalWidth += columnWidth(Tail.substr(0, TabPos), Encoding);
95 /// codepoint and starting with FirstChar in the specified Encoding.
96 inline unsigned getCodePointNumBytes(char FirstChar, Encoding Encoding) {
97 switch (Encoding) {
142 } // namespace encoding