X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/b25be06635768807f8f693286fa73bb2297bb06c..4388f060552cc537e71e957d32f35e9d75a61233:/icuSources/i18n/smpdtfst.cpp diff --git a/icuSources/i18n/smpdtfst.cpp b/icuSources/i18n/smpdtfst.cpp index 95fad4f7..2e138b84 100644 --- a/icuSources/i18n/smpdtfst.cpp +++ b/icuSources/i18n/smpdtfst.cpp @@ -1,14 +1,15 @@ -// -// smpdtfst.h -// -// Copyright (C) 2009, International Business Machines Corporation and others. -// All Rights Reserved. -// -// This file contains the class SimpleDateFormatStaticSets -// -// SimpleDateFormatStaticSets holds the UnicodeSets that are needed for lenient -// parsing of literal characters in date/time strings. -// +/* +******************************************************************************* +* Copyright (C) 2009-2011, International Business Machines Corporation and * +* others. All Rights Reserved. * +******************************************************************************* +* +* This file contains the class SimpleDateFormatStaticSets +* +* SimpleDateFormatStaticSets holds the UnicodeSets that are needed for lenient +* parsing of literal characters in date/time strings. +******************************************************************************** +*/ #include "unicode/utypes.h" @@ -32,27 +33,27 @@ SimpleDateFormatStaticSets::SimpleDateFormatStaticSets(UErrorCode *status) fTimeIgnorables(NULL), fOtherIgnorables(NULL) { - fDateIgnorables = new UnicodeSet("[-,./[:whitespace:]]", *status); - fTimeIgnorables = new UnicodeSet("[-.:[:whitespace:]]", *status); - fOtherIgnorables = new UnicodeSet("[:whitespace:]", *status); - + fDateIgnorables = new UnicodeSet(UNICODE_STRING("[-,./[:whitespace:]]", 20), *status); + fTimeIgnorables = new UnicodeSet(UNICODE_STRING("[-.:[:whitespace:]]", 19), *status); + fOtherIgnorables = new UnicodeSet(UNICODE_STRING("[:whitespace:]", 14), *status); + // Check for null pointers if (fDateIgnorables == NULL || fTimeIgnorables == NULL || fOtherIgnorables == NULL) { goto ExitConstrDeleteAll; } - + // Freeze all the sets fDateIgnorables->freeze(); fTimeIgnorables->freeze(); fOtherIgnorables->freeze(); - + return; // If we reached this point, everything is fine so just exit - + ExitConstrDeleteAll: // Remove all sets and return error delete fDateIgnorables; fDateIgnorables = NULL; delete fTimeIgnorables; fTimeIgnorables = NULL; delete fOtherIgnorables; fOtherIgnorables = NULL; - + *status = U_MEMORY_ALLOCATION_ERROR; }