usprep.h
Go to the documentation of this file.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
*
* Copyright (C) 2003-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
* file name: usprep.h
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
* created on: 2003jul2
* created by: Ram Viswanadha
*/
#ifndef __USPREP_H__
#define __USPREP_H__
#include "unicode/utypes.h"
#if U_SHOW_CPLUSPLUS_API
#include "unicode/localpointer.h"
#endif // U_SHOW_CPLUSPLUS_API
#if !UCONFIG_NO_IDNA
#include "unicode/parseerr.h"
typedef struct UStringPrepProfile UStringPrepProfile;
#define USPREP_DEFAULT 0x0000
#define USPREP_ALLOW_UNASSIGNED 0x0001
typedef enum UStringPrepProfileType {
USPREP_RFC3491_NAMEPREP,
USPREP_RFC3530_NFS4_CS_PREP,
USPREP_RFC3530_NFS4_CS_PREP_CI,
USPREP_RFC3530_NFS4_CIS_PREP,
USPREP_RFC3530_NFS4_MIXED_PREP_PREFIX,
USPREP_RFC3530_NFS4_MIXED_PREP_SUFFIX,
USPREP_RFC3722_ISCSI,
USPREP_RFC3920_NODEPREP,
USPREP_RFC3920_RESOURCEPREP,
USPREP_RFC4011_MIB,
USPREP_RFC4013_SASLPREP,
USPREP_RFC4505_TRACE,
USPREP_RFC4518_LDAP,
USPREP_RFC4518_LDAP_CI
} UStringPrepProfileType;
U_CAPI UStringPrepProfile* U_EXPORT2
usprep_open(const char* path,
const char* fileName,
UErrorCode* status);
U_CAPI UStringPrepProfile* U_EXPORT2
usprep_openByType(UStringPrepProfileType type,
UErrorCode* status);
U_CAPI void U_EXPORT2
usprep_close(UStringPrepProfile* profile);
#if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN
U_DEFINE_LOCAL_OPEN_POINTER(LocalUStringPrepProfilePointer, UStringPrepProfile, usprep_close);
U_NAMESPACE_END
#endif
U_CAPI int32_t U_EXPORT2
usprep_prepare( const UStringPrepProfile* prep,
const UChar* src, int32_t srcLength,
UChar* dest, int32_t destCapacity,
int32_t options,
UParseError* parseError,
UErrorCode* status );
#endif /* #if !UCONFIG_NO_IDNA */
#endif
LocalUStringPrepProfilePointer
"Smart pointer" class, closes a UStringPrepProfile via usprep_close().
localpointer.h
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
U_DEFINE_LOCAL_OPEN_POINTER
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
Definition: localpointer.h:550
parseerr.h
C API: Parse Error Information.
UParseError
A UParseError struct is used to returned detailed information about parsing errors.
Definition: parseerr.h:58
U_CAPI
#define U_CAPI
This is used to declare a function as a public ICU C API.
Definition: umachine.h:110
UChar
char16_t UChar
The base type for UTF-16 code units and pointers.
Definition: umachine.h:386
usprep_openByType
U_CAPI UStringPrepProfile * usprep_openByType(UStringPrepProfileType type, UErrorCode *status)
Creates a StringPrep profile for the specified profile type.
usprep_open
U_CAPI UStringPrepProfile * usprep_open(const char *path, const char *fileName, UErrorCode *status)
Creates a StringPrep profile from the data file.
UStringPrepProfile
struct UStringPrepProfile UStringPrepProfile
StringPrep API implements the StingPrep framework as described by RFC 3454.
Definition: usprep.h:73
UStringPrepProfileType
UStringPrepProfileType
enums for the standard stringprep profile types supported by usprep_openByType.
Definition: usprep.h:98
USPREP_RFC4011_MIB
@ USPREP_RFC4011_MIB
RFC4011 Policy MIB Stringprep.
Definition: usprep.h:148
USPREP_RFC4505_TRACE
@ USPREP_RFC4505_TRACE
RFC4505 trace.
Definition: usprep.h:158
USPREP_RFC3530_NFS4_MIXED_PREP_SUFFIX
@ USPREP_RFC3530_NFS4_MIXED_PREP_SUFFIX
RFC3530 nfs4_mixed_prep for suffix.
Definition: usprep.h:128
USPREP_RFC3530_NFS4_CS_PREP
@ USPREP_RFC3530_NFS4_CS_PREP
RFC3530 nfs4_cs_prep.
Definition: usprep.h:108
USPREP_RFC3722_ISCSI
@ USPREP_RFC3722_ISCSI
RFC3722 iSCSI.
Definition: usprep.h:133
USPREP_RFC4518_LDAP_CI
@ USPREP_RFC4518_LDAP_CI
RFC4518 LDAP for case ignore, numeric and stored prefix matching rules.
Definition: usprep.h:169
USPREP_RFC3530_NFS4_CS_PREP_CI
@ USPREP_RFC3530_NFS4_CS_PREP_CI
RFC3530 nfs4_cs_prep with case insensitive option.
Definition: usprep.h:113
USPREP_RFC4518_LDAP
@ USPREP_RFC4518_LDAP
RFC4518 LDAP.
Definition: usprep.h:163
USPREP_RFC4013_SASLPREP
@ USPREP_RFC4013_SASLPREP
RFC4013 SASLprep.
Definition: usprep.h:153
USPREP_RFC3920_NODEPREP
@ USPREP_RFC3920_NODEPREP
RFC3920 XMPP Nodeprep.
Definition: usprep.h:138
USPREP_RFC3530_NFS4_CIS_PREP
@ USPREP_RFC3530_NFS4_CIS_PREP
RFC3530 nfs4_cis_prep.
Definition: usprep.h:118
USPREP_RFC3530_NFS4_MIXED_PREP_PREFIX
@ USPREP_RFC3530_NFS4_MIXED_PREP_PREFIX
RFC3530 nfs4_mixed_prep for prefix.
Definition: usprep.h:123
USPREP_RFC3920_RESOURCEPREP
@ USPREP_RFC3920_RESOURCEPREP
RFC3920 XMPP Resourceprep.
Definition: usprep.h:143
USPREP_RFC3491_NAMEPREP
@ USPREP_RFC3491_NAMEPREP
RFC3491 Nameprep.
Definition: usprep.h:103
usprep_prepare
U_CAPI int32_t usprep_prepare(const UStringPrepProfile *prep, const UChar *src, int32_t srcLength, UChar *dest, int32_t destCapacity, int32_t options, UParseError *parseError, UErrorCode *status)
Prepare the input buffer for use in applications with the given profile.
usprep_close
U_CAPI void usprep_close(UStringPrepProfile *profile)
Closes the profile.
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415