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

Unified Diff: icu46/source/i18n/uspoof_build.cpp

Issue 5516007: Check in the pristine copy of ICU 4.6... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/
Patch Set: Created 10 years 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 | « icu46/source/i18n/uspoof.cpp ('k') | icu46/source/i18n/uspoof_conf.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: icu46/source/i18n/uspoof_build.cpp
===================================================================
--- icu46/source/i18n/uspoof_build.cpp (revision 0)
+++ icu46/source/i18n/uspoof_build.cpp (revision 0)
@@ -0,0 +1,85 @@
+/*
+ ***************************************************************************
+ * Copyright (C) 2008-2009, International Business Machines Corporation
+ * and others. All Rights Reserved.
+ ***************************************************************************
+ * file name: uspoof_build.cpp
+ * encoding: US-ASCII
+ * tab size: 8 (not used)
+ * indentation:4
+ *
+ * created on: 2008 Dec 8
+ * created by: Andy Heninger
+ *
+ * Unicode Spoof Detection Data Builder
+ * Builder-related functions are kept in separate files so that applications not needing
+ * the builder can more easily exclude them, typically by means of static linking.
+ *
+ * There are three relatively independent sets of Spoof data,
+ * Confusables,
+ * Whole Script Confusables
+ * ID character extensions.
+ *
+ * The data tables for each are built separately, each from its own definitions
+ */
+
+#include "unicode/utypes.h"
+#include "unicode/uspoof.h"
+#include "unicode/unorm.h"
+#include "unicode/uregex.h"
+#include "unicode/ustring.h"
+#include "cmemory.h"
+#include "uspoof_impl.h"
+#include "uhash.h"
+#include "uvector.h"
+#include "uassert.h"
+#include "uarrsort.h"
+#include "uspoof_conf.h"
+#include "uspoof_wsconf.h"
+
+#if !UCONFIG_NO_NORMALIZATION
+
+U_NAMESPACE_USE
+
+
+// The main data building function
+
+U_CAPI USpoofChecker * U_EXPORT2
+uspoof_openFromSource(const char *confusables, int32_t confusablesLen,
+ const char *confusablesWholeScript, int32_t confusablesWholeScriptLen,
+ int32_t *errorType, UParseError *pe, UErrorCode *status) {
+
+ if (U_FAILURE(*status)) {
+ return NULL;
+ }
+#if UCONFIG_NO_REGULAR_EXPRESSIONS
+ *status = U_UNSUPPORTED_ERROR;
+ return NULL;
+#else
+ if (errorType!=NULL) {
+ *errorType = 0;
+ }
+ if (pe != NULL) {
+ pe->line = 0;
+ pe->offset = 0;
+ pe->preContext[0] = 0;
+ pe->postContext[0] = 0;
+ }
+
+ // Set up a shell of a spoof detector, with empty data.
+ SpoofData *newSpoofData = new SpoofData(*status);
+ SpoofImpl *This = new SpoofImpl(newSpoofData, *status);
+
+ // Compile the binary data from the source (text) format.
+ ConfusabledataBuilder::buildConfusableData(This, confusables, confusablesLen, errorType, pe, *status);
+ buildWSConfusableData(This, confusablesWholeScript, confusablesWholeScriptLen, pe, *status);
+
+ if (U_FAILURE(*status)) {
+ delete This;
+ This = NULL;
+ }
+ return (USpoofChecker *)This;
+#endif // UCONFIG_NO_REGULAR_EXPRESSIONS
+}
+
+#endif
Property changes on: icu46/source/i18n/uspoof_build.cpp
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « icu46/source/i18n/uspoof.cpp ('k') | icu46/source/i18n/uspoof_conf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698