diff options
author | Bernard Normier <bernard@zeroc.com> | 2016-10-25 18:35:15 -0400 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2016-10-25 18:35:15 -0400 |
commit | 95624751e9d98d1265e0a007e7d7a1186036750b (patch) | |
tree | d13da90f17629496d13d5badb32b04803239d662 /cpp/src/Slice/Util.h | |
parent | Nuget package updates (diff) | |
download | ice-95624751e9d98d1265e0a007e7d7a1186036750b.tar.bz2 ice-95624751e9d98d1265e0a007e7d7a1186036750b.tar.xz ice-95624751e9d98d1265e0a007e7d7a1186036750b.zip |
Refactored string literal generation and updated identityToString format
Diffstat (limited to 'cpp/src/Slice/Util.h')
-rw-r--r-- | cpp/src/Slice/Util.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cpp/src/Slice/Util.h b/cpp/src/Slice/Util.h index fdf84a1290e..5b23acf389c 100644 --- a/cpp/src/Slice/Util.h +++ b/cpp/src/Slice/Util.h @@ -37,6 +37,22 @@ std::vector<std::string> argvToArgs(int argc, char* argv[]); #endif +enum EscapeMode { UCN, Octal, ShortUCN, EC6UCN }; + +// Parameters: +// const string& value: input string provided by Slice Parser +// const string& nonPrintableEscaped: which of \a, \b, \f, \n, \r, \t, \v, \0 (null), \x20 (\s), \x1b (\e) are +// escaped in the target language +// Warning: don't include \0 if the target language recognizes octal escapes +// const string& printableEscaped: additional printable ASCII characters other than \ and " that need to be escaped +// EscapeMode escapeMode: whether we generate both UCNs, octal escape sequences, only short UCNs (\unnnn), +// or ECMAScript 6-style UCNs with \u{...} for astral characters +// unsigned char cutOff: characters < cutOff other than the nonPrintableEscaped are generated as +// octal escape sequences, regardless of escapeMode. +std::string +toStringLiteral(const std::string&, const std::string&, const std::string&, EscapeMode, unsigned char); + + class DependOutputUtil : IceUtil::noncopyable { public: |