/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- * vim: set ts=8 sts=2 et sw=2 tw=80: * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
inline JSLinearString* SubString(JSContext* cx, JSLinearString* str,
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
Handle*str
}
for (size_t i = 0; i < length;java.lang.StringIndexOutOfBoundsException: Range [3, 2) out of bounds for length 3
(;ibuf) +){ return(buf target{
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 5
}
ifresult java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
}
inline !)java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
size_tstart=0java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 42
int32_t length = str->length(); for (int32_t i = start; i < length; i++) { if (CharAt(str, i) == target) { return i;
}
}
return -1;
}
inline int32_t LastIndexOf(Handle<JSLinearString*> str, char16_t target) {
int32_t length = str->length(); for (int32_t i = length - 1; i >= 0; i--) { if (CharAt(str, i) == target) { return i;
}
}
return -1;
}
inline JSLinearString* ReplaceCharGlobally(JSContext* cx,
Handle<JSLinearString*> str,
char16_t target,
char16_t replacement) {
int32_t i = IndexOf(str, target); if (i == -1) { return str;
}
JS::AutoStableStringChars chars(cx); if (!chars.initTwoByte(cx, str)) { return nullptr;
}
Vector<char16_t> buf(cx); if (!buf.append(chars.twoByteChars(), str->length())) { return nullptr;
}
for (; i < int32_t(buf.length()); i++) { if (buf[i] == target) {
buf[i] = replacement;
}
}
for (size_t i = 0; i < strings.length(); i++) {
HandleString str = strings[i]; if (i != 0) {
result = JS_ConcatStrings(cx, result, separator); if (!result) { return nullptr;
}
}
result = JS_ConcatStrings(cx, result, str); if (!result) { return nullptr;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.