MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / CEscape

Function CEscape

extern/re2/util/strutil.cc:68–76  ·  view source on GitHub ↗

---------------------------------------------------------------------- CEscape() Copies 'src' to result, escaping dangerous characters using C-style escape sequences. 'src' and 'dest' should not overlap. ----------------------------------------------------------------------

Source from the content-addressed store, hash-verified

66// C-style escape sequences. 'src' and 'dest' should not overlap.
67// ----------------------------------------------------------------------
68std::string CEscape(const StringPiece& src) {
69 const size_t dest_len = src.size() * 4 + 1; // Maximum possible expansion
70 char* dest = new char[dest_len];
71 const size_t used = CEscapeString(src.data(), src.size(),
72 dest, dest_len);
73 std::string s = std::string(dest, used);
74 delete[] dest;
75 return s;
76}
77
78void PrefixSuccessor(std::string* prefix) {
79 // We can increment the last character in the string and be done

Callers 7

TESTFunction · 0.85
HandleRegexpMethod · 0.85
RunPostfixMethod · 0.85
TestInstanceMethod · 0.85
RunSearchMethod · 0.85
RunCaseMethod · 0.85
LogMatchMethod · 0.85

Calls 3

CEscapeStringFunction · 0.85
sizeMethod · 0.45
dataMethod · 0.45

Tested by 6

TESTFunction · 0.68
HandleRegexpMethod · 0.68
TestInstanceMethod · 0.68
RunSearchMethod · 0.68
RunCaseMethod · 0.68
LogMatchMethod · 0.68