| 74 | } |
| 75 | |
| 76 | std::string SrcGenerator::reformat(const std::string &Code) { |
| 77 | auto Replaces = |
| 78 | clang::format::reformat(clang::format::getLLVMStyle(), Code, |
| 79 | clang::tooling::Range(0, Code.length())); |
| 80 | return clang::tooling::applyAllReplacements(Code, Replaces).get(); |
| 81 | } |
| 82 | |
| 83 | std::string SrcGenerator::genStrToCStr(const std::string &StrVar) { |
| 84 | return "const_cast<char *>(" + StrVar + ".c_str())"; |