本文整理汇总了C++中JString::charAt方法的典型用法代码示例。如果您正苦于以下问题:C++ JString::charAt方法的具体用法?C++ JString::charAt怎么用?C++ JString::charAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JString
的用法示例。
在下文中一共展示了JString::charAt方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
void JBasicPermission::init(JString name){
jint len = name.length();
if (len == 0) {
throw new JIllegalArgumentException("name can't be empty");
}
jchar last = (jchar)name.charAt(len - 1);
if (last == '*' && (len == 1 || name.charAt(len - 2) == '.')) {
wildcard = true;
if (len == 1) {
path = "";
} else {
path = name.substring(0, len - 1);
}
} else {
if (name=="exitVM") {
wildcard = true;
path = "exitVM.";
exitVM = true;
} else {
path = name;
}
}
}
示例2: write
void JWriter::write(JString str,jint off,jint len){
lock->lock();
jchar* cbuf;
if (len <= 1024) {
cbuf = writeBuffer;
} else {
cbuf = new jchar[len];
}
for (jint i=0;i<len;i++){
cbuf[i]=(jchar)str.charAt(off+i);
}
write(cbuf, 0, len);
if (len>1024) {
delete[] cbuf;
}
lock->unlock();
}
示例3: JIllegalArgumentException
JObjectStreamField::JObjectStreamField(JString name,JString signature,jbool unshared):JObject(getClazz()){
this->name=new JString(name);
this->signature=new JString(signature);
this->unshared=unshared;
this->field=NULL;
switch(signature.charAt(0)){
case 'Z':
type = JPrimitiveBoolean::getClazz();
break;
case 'B':
type = JPrimitiveByte::getClazz();
break;
case 'C':
type = JPrimitiveChar::getClazz();
break;
case 'S':
type = JPrimitiveShort::getClazz();
break;
case 'I':
type = JPrimitiveInt::getClazz();
break;
case 'J':
type = JPrimitiveLong::getClazz();
break;
case 'F':
type = JPrimitiveFloat::getClazz();
break;
case 'D':
type = JPrimitiveDouble::getClazz();
break;
case 'L':
case '[':
type = JObject::getClazz();
break;
default:
throw new JIllegalArgumentException("illegal signature");
}
setTypeString();
}