MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / escapeHtmlString

Function escapeHtmlString

tools/shell/embedded_shell.cpp:886–910  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

884}
885
886std::string escapeHtmlString(const std::string& str) {
887 std::ostringstream escaped;
888 for (char c : str) {
889 switch (c) {
890 case '&':
891 escaped << "&amp;";
892 break;
893 case '\"':
894 escaped << "&quot;";
895 break;
896 case '\'':
897 escaped << "&apos;";
898 break;
899 case '<':
900 escaped << "&lt;";
901 break;
902 case '>':
903 escaped << "&gt;";
904 break;
905 default:
906 escaped << c;
907 }
908 }
909 return escaped.str();
910}
911
912std::string EmbeddedShell::printHtmlExecutionResult(QueryResult& queryResult) const {
913 auto colNames = queryResult.getColumnNames();

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected