diff options
author | Bernard Normier <bernard@zeroc.com> | 2016-10-20 21:03:44 -0400 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2016-10-20 21:03:44 -0400 |
commit | 3cb9c15995b828c52dba34d0a222f572d5bbc41b (patch) | |
tree | 87bad249c2ee04972be5f3c7635880cb0c556128 /cpp/include/IceUtil/StringUtil.h | |
parent | updating IceBT to BlueZ 5 (diff) | |
download | ice-3cb9c15995b828c52dba34d0a222f572d5bbc41b.tar.bz2 ice-3cb9c15995b828c52dba34d0a222f572d5bbc41b.tar.xz ice-3cb9c15995b828c52dba34d0a222f572d5bbc41b.zip |
Added support for non-ASCII characters and universal character names
to stringified identities and proxies.
This includes a new Ice.ToStringMode property.
Diffstat (limited to 'cpp/include/IceUtil/StringUtil.h')
-rw-r--r-- | cpp/include/IceUtil/StringUtil.h | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/cpp/include/IceUtil/StringUtil.h b/cpp/include/IceUtil/StringUtil.h index 2e0763e7a46..71497f558b5 100644 --- a/cpp/include/IceUtil/StringUtil.h +++ b/cpp/include/IceUtil/StringUtil.h @@ -7,8 +7,8 @@ // // ********************************************************************** -#ifndef ICE_STRING_UTIL_H -#define ICE_STRING_UTIL_H +#ifndef ICE_UTIL_STRING_UTIL_H +#define ICE_UTIL_STRING_UTIL_H #include <IceUtil/Config.h> #include <vector> @@ -17,10 +17,21 @@ namespace IceUtilInternal { // -// Add escape sequences (like "\n", or "\0xxx") to make a string -// readable in ASCII. +// Must be kept in sync with Ice::ToStringMode // -ICE_API std::string escapeString(const std::string&, const std::string&); +#ifdef ICE_CPP11_MAPPING +enum class ToStringMode : unsigned char +#else +enum ToStringMode +#endif +{ Unicode, ASCII, Compat }; + +// +// Add escape sequences (like "\n", or "\123") to the input string +// (first parameter). +// The second parameter adds characters to escape, and can be empty. +// +ICE_API std::string escapeString(const std::string&, const std::string&, ToStringMode); // // Remove escape sequences added by escapeString. Throws IllegalArgumentException @@ -35,7 +46,7 @@ ICE_API std::string unescapeString(const std::string&, std::string::size_type, s ICE_API bool splitString(const std::string&, const std::string&, std::vector<std::string>&); // -// Join a list of strings using the given delimiter. +// Join a list of strings using the given delimiter. // ICE_API std::string joinString(const std::vector<std::string>&, const std::string&); |