LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Locale.cpp
Go to the documentation of this file.
1 #include "llvm/Support/Locale.h"
2 #include "llvm/Support/Unicode.h"
3 
4 namespace llvm {
5 namespace sys {
6 namespace locale {
7 
8 int columnWidth(StringRef Text) {
9 #if LLVM_ON_WIN32
10  return Text.size();
11 #else
13 #endif
14 }
15 
16 bool isPrint(int UCS) {
17 #if LLVM_ON_WIN32
18  // Restrict characters that we'll try to print to the the lower part of ASCII
19  // except for the control characters (0x20 - 0x7E). In general one can not
20  // reliably output code points U+0080 and higher using narrow character C/C++
21  // output functions in Windows, because the meaning of the upper 128 codes is
22  // determined by the active code page in the console.
23  return ' ' <= UCS && UCS <= '~';
24 #else
26 #endif
27 }
28 
29 } // namespace locale
30 } // namespace sys
31 } // namespace llvm
size_t size() const
size - Get the string size.
Definition: StringRef.h:113
bool isPrint(int c)
Definition: Locale.cpp:16
bool isPrintable(int UCS)
Definition: Unicode.cpp:23
int columnWidth(StringRef s)
Definition: Locale.cpp:8
int columnWidthUTF8(StringRef Text)
Definition: Unicode.cpp:343