(src_lines, var_name, lines)
| 94 | |
| 95 | |
| 96 | def add_cpp_string_array(src_lines, var_name, lines): |
| 97 | add_comments_header(lines) |
| 98 | |
| 99 | lines.append("const char *{0}[] = {{".format(var_name)) |
| 100 | |
| 101 | for src_line in src_lines: |
| 102 | lines.append('"' + cpp_escape(src_line) + "\\n\",") |
| 103 | |
| 104 | # Null string at the end to act as terminator |
| 105 | lines.append('0') |
| 106 | |
| 107 | lines.append("};") |
| 108 | |
| 109 | add_comments_footer(lines) |
| 110 | |
| 111 | |
| 112 | MAX_STRING_LITERAL_SIZE = 65536 |
no test coverage detected