/// <summary> /// Get details about a ideone.com submission. /// </summary> /// <param name="submission"></param> /// <returns></returns> public void GetSubmissionDetails(Submission submission) { Object[] ret = _ideoneClient.getSubmissionDetails( this.Username, this.Password, submission.Link, true, true, true, true, true); Dictionary<string, string> result = ResultToDict(ret); submission.AddDetails(result); }
/// <summary> /// Create an ideone.com submission. /// </summary> /// <param name="sourceCode"></param> /// <param name="language"></param> /// <param name="input"></param> /// <returns></returns> public Submission CreateSubmission(String sourceCode, int language, String input) { Object[] ret = _ideoneClient.createSubmission( this.Username, this.Password, sourceCode, language, input, true, true); Dictionary<string, string> result = ResultToDict(ret); Submission submission = new Submission {ErrorCode = result["error"]}; if (submission.ErrorCode == "OK") { submission.Link = result["link"]; } else { ThrowClientError(result["error"]); } return submission; }
/// <summary> /// Returns true only if the submission has been compiled and finished running /// </summary> /// <param name="submission"></param> /// <returns></returns> public Boolean IsSubmissionCompiled(Submission submission) { Object[] ret = _ideoneClient.getSubmissionDetails( this.Username, this.Password, submission.Link, false, false, false, false, false); Dictionary<string, string> result = ResultToDict(ret); return (true && result["status"] == "0"); }