/*
*******************************************************************************
-* Copyright (C) 2010, International Business Machines
+* Copyright (C) 2010-2012, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
* file name: idna.h
U_NAMESPACE_BEGIN
-class U_COMMON_API IDNAInfo;
+class IDNAInfo;
/**
* Abstract base class for IDNA processing.
* This C++ API currently only implements UTS #46.
* The uidna.h C API implements both UTS #46 (functions using UIDNA service object)
* and IDNA2003 (functions that do not use a service object).
- * @draft ICU 4.6
+ * @stable ICU 4.6
*/
class U_COMMON_API IDNA : public UObject {
public:
+ /**
+ * Destructor.
+ * @stable ICU 4.6
+ */
+ ~IDNA();
+
/**
* Returns an IDNA instance which implements UTS #46.
* Returns an unmodifiable instance, owned by the caller.
* immediately. Check for U_FAILURE() on output or use with
* function chaining. (See User Guide for details.)
* @return the UTS #46 IDNA instance, if successful
- * @draft ICU 4.6
+ * @stable ICU 4.6
*/
static IDNA *
createUTS46Instance(uint32_t options, UErrorCode &errorCode);
* immediately. Check for U_FAILURE() on output or use with
* function chaining. (See User Guide for details.)
* @return dest
- * @draft ICU 4.6
+ * @stable ICU 4.6
*/
virtual UnicodeString &
labelToASCII(const UnicodeString &label, UnicodeString &dest,
* immediately. Check for U_FAILURE() on output or use with
* function chaining. (See User Guide for details.)
* @return dest
- * @draft ICU 4.6
+ * @stable ICU 4.6
*/
virtual UnicodeString &
labelToUnicode(const UnicodeString &label, UnicodeString &dest,
* immediately. Check for U_FAILURE() on output or use with
* function chaining. (See User Guide for details.)
* @return dest
- * @draft ICU 4.6
+ * @stable ICU 4.6
*/
virtual UnicodeString &
nameToASCII(const UnicodeString &name, UnicodeString &dest,
* immediately. Check for U_FAILURE() on output or use with
* function chaining. (See User Guide for details.)
* @return dest
- * @draft ICU 4.6
+ * @stable ICU 4.6
*/
virtual UnicodeString &
nameToUnicode(const UnicodeString &name, UnicodeString &dest,
* immediately. Check for U_FAILURE() on output or use with
* function chaining. (See User Guide for details.)
* @return dest
- * @draft ICU 4.6
+ * @stable ICU 4.6
*/
virtual void
labelToASCII_UTF8(const StringPiece &label, ByteSink &dest,
* immediately. Check for U_FAILURE() on output or use with
* function chaining. (See User Guide for details.)
* @return dest
- * @draft ICU 4.6
+ * @stable ICU 4.6
*/
virtual void
labelToUnicodeUTF8(const StringPiece &label, ByteSink &dest,
* immediately. Check for U_FAILURE() on output or use with
* function chaining. (See User Guide for details.)
* @return dest
- * @draft ICU 4.6
+ * @stable ICU 4.6
*/
virtual void
nameToASCII_UTF8(const StringPiece &name, ByteSink &dest,
* immediately. Check for U_FAILURE() on output or use with
* function chaining. (See User Guide for details.)
* @return dest
- * @draft ICU 4.6
+ * @stable ICU 4.6
*/
virtual void
nameToUnicodeUTF8(const StringPiece &name, ByteSink &dest,
IDNAInfo &info, UErrorCode &errorCode) const;
-
-private:
- // No ICU "poor man's RTTI" for this class nor its subclasses.
- virtual UClassID getDynamicClassID() const;
};
class UTS46;
/**
* Output container for IDNA processing errors.
* The IDNAInfo class is not suitable for subclassing.
- * @draft ICU 4.6
+ * @stable ICU 4.6
*/
class U_COMMON_API IDNAInfo : public UMemory {
public:
/**
* Constructor for stack allocation.
- * @draft ICU 4.6
+ * @stable ICU 4.6
*/
IDNAInfo() : errors(0), labelErrors(0), isTransDiff(FALSE), isBiDi(FALSE), isOkBiDi(TRUE) {}
/**
* Were there IDNA processing errors?
* @return TRUE if there were processing errors
- * @draft ICU 4.6
+ * @stable ICU 4.6
*/
UBool hasErrors() const { return errors!=0; }
/**
* Returns a bit set indicating IDNA processing errors.
* See UIDNA_ERROR_... constants in uidna.h.
* @return bit set of processing errors
- * @draft ICU 4.6
+ * @stable ICU 4.6
*/
uint32_t getErrors() const { return errors; }
/**
* mapped (sharp s/sigma) or removed (joiner/nonjoiner).
* </ul>
* @return TRUE if transitional and nontransitional processing produce different results
- * @draft ICU 4.6
+ * @stable ICU 4.6
*/
UBool isTransitionalDifferent() const { return isTransDiff; }