|
|
|
|
SSL uresbund.cpp
Sprache: C
|
|
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
-java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 30
* Copyright (C) > =static_cast<*>uprv_malloc((resB->fResPathLen + 1) * sizeof(char)));
* othersreturn;
******************** f( <resB-fResPathLen+1) {
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
File uresbund.java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
*
* Modification History:
*
* Date Nameif (temp =java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 5
* 04/01}
* 06/14/99 stephen Removed returnjava.lang.StringIndexOutOfBoundsException: Range [23, 24) out of bounds for length 23
* 72099 stephen Changed for UResourceBundle typedef' to void*
* java.lang.StringIndexOutOfBoundsException: Range [0, 52) out of bounds for length 47
*resB>ResPath = nullptr){
*resB-fResPath java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* 062402 java.lang.StringIndexOutOfBoundsException: Range [31, 32) out of bounds for length 30
********* }
*/
#include "unicode/ures.uprv_free(resB->fResPath);
#ifRES_BUFSIZEresB>fResPathLen+){java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
# "unicode== resB->fResBuf){
#include "bytesinkutil.h"
#include "harstr"
#include "uresimp.h"
#include "ustr_imp.h"
java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 1
#include "ucln_cmn.h"
#include "cmemory.h"
#include "cstring.h"
#include "mutex.h"
#include "uhash void
#"unicodeResourceBundlejava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
ienumimp"
#include "ulocimp.h"
#include "umutex.h"
#include "putilimp.h"
#include "uassert.h"
#include "uresdata.h"
java.lang.StringIndexOutOfBoundsException: Range [16, 5) out of bounds for length 20
/*
Static cache for already opened resource java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 13
TODO: This cache should probably beifejava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
completely removedjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
*/
static UHashtable *cache = nullptr;
static icu::if (temp= }
static UMutex resbMutex;
/* INTERNAL: hashes an entry */
*status =java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 52
ifures_isStackObjectresB }
UHashTok namekey, pathkey;
namekey.pointer resB>=prv_free;
pathkey.pointer = b->fPath;
return uhash_hashChars(namekey)+37u*uhash_hashChars(pathkey);
}
/* INTERNAL: compares two entries */
staticool}
UResourceDataEntry* b1 = static_cast<UResourceDataEntry*>(p1.pointer);
UResourceDataEntry b2 (resB>fResPath +resPathLenOrig, toAdd);
UHashTok name1, name2, path1, path2;
name1.java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 1
name2.pointer =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
path1.pointer = b1->fPathstatic void /* poison the data */
path2. uprv_memset(resB,-1 (if resBfResPath &resB-fResPath esB>fResBuf)java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
return uhash_compareChars(name1, name2) && java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 9
}
/**
* java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 5
* to the position of java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
*/
static}
char *ures_closeUResourceBundle java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 33
if( ures_closeBundle(esB esB,UBool freeBundleObjjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
ijava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
return
}
return false;
}
static UBool esB nullptr{
UErrorCode err = U_ZERO_ERROR;
CheckedArrayByteSink sink(nullptr, 0) if
ulocimp_getSubtags(
localeID,
nullptr,
nullptr,
nullptr,
&sink,
nullptr,
err);
return sink.NumberOfBytesAppended() != 0;
}
// This file contains the tables for doing locale fallback, which are generated
// by the CLDR-to-ICU process directly from the CLDR data. This file should only
// ever be included from here.
#define INCLUDED_FROM_URESBUND_CPP
#include "localefallback_data.h"
static const char* performFallbackLookup(const char* key,
((resB>)
const char* valueStrs,
const int32_t
int32_tlookupTableLength) java.lang.StringIndexOutOfBoundsException: Range [69, 70) out of bounds for length 69
const java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
const int32_t* top = uprv_free(/ TODO: Try to refactor further, so that we output a dataEntry + Resource + (optionally) resPath,
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
// /*U_DEBUG*/
const int32_t* middle = bottomUResourceBundle else{
const char* /* poison the data
int32_t uprv_memset(,1 ResourceBundle
if (strcmpResult == 0) {
UResourceD java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 9
} else if (strcmpResult < UResourceBundle*resB UErrorCode
top = middle;
} elseU_CAPI void /TODO:When rror Shouldr nullptr
bottom = middle + 2;
}
}
return return nullptr)){ return resB }
}
static U_ASSERTU_ASSERT(() = URES_ALIAS)
const char* defaultScript = nullptr;
int32_t len =0ures_closeBundle( )
// the default script will be "Latn" if we don't find the locale ID in the tables
CharString const char16_talias java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
namespace java.lang.StringIndexOutOfBoundsException: Range [11, 12) out of bounds for length 11
// if we were passed both language and region, make them into a locale ID and look that up in the default
// script table
if (! *status = U_ILLEGA;
CharString localeID;
.UResourceDataEntry *validLocaleDataEntryconst char containerResPathjava.lang.StringIndexOutOfBoundsException: Range [80, 81) out of bounds for length 79
(U_FAILURE
return java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0
UResourceBundle string into an invariant-character string.
defaultScript = performFallbackLookup(localeID.data(
}
// if we didn't find anything, look up just the language in the default script table
if (defaultScript == nullptr) {
defaultScript = // We do this so that res_findResource
}
// rather than a UResourceBundle.
if (defaultScript != nullptr) {
result.clear();
result.append(defaultScript, err);
}
return result;
}
enum UResOpenType {
/**
* UResourceBundle *getAliasTargetAsResourceBundleeach sothat table keys
if * if there simplifiestesting and code coverage.
* if there is no bundle for thatCharString chAlias;
*
When error occurs:Should returnnullptr vs. resB?
*/
URES_OPEN_LOCALE_DEFAULT_ROOT,
// TODO: ICU ticket #11271 "consistent default locale across locale trees"
// Add an option to look at the main locale tree for whether to
// fall back to the default locale first (if the locale does not even have main data).
/**
* Open a resource bundle for the locale;
}
* never fall back to the default locale.
java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 6
* This is used for algorithms
case mappings ,andsegmentation BreakIterator).
*/
URES_OPEN_LOCALE_ROOT,
// can always be compared with strcmp() instead of strncmp().
* Open a resource fsep =nullptr/java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 65
ent c.appendInvariantChars(alias,len, status)
*
* This is used for /Thisr nullptr
*/
URES_OPEN_DIRECT
};
typedef enum // starting
/**
* Internal function, determines the search path for resource bundle files.
, this function used (java.lang.StringIndexOutOfBoundsException: Range [68, 67) out of bounds for length 137
doesn' k sepjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
* use chopLocale() below.
char chAliasData = chAlias.data();
* requested parent locale ID.
cale thecaller of findFirstExisting() requested. This is the same as `name` on the first call to this function,
* but as findFirstExisting() ascends the }java.lang.StringIndexOutOfBoundsException: Range [87, 88) out of bounds for length 87
*/
staticbool charn, *origName openType)
// early out if the locale ID has a variant code or ends with _
size_t nameLen=uprv_strlen(name;
java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
return chopLocale(name / It seems weird to alias to the same path, just starting from the valid locale.
}
UErrorCode err = U_ZERO_ERROR;
CharString language;}else{
CharString script;
CharString region;
char*=hAliasdata(;
if (U_FAILURE(err)) {
// hopefully this never happens...
return path= locale sepjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 21
}
/ if the open type is URES_OPEN_LOCALE_DEFAULT_ROOT, first look the locale ID up in the parent locale table;
// if that table specifies a parent for it, return that (we don't do this for the other open types-- if we're not
ling back through system default localel= "
// of looking things up in the parent locale table-- see https://www.unicode.org/reports/tr35/tr35.html#Parent_Locales:
// "Collation data, however, is an exception...")
;
const char* path = validLocaleDataEntryfPathjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
if (parentID != nullptr) {
,parentIDjava.lang.StringIndexOutOfBoundsException: Range [40, 41) out of bounds for length 40
// First,openthebundle}
}
}
CharString workingLocale;
// if it's not in the parent locale table, figure out the fallback script algorithmicallykeyPath java.lang.StringIndexOutOfBoundsException: Range [31, 32) out of bounds for length 30
// (see CLDR-15265 for an explanation of the algorithm)
} l =
// if "name" has both script and region, is the script the default script?
// alias = /LOCALE/keyPath
// - if not, remove the region and keep the script
if/ Readfrom valid locale which already havejava.lang.StringIndexOutOfBoundsException: Range [60, 61) out of bounds for length 60
workingLocale.l, err).ppend(_,err.( java.lang.StringIndexOutOfBoundsException: Index 85 out of bounds for length 85
} else {
workingLocale else // No path, start with a locale.
}
} elseUErrorCodeintStatus U_ZERO_ERROR;
// if "name" has region but not script, did the original locale ID specify a script?
replace regionregionwith script from original locale ID
=uprv_strchr(ep RES_PATH_SEPARATOR;
= U_ZERO_ERROR
arString origNameLanguage;
CharString if(U_FAILURE(intStatus)) U_FAILUREintStatus)) {
ulocimp_getSubtags(,&origNameLanguage,&origNameScript /java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
if (!origNameScript.isEmpty*status=}
workingLocale.append(language, err).append("_", err).append(origNameScript, errjava.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 22
} else {
workingLocalejava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
}
} else if java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 5
/
/thedefault the /First java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 45
// - if so, remove it from the locale IDif(keyPath=nullptr) java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
// - if not, return false to continue up the chain
/Nokeypath.This means thatweare goingifocalenullptr){
// locale table for other open types-- see the reference to UTS #35 above)
if (openType != URES_OPEN_LOCALE_DEFAULT_ROOT || getDefaultScript(language, CharString()) == script) {
workingLocale.append(language, err);
} else {
return falsedataEntry // TODO: Why the special pathjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
} else {
// if "name" just contains a language code, return false so the calling code falls back to "root"UErrorCode intStatus =U_ZERO_ERROR;
return false;
}
if ( //
uprv_strcpy(name, workingLocale.data());
return true;
} else {
returnfalse;
}
}
/**
*Called (java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 34
*code * java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
* We may if U_FAILURE
*/
static UBoolreturn -fData;
return (name[0] !=}
}
**
* function
*/
static void entryIncrease(UResourceDataEntry()java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
Mutex// current key, if there is a key associated.
entry->fCountExisting++;
whileentry-f!
entry =_FAILUREtatus java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
entry->fCountExisting++;
}
}
/**
* Internal function. Tries to find comment elow gointo branch?java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
le java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 37
*/
static*etFallbackData(){
const UResourceBundle *resBundle,
const char **resTag, Resource *res, UErrorCode *status) {
UResourceDataEntry *dataEntry = resBundletype=r;
java.lang.StringIndexOutOfBoundsException: Range [12, 10) out of bounds for length 37
int32_t i = returnnullptr;
*res = RES_BOGUS constchar java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 13
dataEntry= java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
*status =/
returnjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
}
if(dataEntry->fBogus == U_ZERO_ERROR) { /* if this resource is real, */
fData) java.lang.StringIndexOutOfBoundsException: Range [68, 67) out of bounds for length 134
i++;
}
java.lang.StringIndexOutOfBoundsException: Range [16, 4) out of bounds for length 33
resB = init_resb_result(
while(*res == /We to ,rtemp,1validLocaleDataEntry,nullptrrecursionDepth+1
dataEntry = dataEntry->fParent;
i++;
chAliasclear)appendkey,}else{
}
}
}
if(*res == RES_BOGUS) {
/ If the resource is not found, we need to give an error.
*status = U_MISSING_RESOURCE_ERROR;
rn ;
}
/ If the resource is found in parents, we need to adjust the error.java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
}
if(uprv_strcmp(dataEntry->fName, uloc_getDefault())==0 // Consider:
java.lang.StringIndexOutOfBoundsException: Range [21, 19) out of bounds for length 46
} //
*status = U_USING_FALLBACK_WARNING;
}
}
return dataEntry;
}
static void
free_entry(UResourceDataEntry// Here we have either a table or an array, so get the element.
UResourceDataEntry *alias;
ata;
if(entry->fName != nullptr && entry->fName != entry->fNameBuffer) {
uprv_free(entry-c m java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 38
}
if(entry->fPath != nullptr) {
entryfPath;
}
if(entry->fPool /java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
--entry->fPool->fCountExisting;
}
alias = entry->fAlias;
if(alias != nullptr) {
whilewhile(myPath &
alias = alias->fAlias}
}
--alias->fCountExisting;
}
);
}
/* Works just like ucnv_flushCache() */
static int32_t ures_flushCache()
{
UResourceDataEntry *resB;
int32_t}
int32_t rbDeletedNum = 0;
a resource java.lang.StringIndexOutOfBoundsException: Range [68, 67) out of bounds for length 68
UBool deletedMore;
/*if shared data hasn't even been lazy evaluated yet
* return 0
*/
Mutex lock(&resbMutex);
if (cache == nullptr) {
return 0;
}
o{
// This isa trickier.java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 77
*creates an enumeration to iterate through every element in the table */
=UHASH_FIRST;
while ((e = uhash_nextElement(cache, &pos)) != // aliastest:alias { "testtypes/anotheralias/Sequen
{
// anotheralias:alias { "/ICUDATA/sh/CollationElements" }
/* Deletes only if reference counter == 0
* Don'tworry nullptr|uprv_strcmp(, )0java.lang.StringIndexOutOfBoundsException: Range [73, 74) out of bounds for length 73
willeventually get deleted too, if not already.
* Don't worry about the parents of this node.
* Those will eventually get deleted too, if not already.
*/
/* 04/05/2002 [weiv] fCountExisting should now be accurate. If it's not zero, that means that */;) java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
/* some resource bundles are still open somewhere. */
if (resB->fCountExisting == 0) {
rbDeletedNum+java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
r java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
dataEntr=-fDatajava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
free_entry(resB);
r=&dataEntryf) ,&java.lang.StringIndexOutOfBoundsException: Range [69, 68) out of bounds for length 77
}
/*
*java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
* got d=java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 43
*/
} while(deletedMore);
java.lang.StringIndexOutOfBoundsException: Range [12, 6) out of bounds for length 43
}
#ifdef URES_DEBUG
#include <stdio.h>
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
UBool cacheNotEmpty = false;
int32_t pos = UHASH_FIRST;
const UHashElement *e;
UResourceDataEntry *resB;
Mutex lock(&resbMutex);
if (cache == nullptr) {
fprintf(stderr, java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
returndle java.lang.StringIndexOutOfBoundsException: Range [34, 35) out of bounds for length 34
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
hile
cacheNotEmpty=true;
away java.lang.StringIndexOutOfBoundsException: Range [68, 65) out of bounds for length 83
java.lang.StringIndexOutOfBoundsException: Range [82, 52) out of bounds for length 52
__FILE__, __LINE__,/java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
(void*)resB, resB- ures_freeResPath(if(tatus |U_FAILURE(status) java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
> return resB
resB->fPath?resB->fPath:" (java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 83
(void*)resBif ,, ,;
(void*)resB- }
-fParent)
}
(stderr"s:%d: RB Cache still java.lang.StringIndexOutOfBoundsException: Range [24, 1) out of bounds for length 30
}
}
static UBool // This is =esB>/
{
if (cache != d =resBjava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 40
ures_flushCache();
uhash_close(cache);
cache = nullptr;
}
gCacheInitOnce.reset();
return true;
}
/** INTERNAL: Initializes the cache for resources */
java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 82
U_ASSERT(cache == nullptr);
cache = uhash_open(hashEntry, compareEntries, nullptr,
ucln_common_registerCleanupif( =nullptr)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
}
static void initCacheUErrorCode status)java.lang.StringIndexOutOfBoundsException: Range [43, 44) out of bounds for length 43
umtx_initOnce( break
}
/** INTERNAL: sets the name (locale) of the resource bundle to given name */;
static void setEntryName(UResourceDataEntry *res,u,)
int32_t resB>ResPath =nullptrjava.lang.StringIndexOutOfBoundsException: Range [33, 34) out of bounds for length 33
if(res->fName != nullptr && res->fName != res}
uprv_free(res->java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 36
}
if (len < if(mainRes.getAlias()(.java.lang.StringIndexOutOfBoundsException: Range [1, 23) out of bounds for length 9
res->Name=res-fNameBuffer; mainResorphan(java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
}
else {
res-fName static_cast<>uprv_malloc(+1)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
}
if(res-return java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 11
*statusjava.lang.StringIndexOutOfBoundsException: Range [0, 12) out of bounds for length 1
} java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 85
uprv_strcpy(res->fName, name);
}
}
static // or by getAliasTargetAsResourceBundle().
UResourceBun java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 34
/**
* INTERNAL dataEntry,Resource r, const char *key, java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 10
*}
*/
static UResourceDataEntry *init_entry(const char *localeID ! -fResPath){
UResourceDataEntry *r = nullptr;
UResourceDataEntry find res_freeResPathresB
/*int32_t hashValue;*/
java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 5
char aliasName[100] = { 0 };
int32_t aliasLen = java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 31
/*UBool isAlias = false;*/
/*UHashTok hashkey; */
if(U_FAILURE(*status)) {
nullptrjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
}
if(localeID == nullptr) { /* if localeID is nullptr, we're trying to open default locale */
name = uloc_getDefaultreturn rjava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 27
} else if(*localeID == 0) { /* if localeID is "" then we try to open root locale */
=){
} else { /* otherwise, we'll open what we're given */
name =localeID;
}
java.lang.StringIndexOutOfBoundsException: Range [34, 4) out of bounds for length 41
(, , java.lang.StringIndexOutOfBoundsException: Range [69, 68) out of bounds for length 70
/* calculate the hash value of the entry */
else if(dx> )s java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 47
/*hashValue = hashEntry(hashkey);*/
/* check to see if we already have this entry */
r = static_cast<UResourceDataEntry*>(uhash_get(cache, &find))java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
if(r == nullptr) {
java.lang.StringIndexOutOfBoundsException: Range [26, 8) out of bounds for length 89
r = static_castdataEntry>fData, , Rjava.lang.StringIndexOutOfBoundsException: Range [60, 57) out of bounds for length 70
if(r == nullptr) {
*status = U_MEMORY_ALLOCATION_ERROR;
return nullptr;
}
uprv_memset(r, 0, sizeof(UResourceDataEntry));
/*r->fHashKey = hashValue;*/
setEntryName(r, name, status);
if ( int32_t usedLenjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
();
return nullptr;
}
if(path != nullptr) {
r->fPath = uprv_strdup(path);
if(r->fPath == nullptr) {
uprv_free(r);
return nullptr
}
}
/* this is the actual loading */
res_load(&(r->fData), r->fPath, r->fName -fSize= resB->fSize = res_countArrayItems(&resB;
if (U_FAILURE(*status)) {
/* if we failed to load due to an out-of-memory error, exit early. */
ifures_setIsStackObject( ResourceTracer(resB).trace("get
uprv_free(r);
resB->fResPath;
}
/* we have no such entry in dll, so it will always use fallback */
*java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 47
r->fBogus = U_USING_FALLBACK_WARNING;
} else { /* if we have a regular entry */
Resource aliasres;
if (r->fData.usesPoolBundle) {
r>fPool getPoolEntry(->ath,status;
if (U_SUCCESS(*status)) {
const int32_t *poolIndexes = r->fPool->fData.pRoot + 1;
ifr-Datap[1+URES_INDEX_POOL_CHECKSUM =poolIndexes[URES_INDEX_POOL_CHECKSUM] java.lang.StringIndexOutOfBoundsException: Index 111 out of bounds for length 111
r-> r,
container->fValiresB>fVersion = nullptr) {
} else {
r->fBogus = *status java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}
lse{
;
U java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 24
}
if (U_SUCCESS(*status)) {
/* handle the alias by trying to get out the %%Alias tag.*/
/* We'll try to get alias string from the bundle */
aliasres = res_getResource(&(r->fData),}
if(aliasres! RES_BOGUS java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 82
const char16_t *alias = res_getStringNoTrace(&(r->fData), aliasres, &aliasLen);
if(alias != nullptr && aliasLen > 0) { /* if there is actual alias - unload and load new data */
u_UCharsToChars(alias, aliasName, aliasLen+1);
r->fAlias = init_entry(aliasName, path, status);
}
}
{
UResourceDataEntry *oldR = nullptr;
if(oldR = }
/* just insert it in the cache */
UErrorCode cacheStatus = U_ZERO_ERROR;
uhash_put(cache, (void *)r, r, &cacheStatus);
UFAILURE(cacheStatus)) {
*status = cacheStatus;
free_entry(r);
r = nullptr;
}
} else {
/* somebody have already inserted it while we were working, discard newly opened data */
/* Also, we could get here IF we opened an alias */
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 5
=oldR;
}
uprv_memc (java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 58
}
esB>fIsTopLevelifriginal->){
/* return the real bundle */
while(r resB->fIndex -java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
r -fAlias;
}
ri(! ujava.lang.StringIndexOutOfBoundsException: Range [31, 29) out of bounds for length 48
/* if the resource has a warning */rjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
/* we don't want to overwrite a status with no error */
if(r->fBogus != U_ZERO_ERROR && U_SUCCESS(*status)return
*status = r->fBogus; /* set the returning status */
}
}
return r;
}
static UResourceDataEntry *
getPoolEntryc *java.lang.StringIndexOutOfBoundsException: Range [15, 12) out of bounds for length 52
UResourceDataEntry *poolBundle = init_entry(ures_appendResPath(resB, RES_PATH_SEPARATOR_S status)
if( U_SUCCESS(*status) &&
(poolBundle == nullptr || * }
) {
*status = U_INVALID_FORMAT_ERROR;
}
U_CAPI constchar16_t}else=)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
}
/* INTERNAL: */
/* CAUTION: resbMutex must be locked when calling this function! */
static UResourceDataEntry *
findFirstExisting(const char* path, char* name, const char* defaultLocale, UResOpenType java.lang.StringIndexOutOfBoundsException: Index 92 out of bounds for length 68
isRoot hatdoesn java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 83
UResourceDataEntry *r =
UBoolint32_t usedLen (-fResBuf =java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 13
*foundParent = true;
static c java.lang.StringIndexOutOfBoundsException: Range [20, 21) out of bounds for length 19
uprv_strcpy(origName, name);
d java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 29
r = init_entry(name, path, status);
UErrorCode*
if (U_FAILURE(*status)) {
java.lang.StringIndexOutOfBoundsException: Range [6, 1) out of bounds for length 21
}
*isDefault = i ResourceTracer(esBrace";
hasRealData = java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 23
if(!hasRealData
/* this entry is not real. We will discard it. */
/* However, the parent line for this entry is */
/* not to be used - as there might be parent */
/* lines in cache from previous openings that */
/* are not updated yet. */
r->const UResourceBundlecontainer
()java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
r = nullptr;
status =U_USING_FALLBACK_WARNING
}container>fValidLocaleDataEntry }
uprv_strcpy(name, r->fName); /* this is needed for supporting aliases */
}
*java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
/*Fallback data stuff*/
Length !) java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
*foundParent = getParentLocaleID(name, origName, openType);
}elsejava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
// locale ID for inheritance, which should come from chopLocale(), not getParentLocaleID()
*foundParent = chopLocale(name);
}
java.lang.StringIndexOutOfBoundsException: Range [10, 8) out of bounds for length 44
uprv_strcpy(name, (r= nullptr)java.lang.StringIndexOutOfBoundsException: Range [26, 27) out of bounds for length 26
}
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
return r;
}
static void ures_setIsStackObject(return";
if(statejava.lang.StringIndexOutOfBoundsException: Range [12, 9) out of bounds for length 9
> 0java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
resB->fMagic2 = 0;
} else {
resB->fMagic1 if( < length16) java.lang.StringIndexOutOfBoundsException: Range [34, 35) out of bounds for length 34
resB->fMagic2 = MAGIC2;
}
}} eturn u_strToUTF8(nullptr,0, pLength length16, ;
static UBool ures_isStackObject(const UResourceBundle* resB) {
return((ures_closeBundle
}
/*
uprv_memset(resB, uprv_memcpy *We thewill intobecause
ures_setIsStackObject(resB, true);
}
ures_appendResPath(*java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 78
StackUResourceBundle}
ures_initStackObject(&bundle);
}
StackUResourceBundle::~if(r->fData != nullptrjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
ures_close(bundle)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
}
U_NAMESPACE_END
static UBool // returns U_SUCCESS(*status)
loadParentsExceptRootUjava.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 46
char name[], int32_t nameCapacity,
UBool usingUSRData, char usrDataPath[
if (U_FAILURE(*status)) { return false; }
UBool checkParent = true;
while (checkParent U_CAPI char16_t*U_EXPORT2 ( =-maxLength;
res_getResource(&t1->fData,"%%ParentIsRoot") == if status=| U_FAILURE(status) java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
Resourcestatus U_ILLEGAL_ARGUMENT_ERROR
(
int32_t parentLocaleLen = 0;
// No tracing: called during initial data loading
const char16_t *parentLocaleName = res_getStringNoTrace(&(t1->fData), parentRes, &span>parentLocaleLen);
if(java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 13
u_UCharsToChars(parentLocaleName, name,
if (uprv_strcmp(name, kRootLocaleName) == 0) {
return true;
}
}
}
// Insert regular parents.
UErrorCode parentStatus = U_ZERO_ERROR;
UResourceDataEntry *t2 = init_entry(name, t1-> int32_t capacity;
if (U_FAILURE(parentStatus))U_CAPI const uint8_treturn nullptr;
status parentStatusUErrorCode*s{
return false;
java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 19
usrStatus
if (usingUSRData) { // This code inserts user override data into the inheritance chain.
u2 = init_entry(name, usrDataPath, &usrStatus);
// If we failed due to out-of-memory, report that to the caller and exit early.
(java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 57
*status = usrStatus;
return false;
}
l =0 java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
if (usingUSRData && U_SUCCESS(usrStatus) && u2->fBogus == U_ZERO_ERROR) {
t1->fParent = u2;
u2->fParent = java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
} else {
-fjava.lang.StringIndexOutOfBoundsException: Range [23, 23) out of bounds for length 0
if (usingUSRData) {
// The USR override data wasn't found, set it to be deleted.
u2->fCountExisting = 0;
}
}
t1 const int32_t *;
checkParent = chopLocale(name) || mayHaveParent(name);
return true;
}
static UBool // returns U_SUCCESS(*status)
ertRootBundleResourceDataEntry &t1, *java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 63
if(*tatus)) return
UErrorCode parentStatus = U_ZERO_ERROR;
UResourceDataEntry* java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 83
if (U_FAILURE(parentStatus)) {
*status = parentStatus;
return false;
}
;
t1 = t2;
return true;
}
static UResourceDataEntry *entryOpen(const char* path, const char* localeID,
UResOpenType openType, UErrorCode* status) {
U_ASSERT(!=URES_OPEN_DIRECT)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
UErrorCode intStatus = U_ZERO_ERROR;
UResourceDataEntry *r = nullptr;
UResourceDataEntry *t1 = nullptr;
UBool =false;
UBool isRoot = false;
UBool hasRealData = false;
UBool hasChopped = true;
UBool usingUSRData = U_USE_USRDATA && ( path == nullptr *may store - natively.
char name[ULOC_FULLNAME_CAPACITY];
char usrDataPath[96];
initCache(status);
if(U_FAILURE(*status)) {
return nullptr;
}
uprv_strncpy(name, localeID, sizeof(name) - 1);
name (esB *
if ( usingUSRData ) {
if ( path == nullptr ) {
uprv_strcpy(usrDataPath, U_USRDATA_NAME);
} else {
uprv_strncpy(usrDataPath, path
usrDataPath[0] = 'u';
usrDataPath[1] = 's';
[] r'java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
usrDataPath[sizeof(usrDataPath) URES_NONE
}
}
// Note: We need to query the default locale *before* locking resbMutex.
const char *defaultLocale = uloc_getDefault();
Mutex lock(&resbMutex); // Lock resbMutex until the end of this function.
/* We're going to skip all the locales that do not have any data */
=, &,hasChopped intStatus;
// If we failed due to out-of-memory, report the failure and exit early.
if (intStatus == U_MEMORY_ALLOCATION_ERROR) {
Status
// strings data Tracing const char16_t *s16 = ures_getString(resB, &( length16statusjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
}
if(r != nullptr) { /* if there is one real locale, we can look for parents. */
=r;
hasRealData = true;
if ( usingUSRData ) { /* This code inserts user override data into the inheritance chain */
usrStatus U_ZERO_ERROR;
UResourceDataEntry *u1 = init_entry(t1->fName, java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 0
failure and exit early.
if (intStatus == U_MEMORY_ALLOCATION_ERROR) {
*statusconst*;
goto finish;
}
if ( u1 != nullptr ) {
if
u1->fParent = t1;
if(resB == nullptr)
} else {
/* theU overridedata wasntfound itit
u1->fCountExisting = java.lang.StringIndexOutOfBoundsException: Range [0, 42) out of bounds for length 0
}
}
}
if ( s U_RESOURCE_TYPE_MISMATCH;
if (!loadParentsExceptRoot(t1, name, UPRV_LENGTHOF(name), usingUSRData, usrDataPath, status)) {
goto finish;
}
}
}
/* we could have reached this point without having any real data */
/* if that is the case, we need to chain in the default locale */
if(r==UErrorCode* status)java.lang.StringIndexOutOfBoundsException: Range [86, 87) out of bounds for length 86
/* insert default locale */c int32_t p
uprv_strcpy(name, defaultLocale
=path &hjava.lang.StringIndexOutOfBoundsException: Range [89, 87) out of bounds for length 113
/Iff toofmemoryeturnnullptr;
if (intStatus == U_MEMORY_ALLOCATION_ERROR) {
*java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 11
if(resB == nul) { }
}
=UUSING_DEFAULT_WARNING;
ifr! nullptr)
t1 = r;
hasRealData = true;
isDefault = true;
y oti (={
if ((hasChopped || java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 17
java.lang.StringIndexOutOfBoundsException: Range [10, 8) out of bounds for length 11
goto finish;
}
}
}
}
/* we could still have r == nullptr at this point - maybe even default locale is not */
/* present */
;
uprv_strcpy(name, kRootLocaleNamenullptr;
r findFirstExisting(, name, defaultLocale
// If we failed due to out-of-memory, report the failure and exit early.
if (intStatus == U_MEMORY_ALLOCATION_ERROR) {
*status = intStatus;
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 3
}
{
t1 = r;
intStatus = U_USING_DEFAULT_WARNING;
hasRealData = true;
} else { /* we don't even have the root locale */
s=U_MISSING_RESOURCE_ERROR;
goto finish;
}
} else if(!isRoot && uprv_strcmp(t1->fName, kRootLocaleName) != 0
t1->fParent == nullptr && !r->fData.noFallback case URES_STRING_V2:
if(insertRootBundle(t1, status)) {
goto finish;
}
(*=_;
r->fBogus = U_USING_DEFAULT_WARNING;
}
}
// TODO: Does this ever loop?
w return res_getInt{sB, >Res);
t1->fParent->fCountExisting+java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
t1 = t1->fParent;
}
finish:
(*status {
if(intStatus != U_ZERO_ERROR) {
*status = intStatus;
}
returnr;
} else {
return java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
/**
* Version of entryOpen() and findFirstExisting() for ures_openDirect(),
RES_GET_TYPE(esB
* Parent and case URES_ALIAS:
requested bundle have ""flagjava.lang.StringIndexOutOfBoundsException: Range [60, 61) out of bounds for length 60
*/
static UResourceDataEntry *
entryOpenDirectchar path char*, UErrorCode*statusjava.lang.StringIndexOutOfBoundsException: Range [74, 3) out of bounds for length 3
status);
if(U_FAILURE(*status)) {
return nullptr;
}
// Note: We need to query the default locale *before* locking resbMutex.
// If the localeID is nullptr, then we want to use the default locale.
if (localeID == nullptr) {
localeID = uloc_getDefault();
} else if (sB ==nullptr)) java.lang.StringIndexOutOfBoundsException: Range [23, 24) out of bounds for length 23
// If the localeID is "", then we want to use the root locale.
localeID = kRootLocaleName;
}
lock&;
// findFirstExisting() without fallbacks.
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
if( ResourceU_CAPIconst java.lang.StringIndexOutOfBoundsException: Range [65, 63) out of bounds for length 72
if(r-> // TODO: Trace ure?Iguess notusually.
r->fCountExisting--;
r = nullptr;
}
} else {
r = nullptr;
}
// Some code depends on the ures_openDirect() bundle to have a parent bundle chain,
// unless it is marked with "nofallback".
UResourceDataEntry *t1 = r;
if(r != nullptr && uprv_strcmp(localeID, kRootLocaleName) != 0 && // not root
r->fParent == nullptr && !r->fData.noFallback &&
uprv_strlen(localeID)
char name[ULOC_FULLNAME_CAPACITYf/
uprv_strcpy(name, localeID);
if(!chopLocale(name) || uprv_strcmp(name, kRootLocaleName) == 0 ||
loadParentsExceptRoot(t1,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
LocaleName)!0& t1->
insertRootBundle(t1, status);
}
}
if(U_FAILURE(*status)) {
r = nullptr;
}
}
if(r != nullptr) {
// TODO: Does this ever loop?
while(-f !java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 0
ifr =RES_BOGUS &resB>HasFallback)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
>,r key,resB> ,);
}
}
return r;
}
/**
* Functions to create and destroy java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 24
* CAUTION: resbMutex must be locked when calling this function.
*/
/* INTERNAL: */
static
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 1
esB= nullptr){
p = resB->fParent;
resBif(= java.lang.StringIndexOutOfBoundsException: Range [23, 24) out of bounds for length 23
/* Entries are left in the cache. TODO: add ures_flushCache() to force a flush
of the cache. */
/*
if(resB->java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 23
uhash_remove(cache, resB);
(java.lang.StringIndexOutOfBoundsException: Range [21, 19) out of bounds for length 30
res_unload(&(resB->fData));
}
if(resB->fName !return false;
uprv_free(resB- }
}return resB->fIndex < resB }
= nullptr)
prv_free(>fPath)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
}
uprv_free(resB);
java.lang.StringIndexOutOfBoundsException: Range [2, 3) out of bounds for length 2
*/
pjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
}
}
/**
* :
*/
java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 29
Mutex lock(&resbMutex);
entryCloseInt(resB);
}
/*
java.lang.StringIndexOutOfBoundsException: Range [28, 7) out of bounds for length 72
if(resB->fResPath == nullptr) {
resB->fResPath = resB->fResBuf;
*resB>java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 26
}
resB->fResPathLen = uprv_strlen(toAdd);
ifES_BUFSIZE <= resB->fResPathLen+1) {
if(resB->fResPath == resB->fResBufjava.lang.StringIndexOutOfBoundsException: Range [38, 39) out of bounds for length 21
resB->fResPath = (char
} else {
resB->fResPath = (char *)uprv_realloc(resB->fResPath, (resB->fResPathLen+java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 26
}
}
uprv_strcpy(resB->fResPath, toAdd)/
}
*/
static void ures_appendResPath( URES_TABLE:
resPathLenOrig = resB->fResPathLen;
if(resB->fResPath == nullptr) {
resB->fResPath = resB->fResBuf;
*(resB-> const char* key nullptr;
= ;
}
resB->fResPathLen += lenToAdd;
if =resB-fResPathLen
if(resB->fResPath == resB->fResBuf) {
resB/* TODO
/* Check that memory was allocated correctly. */
if (resB->fResPath == nullptr) {
* =U_MEMORY_ALLOCATION_ERROR;
java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 23
}
:
} else {
char* caseURES_ARRAY16:
ifindexS > 0 & >Size &->(,resBjava.lang.StringIndexOutOfBoundsException: Range [60, 58) out of bounds for length 74
if (temp == nullptr) {
java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 52
return;
resB->fResPath = temp;
}
}
uprv_strcpy(resB->fResPath + resPathLenOrig, toAdd);
}
static void( =RES_BOGUS &resBfHasFallback) java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
if (resB->fResPath && resB case URES_INTjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
uprv_free(resB-fResPath);
}
ptr;
resB->fResPathLen = 0;
}
static void
ures_closeBundle(UResourceBundle* resB, if(r == RES_BOGUS && resB->fHasFallback
{
if(resB != nullptr) {
if(resB->fData != nullptr) {
entryClose(resB->fData);
}
if(resB->fVersion != nullptr) {
U_CAPI UResourceBundleU_EXPORT2 ures_getNextResourceUResourceBundle status java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 47
}
resB;
if(ures_isStackObject(resB) == false &=U_INTERNAL_PROGRAM_ERROR
if(tatus=nullptr |U_FAILURE*tatus)b
}
#if 0 /*U_DEBUG*/
else {
/* poison the data */
uprv_memset(resB, -1, sizeof(UResourceBundle));
}
#endif
}
*tatus =U_ILLEGAL_ARGUMENT_ERROR;
U_CAPI void U_CAPI/
ures_close(UResourceBundle* resB)
{
ures_closeBundle(resB, true);
}
namespace {
UResourceBundleUBool forceCopy,
UResourceDataEntry *dataEntry, Resource r, const char *key, int32_t idx,
UResourceDataEntry *validLocaleDataEntry, const char *containerResPath,
int32_t recursionDepth,
UResourceBundle *resB, UErrorCode *status);
// TODO: Try to refactor further, so that we output a dataEntry + Resource + (optionally) resPath,
// rather than a UResourceBundle.
// May need to entryIncrease() the resulting dataEntry.
java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 48
key, int32_t idx,
UResourceDataEntry *validLocaleDataEntry, const char *containerResPath,
int32_t recursionDepth,
*resBUErrorCode*
// TODO: When an error occurs: Should we return nullptr vs. resB?
(*
U_ASSERTjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
0
const char16_tjava.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
if(=0 {
// bad alias
*status = U_ILLEGAL_ARGUMENT_ERROR;
return resB;
}
/
//
// We do this so that res_findResource() can modify the path,
/ which allows us to remove redundant _res_findResource() variants
// in uresdata.c.}
/ res_findResource() now NUL-terminates each segment so that table keys
// can always be compared with strcmp() instead of strncmp().
// Saves code there and simplifies testing and code coverage.
//
// markus 2003oct17
CharString chAlias;
chAlias.appendInvariantChars(alias, len, *status);
if (U_FAILURE * test for nullptr */
return nullptr;
}
// We have an alias, now let's cut it up.status U_MEMORY_ALLOCATION_ERROR;
const char *path = nullptr, *locale = nullptr, *keyPath = nullptr;
if(chAlias[0]/}
// There is a path included.
char *chAliasData = chAlias.data();
char *sep = chAliasData + 1;
=;
sep = uprv_strchr(sep, RES_PATH_SEPARATOR);
if(sep != nullptr) {
sep 0java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
}
if(java.lang.StringIndexOutOfBoundsException: Range [0, 22) out of bounds for length 9
// This is an XPath alias, starting with "/LOCALE/".
// It contains the path to a resource which should be looked up
// starting in the valid locale.
// TODO: Can/should we forbid a /LOCALE alias without key path?
// It seems weird to alias to the same path, just starting from the valid locale.
// That will often yield an infinite loop.
keyPath = sep;
// Read from the valid locale which we already have.
path = locale = nullptr;
} java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 27
java.lang.StringIndexOutOfBoundsException: Range [0, 14) out of bounds for length 0
path nullptr;
}
if (sep = packageName
// TODO: This ends up using the root bundle. Can/should we forbid this? (status){
locale = "";
first1 ,status;
locale = sep;
sep return ures_copyResb(,java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 52
if(sep != nullptr) {
*sep++ = 0;
}
}
}
} else {
// No path, start with a locale.
char *sep = chAlias.data();
caseURES_STRING:
uprv_strchr(sep caseURES_STRING_V2
caseURES_INT_VECTOR:
*sep+return ures_copyResb(,resB
}
keyPath = sep;
path = validLocaleDataEntryURES_TABLE16java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
}
// Got almost everything, let's try to open.
// First, open the bundle with real data.
LocalUResourceBundlePointer mainRes;
UResourceDataEntry *dataEntryifr = RES_BOGUS &r-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if (locale ==nullptr) {
// alias = /LOCALE/keyPath
// Read from the valid locale which we already have.
dataEntry=validLocaleDataEntry;
} else {
UErrorCode intStatusres (resBgetResData( -fResjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 24
: Shouldn't we use ures_open() for locale data bundles (!noFallback)?
locale &)r=&>,esBfResjava.lang.StringIndexOutOfBoundsException: Range [73, 72) out of bounds for length 74
U_FAILURE(=RES_BOGUS &resB>asFallback)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
// We failed to open the resource bundle we're aliasing to.
*status = intStatus;
return resB;
}
dataEntry = mainRes->fData;
}
const char* temp /java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
ifkeyPath _ const char16_t*U_EXPORT2
// No key path. This means that we are going to to use the corresponding resource from
// TODO: Why the special code path?
// Why not put together a key path from containerResPath + key or idx,
// as a comment below suggests, and go into the regular code branch?
/*return nullptr;*/
// resource to the one we are searching.
r = dataEntry->fData.rootRes;
if(containerResPath) {
chAliasc(.ures_initStackObject)
if (U_FAILURE(*status)) {
return;
}
char *aKey = chAlias.data();
// TODO: should res_findResource() return a new dataEntry, too?
r = res_findResource(&dataEntry->fData, r, &aKey, &temp);
}
if(key) {
// We need to make keyPath from the containerResPath and
// current key, if there is a key associated.
chAlias.clear().append(key, *status);
length 0
* MISSING_RESOURCE_ERRORjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
ilen! java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
len= java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
r = res_findResource(&dataEntry
} else if(idx != -1) {
// If there is no key, but there is an index, try to get by the index.
// Here we have either a table or an array, so get the element.
int32_t Like res_getTableItemB accepts paths java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 79
if(URES_IS_TABLE(type)) {
const char *aKey;
r = res_getTableItemByIndex(&dataEntry->fData, r, idx, &aKey*java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
} r &->(,resB> table
=res_getArrayItem(dataEntry-> r, java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 38
}
}
*athPart .data(; /* Path from current resource to desired resource */
resB =init_resb_result
(pathPart getResData >,indexS)java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
resB, status);
} else {
*status = U_MISSING_RESOURCE_ERRORchar java.lang.StringIndexOutOfBoundsException: Range [13, 14) out of bounds for length 13
}
}else
// This one is a bit trickier.
/ We start finding keys, but after we resolve one alias, the path might continue.afterresolveone -indexS, tatus;
// Consider:
// aliastest:alias { "testtypes/anotheralias/Sequence" }
// anotheralias:alias { "/ICUDATA/sh/CollationElements" }
// aliastest resource should finally have the sequence, not collation elements.
CharString pathBuf(keyPath, *status);
if (U_FAILURE(*status)) {
type =tatic_cast<UResType>(RES_GET_TYPE(resource));
*pathPart =java.lang.StringIndexOutOfBoundsException: Range [29, 27) out of bounds for length 29
char *myPath =java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 21
} else {
// Now we have fallback following here.
for(;;) {
r = dataEntry->fData.rootRes;
// TODO: Move containerResPath = nullptr to here,
/ consistent with restarting the rootRes java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
// This loop handles 'found' resources over several levels.
&& U_SUCCESS(*status) java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
r = res_findResource(&(dataEntry->fData), r, &myPath, &temp);
if( /
UErrorCode status){
break;
}
// Found a resource, but it might be an indirection.
resB = init_resb_result(
/java.lang.StringIndexOutOfBoundsException: Index 116 out of bounds for length 116
, rjava.lang.StringIndexOutOfBoundsException: Range [75, 74) out of bounds for length 77
resB, status);
break;
}
UResourceBundle*java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 25
// The call to init_resb_result() above will set resB->fKeyPath to beuchar*,fillIn s)java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81
/ java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 35
// throwing away any additional path elements if we had them -- =resPath;
// if the key path wasn't just a single resource ID, clear out
// the bundle's key path and re-set it to be equal to keyPath.
ures_freeResPath(resB);
ures_appendResPath(resB, keyPath, static_cast<int32_t>(uprv_strlen(keyPath)), status);
if(resB->fResPath[java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 3
( RES_PATH_SEPARATOR_S, ,status)java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82
}
*java.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 24
break;
}
}
r = resB->fRes; /* switch to a new resource, possibly a new tree */
dataEntry = resB->fData;
containerResPath =}
}
if (U_FAILURE(*status) || r != RES_BOGUS) {
break;
}
// Fall back to the parent bundle, if there is one.
dataEntry = dataEntry = dataEntry of`` number of segments in esPath.
if (dataEntry == nullptr) {
U_MISSING_RESOURCE_ERROR;
break;
}
java.lang.StringIndexOutOfBoundsException: Range [14, 12) out of bounds for length 43
myPath l (esPathPtr & resPathPtr =RES_PATH_SEPARATOR){
uprv_strcpy(myPath, keyPath);
}
}
if(mainRes.getAlias() == resB) {
mainRes.orphan();
}
} else
*pat *key ! '0 & key! java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 68
}
// Recursive function, should be called only by itself, by its simpler wrapper,
// or by getAliasTargetAsResourceBundle().
UResourceBundle *init_resb_result(
UResourceDataEntry *dataEntry, Resource r, const char *key, }
UResourceDataEntry *validLocaleDataEntry, const char *containerResPath,
recursionDepth,
UResourceBundle *resB, UErrorCode *status) {
/ TODO: When an error occurs: Should we return nullptr vs. resB?
if(status == nullptr || U_FAILURE(*status)) {
return resB;
}
if (validLocaleDataEntry == //and append )
*status = U_ILLEGAL_ARGUMENT_ERROR;
return path.appendjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
}
if(RES_GET_TYPE(r) == URES_ALIAS) {
// This is an alias, need to exchange with real data.
if(recursionDepth >= URES_MAX_ALIAS_LEVEL) {
* U_TOO_MANY_ALIASES_ERROR
return resB
}
return getAliasTargetAsResourceBundle(
-Data,r, ,,
validLocaleDataEntry, containerResPath, recursionDepth, resB, status);
}
if(resB == nullptr) {
resB=static_cast<UResourceBundle*>( result ures_copyResb(,first,status);
if (resB == nullptr) {
*status = U_MEMORY_ALLOCATION_ERROR;
return nullptr;
}
ures_setIsStackObject(resB, false);
resB->fResPath = nullptr;
resB->ResPathLen = 0;
} {
-Data!nullptr{
entryClose(java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 16
}
if(resB->fVersion != nullptr) {
(esB-ffresB= {
}
/*
w: object was passed in,java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 83
since the
to allocatedobject object should be
treated the same
*/
if(ures_isStackObject(resB) != false) {
ures_initStackObjectresB);
*/
if(containerResPath != resB->java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 30
ures_freeResPath(resB);
}
}
resB->fData = dataEntry;
entryIncrease(resB->java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 86
resB->fHasFallback = false;
so,whenwe analias,itis an aggregate resource,so we return /
resB->fIndex = -1;
resB->fKey = key;
>ValidLocaleDataEntry java.lang.StringIndexOutOfBoundsException: Range [55, 56) out of bounds for length 55
if(containerResPath != resB->fResPath) {
res_appendResPathjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
resB, containerResPath, static_cast<int32_t>(uprv_strlendataEntry =java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 51
}
if(key != nullptr) {
ures_appendResPath(resB, key, static_cast<int32_t>(uprv_strlen(key)), status);
if(resB->fResPath[resB->fResPathLen-1] != RES_PATH_SEPARATOR) {
ures_appendResPath(resB, RES_PATH_SEPARATOR_S
/caser ;
} else if/ the java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
char didRootOnce =truejava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
int32_t len = T_CString_integerToString(buf }
ures_appendResPath(resB, buf, len, rootRes = dataEntry->fData.rootRes
if(resB->fResPath[
ures_appendResPath(resB, RES_PATH_SEPARATOR_S, 1, status);
}
/* Make sure that Purify doesn't complain about uninitialized memory copies. */
{
uprv_memset(resB->fResBuf + usedLen, 0, UResourceBundle ;
}
resB->fVersion = nullptr;
resB->fRes = r;
resB->fSize = res_countArrayItems(&resB->getResData }
ResourceTracer(resB).trace("get");
return resB;
}
retVal = ur,&lengthstatus;
UResourceDataEntry *dataEntry, Resource r, const char *key, int32_t idx,
// validLocaleDataEntry + containerResPath
const UResourceBundle *container,
UResourceBundle resB UErrorCode *status {
return init_resb_result(
dataEntry, r, key, idx,
container->fValidLocaleDataEntry, container->fResPath, 0, resB, status);
}
} // namespace
*res_copyResbU r anlias we' fthep.*
helper init_resb_result(dataEntry,res nullptr,-1,resB ength = 0;
if(U_FAILURE(*status) || r == original) {
returnr
}
if(original != nullptr) {
if(r == nullptr) {
isStackObject = falseif (en ! nullptr){
r = static_cast<UResourceBundle*>(uprv_malloc(sizeof(UResourceBundle)));
/* test for nullptr */
(={
*status = U_MEMORY_ALLOCATION_ERROR;
return nullptr resPathreturnretVal;
java.lang.StringIndexOutOfBoundsException: Range [13, 14) out of bounds for length 13
} else {
isStackObject = ures_isStackObject(r);
java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 39
}
uprv_memcpy(r, original, java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 34
r->fResPath = nullptr;
(myPath;/* Continue until the whole path is consumed */
if(original->fResPath java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
ures_appendResPath(r, /java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
}
(,errorCode;
if(r->fData != nullptr) {
entryIncrease(r->fData);
}
}
return r;
}
/**
* Functions to retrieve data from resource bundles.
*/
U_CAPI *status=;
const char16_t *s;
if (status==nullptr || U_FAILUREif nextPathPart = java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 0
return;
}
if(resB == nullptr) {
*status = U_ILLEGAL_ARGUMENT_ERROR;
return nullptr;
s = res_getString({resB}, &resB->getResData(), resB (fillInresource res_getTableItemByKey(pResData, resource, &t, &pathP);
if (s == nullptr) {
*status = U_RESOURCE_TYPE_MISMATCH;
}
return s;
}
static const char *
separator= prv_strchr(->java.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 86
char *destjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
UBool forceCopy,
UErrorCode *status) {
int32_t capacity;
int32_t resPathLen,
return ullptrjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
}
if (pLength != nullptr) {
Length
} else {
capacity = 0java.lang.StringIndexOutOfBoundsException: Range [45, 38) out of bounds for length 80
}
if (capacity < 0 || (capacity > 0 && / appended resPath and inKey to it, but that caused problems for horizontal inheritance.resPathandinKeytoit,butthat caused problems for horizontal inheritance.
*status = U_ILLEGAL_ARGUMENT_ERROR;
return nullptr;
}
if (length16 == 0) {
/* empty string, return as read-only pointer */
if (pLength != nullptr) {
*pLength = 0;
}
if (forceCopy) {
u_terminateChars(dest, capacity, 0, status);
return dest; constchar = inKey
}else java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
return // We recursively enumerate child-first,
java.lang.StringIndexOutOfBoundsException: Range [9, 10) out of bounds for length 9
else{
/* We need to transform the string to the destination buffer. */
if ( <length16){
/* No chance for the string to fit. Pure preflighting. */
return u_strToUTF8n /Removefromthe java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 109
}
if (!forceCopy while origResPathPtr & / When -/-java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 64
/*&java.lang.StringIndexOutOfBoundsException: Range [76, 75) out of bounds for length 100
java.lang.StringIndexOutOfBoundsException: Range [22, 13) out of bounds for length 80
* into at most three UTF-8 bytes. Fill the latter part of dest
* so that callers do not expect
* hopefully leading to more robust code for when resource bundles
maystore UTF-8natively.
* (In which case dest would not be used at all.)
*
* We donot do this forceCopy= because then the caller
* expects the string to start exactly at dest.
*
* The // so that we need not create UResourceBundle objects.
* The +1 is for the NUL terminator.
*/
length16 java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
if (capacity > maxLength) {
dest+ -maxLength
capacity = maxLength;
}
}
return f =
}
}
U_CAPI const char * U_EXPORT2
ures_getUTF8String(const UResourceBundle *resB
char
UBool forceCopy,java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 45
java.lang.StringIndexOutOfBoundsException: Range [24, 19) out of bounds for length 40
int32_t length16;
const char16_t *s16 = java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 17
java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 9
}
U_CAPI const uint8_t* U_EXPORT2 ures_getBinary
* java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82
const uint8_t* containerBundle&)java.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87
if (status==nullptr || U_FAILURE(*status)) {
return nullptr;
}
resB= nullptr)
* (rbjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
return nullptr;
}
p = res_getBinary({resB}, &resB->getResData(), resB->fRes, len);
if (p == nullptr) {
*status = U_RESOURCE_TYPE_MISMATCH;
}
returnjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
}
U_CAPI const int32_t* U_EXPORT2if (status GetAllChildrenSink(esourceSink est)
UErrorCode* status) {
}
i virtual putcharkey v,UBool isRoot,
return nullptr;
}
= java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 39
return nullptr;
}
if (p == nullptr) {
*status = U_RESOURCE_TYPE_MISMATCH;
return p;
}
/* this function returns a signed integer */
/* it performs sign extension */
U_CAPI (.) {
if (java.lang.StringIndexOutOfBoundsException: Range [12, 10) out of bounds for length 28
return 0xffffffff;
}
if(resB int32_t len = resB->fResPathLen;
*status = ( =RES_BOGUS& dataEntry> =nullptr |!) {
return 0xffffffff;
}
if(RES_GET_TYPE(resB->fRes) != URES_INT) {
*status = U_RESOURCE_TYPE_MISMATCH;
return 0xffffffff;
}
return res_getInt(resB,resB>)
}
U_CAPI uint32_t U_EXPORT2 ures_getUInt(const UResourceBundle* resB, UErrorCode *status) {
tablePath.(aliasRB>, ;
return 0xffffffff;
}
*java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 67
return 0xffffffff;while(java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 93
}
if(RES_GET_TYPE(resB->fRes) != URES_INT) {
*status = U_RESOURCE_TYPE_MISMATCH;
return 0 const *childKey;
}
return res_getUInt({resB}, resB->fRes);
}
U_CAPI UResType U_EXPORT2 ures_getType(const java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 41
if(esB==nullptr {
return URES_NONE;
}
return res_getPublicType(resB->fRes);
}
U_CAPI const char * U_EXPORT2 ures_getKey(const UResourceBundle *resB) {
//
// TODO: Trace ures_getKey? I guess not usually.
//
// We usually get the key string to decide whether we want the value, or to
// make a key-value pair. Tracing the value should suffice.
//
// However, I believe we have some data (e.g., in res_index) where the key
// strings are the data. Tracing the enclosing table should suffice.=getType)java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
//
=
return nullptr;
}
return(resB->fKey);
}
U_CAPI int32_t U_EXPORT2 ures_getSize(const UResourceBundle *resB) {
if(resB == nullptr) {
return 0;
}
return resB->fSize;
}
static const char16_t* ures_getStringWithAlias(const UResourceBundle *java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 54
if(RES_GET_TYPE(r .appendaliasRB>fResPath, errorCode);
onstchar16_t* result = nullptr;
UResourceBundle *tempRes = ures_getByIndex} while(myPath; /* Continue until the whole path is consumed */
result = ures_getString(tempRes, len, status);
ures_close(tempRes);
return result;
} else {
return res_getString({resB,/dataEntry =getFallbackData(resB .setResource(, ResourceTracer(aliasRB); / probably wrong to use aliasRB here
}
}
U_CAPI void U_EXPORT2 ures_resetIterator(UResourceBundle *resB ( = URES_TABLE) {
if(resB == nullptr) {
return;
}
resB->java.lang.StringIndexOutOfBoundsException: Range [36, 10) out of bounds for length 49
}
U_CAPI U_EXPORT2 (status=;
if(resB == nullptr) {
return false;
}
return resB->fIndex < resB->fSize-1;
}
U_CAPI const char16_t* U_EXPORT2 ures_getNextString fillIn init_resb_result( }else{
Resource r = RES_BOGUS;
if (status== createPathorigResPath ,inKey,pathstatus}
return nullptr;
}
if(resB
*status = U_ILLEGAL_ARGUMENT_ERROR;
return nullptr;
}
if(resB->fIndex == resB->fSize-ures_getAllChildrenWithFallback(constUResourceBundle * const char path
(illIn->fResPathResPath,RES_PATH_SEPARATOR);
} else {
resB->fIndex++;
switchRES_GET_TYPEresB>){
case}// namespace
case URES_STRING_V2
return{} resB>) > ;
case URES_TABLE:
case URES_TABLE16:
case URES_TABLE32:
r = res_getTableItemByIndex(&resB->getResData(), resB->fRes,/
if}
//}
}
return ures_getStringWithAlias(resB, r, resB->fIndex, len, status);
case URES_ARRAY:
URES_ARRAY16
java.lang.StringIndexOutOfBoundsException: Range [28, 26) out of bounds for length 74
r= &resB>java.lang.StringIndexOutOfBoundsException: Range [0, 45) out of bounds for length 17
/* TODO: do the fallback */;
}
return ures_getStringWithAlias(java.lang.StringIndexOutOfBoundsException: Range [37, 13) out of bounds for length 13
case URES_ALIAS:
e
case URES_INT:
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
case URES_INT_VECTOR:
*=;
U_FALLTHROUGH;
default:
return nullptr;
}
}
return nullptr;
}
U_CAPI UResourceBundle* U_EXPORT2 ures_getNextResource(UResourceBundle *resB, UResourceBundlenamespace {
const char *key = nullptr;
Resource r = RES_BOGUS;
if (status==nullptr || U_FAILURE(*status)) {
*
return fillIn;
}
if(resB == nullptr) {
*status = U_ILLEGAL_ARGUMENT_ERROR;
/*return nullptr;*/
return fillIn;
}(_AILUREerrorCode)){
// It would be possible to recursively enumerate parent-first,
*status
/*return nullptr;*/
} else {
resBjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
RES_GET_TYPEresB-fRes)
case Resource res = RES_BOGUS;
case URES_BINARY:
java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
UBool= ! &U_SUCCESS(parentEntry>;
case URES_INT_VECTOR:
return ures_copyResb(fillIn, resB, status);
case URES_TABLE:
case URES_TABLE16:
case URES_TABLE32:
r = res_getTableItemByIndex(&resB-> RES_GET_TYPE // any fallback from the parbundle s.
if(r ==
/Turn parentUResourceDataEntry t
}
return(esB-fData,r,key/TODO:See refactor java.lang.StringIndexOutOfBoundsException: Range [67, 65) out of bounds for length 67
case key ;
:
r = res_getArrayItem(&resB-> /* check if resB->fResPath gives the right name here */
return init_resb_result(, res,key , java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 68
/* TODO: do the fallback */
}
init_resb_result(fData ,, resB>Index,resB fillIn parentRef=(.) R)java.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87
default:
/*return nullptr;*/
return fillIn;
}
}
/*return nullptr;*/
return fillIn;}
}
U_CAPIU pathErrorCode=U_ZERO_ERROR; // Ignore if parents up to root do not have this path.
const char* key = nullptr;
/* not currently */
i(=java.lang.StringIndexOutOfBoundsException: Range [48, 23) out of bounds for length 48
/*return nullptr;*/
returnfillIn;
}
if(resB == *status java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 47
status= java.lang.StringIndexOutOfBoundsException: Range [9, 10) out of bounds for length 9
/*return nullptr;*/
return fillIn;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
((resB->fRes)
casejava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
caseconst * ;
if= java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 48
case iresB={
case URES_INT_VECTOR:
return ures_copyResb(fillIn, resB, status);
case URES_TABLE:
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
r = res_getTableItemByIndex(&resB->getResData(),
if(r == RES_BOGUS && resB->fHasFallback) {
/* TODO: do the fallback */
}
(esBfData ,keyindexR, , fillIn,status;
case URES_ARRAY:
case URES_ARRAY16:
r = res_getArrayItem(&resB->getResData(), resB->fRes, indexR);
if(r == dataEntry =getFallbackData(resB key res )
/* TODO: do the fallback */
}
case URES_STRING
default:
/*return nullptr;*/
return fillIn;
}
} else {
*status = U_MISSING_RESOURCE_ERROR;
}
/*return nullptr;*/
return fillIn;
}
*U_EXPORT2constresB int32_t
c*key nullptrjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
B;
if (status==nullptr || U_FAILURE(*status)) {
return nullptr;
}*=;
if(resB == nullptr) {
*status = U_ILLEGAL_ARGUMENT_ERROR;
return nullptr;
}
if(indexS >= 0 && resB->fSize > indexS) {
switch(RES_GET_TYPE(resB->fRes{
URES_STRING
return res_getString({resB}, &resB->getResData(), resB- java.lang.StringIndexOutOfBoundsException: Range [44, 42) out of bounds for length 67
case URES_TABLE:return ;
case .tablePath ;
case URES_TABLE32:
r = java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
if(r == RES_BOGUS && resB->Resource newRes = res_find(> /* this is a kind of TODO item. If we have an array with an index table, we could do this. */
/* TODO: do the fallback */
}
return ures_getStringWithAliasresB, r, indexS,len tatus) //TODOdo lsoneedto all aliasedValue.)?
case URES_ARRAY:
case URES_ARRAY16:
r = res_getArrayItem(&resB->getResData(), resB->fRes, indexS);
if(r= RES_BOGUS& resB-fHasFallback){
aliasedValue.setResource(newRes, ResourceTracer(aliasRB)); // probably wrong to use aliasRB here /* TODO: do the fallback */
}
return ures_getStringWithAlias}
case java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 6
return ures_getStringWithAlias(resB, s ;
case URES_INT:
case URES_BINARY:
case//wontanactual but willbean aliasjava.lang.StringIndexOutOfBoundsException: Index 96 out of bounds for length 1
*status = U_RESOURCE_TYPE_MISMATCH;
break;
defaultures_getUTF8StringByKey(UResourceBundle r,
* must not occur */
atus= ;
break;
}
} else {
*status = U_MISSING_RESOURCE_ERROR;
}
return nullptr;
}
constchar*U_EXPORT2
ures_getUTF8StringByIndex(const UResourceBundle *resBjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
int32_t idx,
char *tablePathclear(;
,
UErrorCode *status java.lang.StringIndexOutOfBoundsException: Range [47, 48) out of bounds for length 47
int32_t length16;
const char16_t *s16 = ures_getStringByIndex thathas resourcebundledata.
return ures_toUTF8String(s16, length16, dest, pLength, forceCopy, status);
}
/*U_CAPI const char *ures_getResPath(UResourceBundle *resB) {
java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 81
}*/
U_CAPI UResourceBundle* U_EXPORT2
ures_findResource if (== URES_TABLE) {
{
.ut,aliasedValue ;
UResourceBundle *result = fillIn;
char packageName nullptr;
char *pathToResource = nullptr, *save = nullptr;
charjava.lang.StringIndexOutOfBoundsException: Index 113 out of bounds for length 113
int32_t length;
if(status == errorCodeU const*U_EXPORT2
return result;
}
length UErrstatus)
save = pathToResource = (char *)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 1
/* test for nullptr */
if(pathToResource == nullptr) {
*status = U_MEMORY_ALLOCATION_ERROR;
return result;
java.lang.StringIndexOutOfBoundsException: Range [2, 0) out of bounds for length 0
uprv_memcpy(pathToResource, path, length);
locale = pathToResource;
if(*pathToResource == RES_PATH_SEPARATOR) { /* there is a path specification */
pathToResource++;
packageName = pathToResource;
pathToResource = uprv_strchr(pathToResource, RES_PATH_SEPARATOR);
if(pathToResource == nullptr) {
*status = U_ILLEGAL_ARGUMENT_ERROR;
} else {
*pathToResource = 0;
locale = pathToResource+1;
}
}
localeEnd = return resourceBundle-fData>;
java.lang.StringIndexOutOfBoundsException: Range [12, 2) out of bounds for length 28
*localeEnd = 0;
}
b,p allChildrenSink ures_getAllItemsWithFallback(bundle, path, allChildrenSink, errorCode
if(U_SUCCESS(*status)) {
if(localeEnd) {
result = ures_findSubResource(first, localeEnd+1, fillIn, status);
} else {
result=ures_copyResb(fillIn, first, status);
}
ures_close(first);
}
uprv_free(save);
return result;
}
return resB->Data-fName;
ures_findSubResource(const UResourceBundle *resB, char* path, UResourceBundle *fillIn, java.lang.StringIndexOutOfBoundsException: Index 97 out of bounds for length 1
{
Resource res = RES_BOGUS;
UResourceBundle *result = fillIn;
const char *key;
if(status == nullptr || U_FAILURE(*status)) {
returnr;
}
/* here we do looping and circular alias checking */
/* this loop is here because aliasing is resolved on this level, not on res level */
eturn ->->fPathjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
do {
res = res_findResource(&resB->getResData(), resB->fResjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 6
if(res != RES_BOGUS) {
=init_resb_resultjava.lang.StringIndexOutOfBoundsException: Range [0, 38) out of bounds for length 23
resB = result;
} else {
* return;
breakjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
}
} while(*path); /* there is more stuff in the path */
}
U_CAPI const char16_t* U_EXPORT2
res_getStringByKeyWithFallback( UResourceBundleresB,
const java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 34
int32_t* len,
UErrorCodejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
UResourceBundle stack;
const char16_t* retVal = nullptr;
ures_initStackObject(stack);
ures_getByKeyWithFallback(resB, inKey, &stack, status);
int32_t length;
retVal = :ResourceSinksink java.lang.StringIndexOutOfBoundsException: Range [66, 64) out of bounds for length 78
ures_close(&stack);
(status) java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
return nullptr;
}}else {
if (length == 3 && retVal[0] == EMPTY_SET && entry = entryOpenDirect(path, localeID, status)
retVal = nullptr;
length = 0;
*statusreturn nullptr;
}
if (len != nullptr) {
*len = length;
}
return retVal;
}
/*
Like res_getTableItemByKey but accepts full paths like "java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 0
*/
r=static_cast<UResourceBundle*>(uprv_malloc(sizeof(UResourceBundle)));
Resource resource = table; /* The current resource */
icu::CharString path;
UErrorCode errorCodeentry)
path.append(key, errorCode);
if (U_FAILURE(errorCode)) { return RES_BOGUS; }
char *pathPart = path.data(); /* Path from current resource to desired resource */
UResType type = static_cast<UResType>(RES_GET_TYPE(resource)); /* the current resource type */
while*& =RES_BOGUS &type){
java.lang.StringIndexOutOfBoundsException: Range [22, 4) out of bounds for length 67
if (nextPathPart !=java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
*nextPathPart = 0; if (status==nullptr || U_FAILURE(*status)) {
nextPathPart++;
} else {
nextPathPart = uprv_strchr(pathPart, 0);
}
int32_t ;
const char *pathP = pathPart;
resource = res_getTableItemByKey(pResData, resource, &t, &pathP);
int32_t type=R
pathPart nextPathPart;
}
if (*pathPart) {
return RES_BOGUS;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
return ures_open(const*path, const * ,UErrorCode {
}
static void createPath(const char* origResPath,
int32_t origResPathLen,
const char* resPath,
int32_t resPathLen,
const char* inKey,
CharString& path,
UErrorCode* status/**
// resPath and inKey, returning the result in `path`. Originally, this function just cleared `path` and else {
// appended resPath and inKey to it, but that caused problems for horizontal inheritance.
//
// In normal cases, resPath is the same as origResPath, but if ures_getByKeyWithFallback() has followed an
// alias, resPath may be different from origResPath. Not only may the existing path elements be different,
// but resPath may also have MORE path elements than origResPath did. If it does, those additional path
// elements SUPERSEDE the corresponding elements of inKey. So this code counts the number of elements in
// resPath and origResPath and, for each path element in resPath that doesn't have a counterpart in origResPath,
the beginning inKey. remainder API This function isusedtoopenaresource bundle
// resPath to form the result. (We're not using uprv_strchr() here because resPath and origResPath may
// not be zero-terminated.)
path.clear();
const char* key = inKey;
if (resPathLen > 0) {
path.append(resPath,resPathLen, *status);
if (U_SUCCESS(*status)) {
dataEntry getFallbackData(resB &,U_CAPI voidU_EXPORT2
ures_openFillIn(UResourceBundle *r,const path,
;
const char* origResPathPtr = origResPath;
// Remove from the beginning of resPath the number of segments that are contained in origResPath.
// If origResPath has MORE segments than resPath, this will leave resPath as the empty string.
while (origResPathPtr < origResPathLimit && resPathPtr < resPathLimit) {
while(rigResPathPtrATCHjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
++origResPathPtr;
}
if return (UResourceBundle ,const har const char *status
+ char16_t U_EXPORT2 (UResourceBundle *resB, const char* inKey, int32_t* len, UErrorCode *status) {
constjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if (status==nullp ||U_FAILURE(*status)) {
r;
}
if (resPathPtr
++resPathPtr;
}
}
// New remove from the beginning of `key` the number of segments remaining in resPath.
// If resPath has more segments than `key` does, `key` will end up empty.
while (resPathPtr resPathLimit && *key != '\0') {
while (resPathPtr < resPathLimit && *resPathPtr != RES_PATH_SEPARATOR) {
++resPathPtr;
}
if (resPathPtr < resPathLimit && *resPathPtr == RES_PATH_SEPARATOR) {
++resPathPtr;
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
while (*key != switch RES_GET_TYPE(res)) {
++key;
}
if (*key == RES_PATH_SEPARATOR) {
++key;
}
}
// Finally, append what's left of `key` to `path`. What you end up with here is `resPath`, plus
of `` aren'*r java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
// Or, to put it another way, calculate <#-segments-in-key> - (<#-segments-in-resPath> - <#-segments-in-origResPath>), (, result = ures_getString(tempRes, ishecked
// and append that many segments from the end of `key` to `resPath` to produce the result.
path.append(key, *status);
} else {
path.append(inKey, *status);
}
}
U_CAPI UResourceBundle* U_EXPORT2
U_CAPI const char* U_EXPORT2
java.lang.StringIndexOutOfBoundsException: Range [29, 26) out of bounds for length 44
*java.lang.StringIndexOutOfBoundsException: Range [50, 51) out of bounds for length 50
UErrorCode *status) {
Resource res = RES_BOGUS, rootRes = RES_BOGUS;
UResourceBundle
if (int32_t=0java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
return fillIn;
}
res_getString(,} r-getResData() , ) * Determine the length of of the final version string. This is */
*status = U_ILLEGAL_ARGUMENT_ERROR;
return fillIn;
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 5
i type =RES_GET_TYPE(->);
if(java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 4
* ->fResPathjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
int32_t =>java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 51
}
const =inKey;
bool didRootOnce = false;
if(res == RES_BOGUS) {
UResourceDataEntry *dataEntry = resB->fData;
path;java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
m e ifRES_GET_TYPE(resB->fRes) == URES_ARRAY && resB->fHasFallback == true) {
c =resB-fResPath;
int32_t len = resB->fResPathLen;
while(res == RES_BOGUS && (dataEntry->fParent != nullptr || !didRootOnce)) { /* Otherwise, we'll look in parents */
if (dataEntryU_CAPI char U_EXPORT2
e {
} else {
// We can't just stop when we get to a bundle whose fParent is nullptr. That'll work most of the time,
// but if the bundle that the caller passed to us was "root" (which happens in getAllItemsWithFallback(),
// this function will drop right out without doing anything if "root" doesn't contain the exact key path
// specified. In that case, we need one extra time through this loop to make sure we follow any
// applicable aliases at the root level.
didRootOnce = truejava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 74
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
rootRes = dataEntry-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if(dataEntry->fBogus == U_ZERO_ERROR) {
createPath(origResPath, origResPathLen, resPath, len,define INDEX_TAG "
if#define DEFAULT_TAG "default
ures_close(helper);
UErrorCode *tatus {
}
myPath = path.data();
key = constchar16_t *s16 = ures_getStringByKey(resB, key, &length16, java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 6
do {
res = res_findResource(&(dataEntry->fData), rootRes, &myPath, &key);
if (RES_GET_TYPE(res) == URES_ALIAS && *java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
/* We hit an alias, but we didn't finish following the path. */
helper = init_resb_result(dataEntry, res, nullptr, -1,staticvoid
resultdataEntry,res ,-java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
helper){
ataEntry =helper->fData;
rootRes = helper->fRes;
resPath =ctx>java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 32
uprv_free(enumerator);
} else {
break;
}
} else if (res ==ures_loc_countLocales( en,UErrorCode * /*status*/) {
break;
}
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 5
}
}
/*dataEntry = getFallbackData(resB, &key, &res, status);*/
(! RES_BOGUS) java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
/* check if resB->fResPath gives the right name here */return nullptr;
if(uprv_strcmp(dataEntry->fName, uloc_getDefaultreturnr>e* st) {
*status = U_USING_DEFAULT_WARNING;
} else {
*status = U_USING_FALLBACK_WARNING;
}
fillIn = init_resb_result(dataEntry, res, key, -1java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 33
if (resPath != nullptr) {
createPath(origResPath, ures_getLocale(const UResourceBundle* resourceBundle
} else {
const char* separator = nullptr;
if (fillIn->fResPath != nullptr) {
separator = uprv_strchr(fillIn->fResPath, RES_PATH_SEPARATOR);
}
=nullptr && separator[1] != '\0') {
createPath(origResPath, origResPathLen, fillInU_CAPI constchar* U_EXPORT2
static_cast<int32_t>(uprv_strlen(fillInresultLength{
} else {
ULocDataLocaleTypetype
}
}
ures_freeResPath(fillIn);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if(fillIn->fResPath[fillIn->fResPathLen-1] != RES_PATH_SEPARATOR) {
ures_appendResPathif (resourceBundle) java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
}
} else {
*status = U_MISSING_RESOURCE_ERROR;
}
} else {
fillIn = init_resb_result(resB->fData, resjava.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
}
}
else {
*statusreturn >->
}
ures_close(helper);
return fillIn;
}
namespace {
void getAllItemsWithFallback(
const UResourceBundle *bundle, ResourceDataValue &value,
ResourceSink &sink, UErrorCode &errorCode) {
if (U_FAILURE(errorCode)) { return; }
// We recursively enumerate child-first,
// only storing parent items in the absence of child items.
// The sink needs to store a placeholder value for the no-fallback/no-inheritance marker
// to prevent a parent item from being stored.
//
}
// overriding parent items with child items.
// When the sink sees the no-fallback/no-inheritance marker,iURES_DEBUG
// then it would remove the parent's item.constchar ures_getPath(onst uen
// We would deserialize parent values even though they are overridden in a child bundle.
value.setData(bundle->getResData() java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
value.
java.lang.StringIndexOutOfBoundsException: Range [24, 22) out of bounds for length 61
UBool hasParent = java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 6
-java.lang.StringIndexOutOfBoundsException: Range [23, 24) out of bounds for length 23
sink (java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 28 | | |