本文整理汇总了Java中com.intellij.util.io.IOUtil.isAscii方法的典型用法代码示例。如果您正苦于以下问题:Java IOUtil.isAscii方法的具体用法?Java IOUtil.isAscii怎么用?Java IOUtil.isAscii使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.io.IOUtil
的用法示例。
在下文中一共展示了IOUtil.isAscii方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: internParts
import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
@Nullable
protected SubstringWrapper[] internParts(String path, boolean forAddition) {
int start = 0;
boolean asBytes = forAddition && IOUtil.isAscii(path);
List<SubstringWrapper> key = new ArrayList<SubstringWrapper>();
SubstringWrapper flyweightKey = new SubstringWrapper();
while (start < path.length()) {
flyweightKey.findSubStringUntilNextSeparator(path, start);
SubstringWrapper interned = myInternMap.get(flyweightKey);
if (interned == null) {
if (!forAddition) {
return null;
}
myInternMap.add(interned = flyweightKey.createPersistentCopy(asBytes));
}
key.add(interned);
start += flyweightKey.len;
}
return key.toArray(new SubstringWrapper[key.size()]);
}
示例2: isAvailable
import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
@Override
public boolean isAvailable(@NotNull final Project project, final Editor editor, @NotNull final PsiElement element) {
if (!element.getLanguage().isKindOf(JavaLanguage.INSTANCE)) return false;
final Pair<PsiElement, Handler> pair = findHandler(element);
if (pair == null) return false;
String text = pair.first.getText();
return !IOUtil.isAscii(text);
}
示例3: indexOfIgnoreCase
import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
private int indexOfIgnoreCase(String name, int fromIndex, char p, int patternIndex, boolean isAsciiName) {
if (isAsciiName && IOUtil.isAscii(p)) {
char pUpper = toUpperCase[patternIndex];
char pLower = toLowerCase[patternIndex];
for (int i = fromIndex; i < name.length(); i++) {
char c = name.charAt(i);
if (c == p || toUpperAscii(c) == pUpper || toLowerAscii(c) == pLower) {
return i;
}
}
return -1;
}
return StringUtil.indexOfIgnoreCase(name, p, fromIndex);
}
示例4: convertToBytesIfAsciiString
import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
private static Object convertToBytesIfAsciiString(@NotNull String name) {
int length = name.length();
if (length == 0) return EMPTY;
if (!IOUtil.isAscii(name)) {
return name;
}
byte[] bytes = new byte[length];
for (int i = 0; i < length; i++) {
bytes[i] = (byte)name.charAt(i);
}
return bytes;
}