ICU-410 add API facades for string unescaping
X-SVN-Rev: 1707
This commit is contained in:
parent
c685f44e89
commit
6aea18ee6e
@ -71,6 +71,25 @@ U_COMMON_API ostream &operator<<(ostream& stream, const UnicodeString& s);
|
||||
# define UNICODE_STRING(cs, length) UnicodeString(cs, length, "")
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Unescape an entire string.
|
||||
* ### TBD
|
||||
*/
|
||||
U_COMMON_API UnicodeString
|
||||
u_unescape(const UnicodeString &s);
|
||||
|
||||
/**
|
||||
* Unescape one escape sequence in a string and return the code point.
|
||||
* <code>s[offset]</code> must be the beginning of an escape sequence.
|
||||
* <code>offset</code> is advanced to the first character after the
|
||||
* escape sequence.
|
||||
* If an error occurs, then U+ffff is returned and the offset is not
|
||||
* advanced.
|
||||
* ### TBD
|
||||
*/
|
||||
U_COMMON_API UChar32
|
||||
u_unescape(const UnicodeString &s, int32_t &offset);
|
||||
|
||||
/**
|
||||
* UnicodeString is a concrete implementation of the abstract class Replaceable.
|
||||
* It is a string class that stores Unicode characters directly and provides
|
||||
|
@ -232,4 +232,13 @@ U_CAPI char* U_EXPORT2 u_austrcpy(char *s1,
|
||||
# define U_STRING_INIT(var, cs, length) u_charsToUChars(cs, var, length+1)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Unescape a string of invariant characters and write
|
||||
* the resulting Unicode characters to the destination.
|
||||
* ### TBD
|
||||
*/
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
u_unescapeChars(const char *s,
|
||||
UChar *dest, int32_t destSize);
|
||||
|
||||
#endif
|
||||
|
@ -85,6 +85,21 @@ us_arrayCopy(const UChar *src, int32_t srcStart,
|
||||
|
||||
UConverter* UnicodeString::fgDefaultConverter = 0;
|
||||
|
||||
//========================================
|
||||
// Unescaping
|
||||
//========================================
|
||||
U_COMMON_API UnicodeString
|
||||
u_unescape(const UnicodeString &s) {
|
||||
/* ### TBD */
|
||||
return s;
|
||||
}
|
||||
|
||||
U_COMMON_API UChar32
|
||||
u_unescape(const UnicodeString &s, int32_t &offset) {
|
||||
/* ### TBD */
|
||||
return 0xffff;
|
||||
}
|
||||
|
||||
//========================================
|
||||
// Constructors
|
||||
//========================================
|
||||
|
@ -326,3 +326,10 @@ releaseDefaultConverter(UConverter *converter)
|
||||
ucnv_close(converter);
|
||||
}
|
||||
}
|
||||
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
u_unescapeChars(const char *s,
|
||||
UChar *dest, int32_t destSize) {
|
||||
/* ### TBD */
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user