本文整理汇总了C++中StringObject::length方法的典型用法代码示例。如果您正苦于以下问题:C++ StringObject::length方法的具体用法?C++ StringObject::length怎么用?C++ StringObject::length使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringObject
的用法示例。
在下文中一共展示了StringObject::length方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Cell
// Arity: 2 -> 0
Ref * sysMD5( Ref * pc, class MachineClass * vm ) {
if ( vm->count != 1 ) throw Ginger::Mishap( "ArgsMismatch" );
StringObject input = Cell( vm->fastPop() ).asStringObject();
MD5Digester digester;
digester.update( input.getCharPtr(), input.length() );
vm->fastPush( vm->heap().copyString( pc, digester.digest().c_str() ) );
return pc;
}
示例2: extract_str
void ObjTracer::extract_str(const Object * const obj, ObjWriteMode flag)
{
if ( !check_obj ( obj ) )
{
ALOG(LOG_VERBOSE, "YWB", "OBJECT NULL");
fprintf(traceFile_, "\n");
return;
}
else
{
StringObject * so = (StringObject *) obj;
const u2 *s = so->chars();
if ( s == NULL )
{
ALOG(LOG_VERBOSE, "YWB","string is null");
return;
}
this->record_str( obj, s, sizeof(u2) * so->length(), flag );
}
}
示例3: extract_str
void Tracer::extract_str (Object * obj, ObjWriteMode flag)
{
if ( !check_obj ( obj ) )
{
FILE *f;
ALOG(LOG_VERBOSE, "YWB", "OBJECT NULL");
if (flag == OPC_OBJ || flag == OPC_STR)
f = fpObj_;
else if (flag == FUNC_STR || flag == FUNC_OBJ)
f = fpFuncs_;
else
{
ALOG ( LOG_VERBOSE, "YWB", "error in which file to write" );
return;
}
fprintf(f, "\n");
fflush(f);
return;
}
/*
if ( strcmp (obj->clazz->descriptor, "Ljava/lang/String;") != 0)
{
ALOG(LOG_VERBOSE,"YWB","NOT STRING");
return;
}
*/
{
StringObject * so = (StringObject *) obj;
const u2 *s = so->chars();
if ( s == NULL )
{
ALOG(LOG_VERBOSE, "YWB","string is null");
return;
}
this->record_str( s, sizeof(u2) * so->length(), flag );
}
}