Initial Commit

Initial commit of project.
This commit is contained in:
Alex Stewart
2019-03-09 01:21:44 -08:00
parent e54e9653ed
commit 13420951b1
124 changed files with 5883 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
package network;
import utils.HTTPUtils;
public class NetworkColiru
{
public String compileCPlus(String query)
{
// Escape characters that need escaping.
// Primarily types of whitespace.
query = query.replace("\\n", "\\\\n");
query = query.replace("\\t", "\\\\t");
query = query.replace("\n", "\\n");
query = query.replace("\"", "\\\"");
query = query.replace("\t", "\\t");
// Send the compilation request!
String result = HTTPUtils.SendPOSTRequest("http://coliru.stacked-crooked.com/compile"
, "{ \"cmd\": \"g++ main.cpp && ./a.out\", \"src\": \"" + query + "\" }");
// If we got a valid response...
if(!result.isEmpty())
{
result = "Here's what happened when I went to compiled that! \n```" + result + "```";
}
return result;
}
}