Program Listing for File Escape.h#
↰ Return to documentation for file (src/util/StringUtility/Escape.h)
#ifndef ROSE_StringUtility_Escape_H
#define ROSE_StringUtility_Escape_H
#include <rosedll.h>
#include <string>
ROSE_UTIL_API std::string escapeString(const std::string& s);
ROSE_UTIL_API std::string unescapeString(const std::string& s);
namespace Rose {
namespace StringUtility {
// Character-escaping functions
ROSE_UTIL_API std::string htmlEscape(const std::string&);
ROSE_UTIL_API std::string cEscape(const std::string&, char context = '"');
ROSE_UTIL_API std::string cEscape(char, char context = '\'');
ROSE_UTIL_API std::string cUnescape(const std::string&);
ROSE_UTIL_API std::string bourneEscape(const std::string&);
ROSE_UTIL_API std::string yamlEscape(const std::string&);
ROSE_UTIL_API std::string csvEscape(const std::string&);
// [Robb Matzke 2016-05-06]: I am deprecating escapeNewLineCharaters because:
// 1. Its name is spelled wrong: "Charater"
// 2. "newline" in this context is a single word and should be capitalized as "Newline" not "NewLine"
// 3. Its name is misleading because it also escapes double quotes.
// 4. It escapes newlines using "l" rather than the more customary "n".
// I would just remove it, but it seems to be used in some projects and the tutorial.
ROSE_UTIL_API std::string escapeNewLineCharaters(const std::string&);
// DQ (12/8/2016): This is ued in the generation of dot files.
ROSE_UTIL_API std::string escapeNewlineAndDoubleQuoteCharacters(const std::string&);
} // namespace
} // namespace
#endif