javaprims.h: Updated.
* gcj/javaprims.h: Updated. * java/lang/String.java (String(StringBuilder)): New constructor. * java/lang/natStringBuilder.cc: New file. * java/lang/StringBuilder.java: New file. * Makefile.in: Rebuilt. * Makefile.am (core_java_source_files): Added StringBuilder.java. (nat_source_files): Added natStringBuilder.cc. From-SVN: r99535
This commit is contained in:
parent
aeddae499f
commit
0cb757cc06
7 changed files with 1018 additions and 13 deletions
29
libjava/java/lang/natStringBuilder.cc
Normal file
29
libjava/java/lang/natStringBuilder.cc
Normal file
|
@ -0,0 +1,29 @@
|
|||
// Native methods for StringBuilder.
|
||||
|
||||
/* Copyright (C) 2005 Free Software Foundation
|
||||
|
||||
This file is part of libgcj.
|
||||
|
||||
This software is copyrighted work licensed under the terms of the
|
||||
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
|
||||
details. */
|
||||
|
||||
#include <config.h>
|
||||
#include <gcj/cni.h>
|
||||
#include <java/lang/StringBuilder.h>
|
||||
#include <java/lang/String.h>
|
||||
|
||||
jboolean
|
||||
java::lang::StringBuilder::regionMatches(jint offset, jstring other)
|
||||
{
|
||||
int len = other->count;
|
||||
int index = 0;
|
||||
jchar *sc = elements (value);
|
||||
jchar *oc = _Jv_GetStringChars (other);
|
||||
while (--len >= 0)
|
||||
{
|
||||
if (sc[offset++] != oc[index++])
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue