Home | History | Annotate | Download | only in Format

Lines Matching defs:Encoding

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