Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(913)

Unified Diff: source/common/utrie2.cpp

Issue 845603002: Update ICU to 54.1 step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@master
Patch Set: remove unusued directories Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/common/utrie2.h ('k') | source/common/utrie2_builder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/common/utrie2.cpp
diff --git a/source/common/utrie2.cpp b/source/common/utrie2.cpp
index 86b6a774557622ba8783ca0652147fe87a73040b..5f873c5cac08257b0359ff634d91e062123e8093 100644
--- a/source/common/utrie2.cpp
+++ b/source/common/utrie2.cpp
@@ -1,7 +1,7 @@
/*
******************************************************************************
*
-* Copyright (C) 2001-2013, International Business Machines
+* Copyright (C) 2001-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@@ -399,6 +399,35 @@ utrie2_getVersion(const void *data, int32_t length, UBool anyEndianOk) {
return 0;
}
+U_CAPI UBool U_EXPORT2
+utrie2_isFrozen(const UTrie2 *trie) {
+ return (UBool)(trie->newTrie==NULL);
+}
+
+U_CAPI int32_t U_EXPORT2
+utrie2_serialize(const UTrie2 *trie,
+ void *data, int32_t capacity,
+ UErrorCode *pErrorCode) {
+ /* argument check */
+ if(U_FAILURE(*pErrorCode)) {
+ return 0;
+ }
+
+ if( trie==NULL || trie->memory==NULL || trie->newTrie!=NULL ||
+ capacity<0 || (capacity>0 && (data==NULL || (U_POINTER_MASK_LSB(data, 3)!=0)))
+ ) {
+ *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
+ return 0;
+ }
+
+ if(capacity>=trie->length) {
+ uprv_memcpy(data, trie->memory, trie->length);
+ } else {
+ *pErrorCode=U_BUFFER_OVERFLOW_ERROR;
+ }
+ return trie->length;
+}
+
U_CAPI int32_t U_EXPORT2
utrie2_swap(const UDataSwapper *ds,
const void *inData, int32_t length, void *outData,
« no previous file with comments | « source/common/utrie2.h ('k') | source/common/utrie2_builder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698