mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 17:18:20 +00:00
factoring out CPPEscape to be a standalone function
This commit is contained in:
parent
14abfc6831
commit
bc3bf4ea6c
2 changed files with 64 additions and 0 deletions
|
@ -36,4 +36,12 @@ extern bool is_CPP_compilable(const ProfileFunc* pf, const char** reason = nullp
|
|||
extern void lock_file(const std::string& fname, FILE* f);
|
||||
extern void unlock_file(const std::string& fname, FILE* f);
|
||||
|
||||
// For the given byte array / string, returns a version expanded
|
||||
// with escape sequences in order to represent it as a C++ string.
|
||||
extern std::string CPPEscape(const char* b, int len);
|
||||
inline std::string CPPEscape(const char* s)
|
||||
{
|
||||
return CPPEscape(s, strlen(s));
|
||||
}
|
||||
|
||||
} // zeek::detail
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue