reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced

Declarations

include/llvm/Support/Unicode.h
   60 int columnWidthUTF8(StringRef Text);

References

lib/Support/Locale.cpp
   10   return llvm::sys::unicode::columnWidthUTF8(Text);
tools/clang/lib/Format/Encoding.h
   47     int ContentWidth = llvm::sys::unicode::columnWidthUTF8(Text);
tools/clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp
  872     if (!IsAggressive && llvm::sys::unicode::columnWidthUTF8(stringValue) < 2)
tools/clang/tools/extra/clangd/Format.cpp
  159         (std::string(columnWidthUTF8(PreComment), ' ') + CommentMarker + " ")
unittests/Support/UnicodeTest.cpp
   18   EXPECT_EQ(0, columnWidthUTF8(""));
   19   EXPECT_EQ(1, columnWidthUTF8(" "));
   20   EXPECT_EQ(1, columnWidthUTF8("a"));
   21   EXPECT_EQ(1, columnWidthUTF8("~"));
   23   EXPECT_EQ(6, columnWidthUTF8("abcdef"));
   25   EXPECT_EQ(-1, columnWidthUTF8("\x01"));
   26   EXPECT_EQ(-1, columnWidthUTF8("aaaaaaaaaa\x01"));
   27   EXPECT_EQ(-1, columnWidthUTF8("\342\200\213")); // 200B ZERO WIDTH SPACE
   33   EXPECT_EQ(1, columnWidthUTF8("\302\255"));
   35   EXPECT_EQ(0, columnWidthUTF8("\314\200"));     // 0300 COMBINING GRAVE ACCENT
   36   EXPECT_EQ(1, columnWidthUTF8("\340\270\201")); // 0E01 THAI CHARACTER KO KAI
   37   EXPECT_EQ(2, columnWidthUTF8("\344\270\200")); // CJK UNIFIED IDEOGRAPH-4E00
   39   EXPECT_EQ(4, columnWidthUTF8("\344\270\200\344\270\200"));
   40   EXPECT_EQ(3, columnWidthUTF8("q\344\270\200"));
   41   EXPECT_EQ(3, columnWidthUTF8("\314\200\340\270\201\344\270\200"));
   44   EXPECT_EQ(-2, columnWidthUTF8("\344"));
   45   EXPECT_EQ(-2, columnWidthUTF8("\344\270"));
   46   EXPECT_EQ(-2, columnWidthUTF8("\344\270\033"));
   47   EXPECT_EQ(-2, columnWidthUTF8("\344\270\300"));
   48   EXPECT_EQ(-2, columnWidthUTF8("\377\366\355"));
   50   EXPECT_EQ(-2, columnWidthUTF8("qwer\344"));
   51   EXPECT_EQ(-2, columnWidthUTF8("qwer\344\270"));
   52   EXPECT_EQ(-2, columnWidthUTF8("qwer\344\270\033"));
   53   EXPECT_EQ(-2, columnWidthUTF8("qwer\344\270\300"));
   54   EXPECT_EQ(-2, columnWidthUTF8("qwer\377\366\355"));
   58   EXPECT_EQ(-2, columnWidthUTF8("\370\200\200\200\200"));     // U+200000
   59   EXPECT_EQ(-2, columnWidthUTF8("\374\200\200\200\200\200")); // U+4000000