libsbmlcs.SBMLWriter.writeToString C# (CSharp) Method

writeToString() public method

public writeToString ( SBMLDocument d ) : string
d SBMLDocument
return string
        public string writeToString(SBMLDocument d)
        {
            string ret = libsbmlPINVOKE.SBMLWriter_writeToString(swigCPtr, SBMLDocument.getCPtr(d));
            return ret;
        }

Usage Example

コード例 #1
0
ファイル: TestSBase.cs プロジェクト: TotteKarlsson/roadrunner
        public void test_SBase_appendNotesWithGlobalNamespace()
        {
            string notes = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<sbml xmlns=\"http://www.sbml.org/sbml/level2/version4\" xmlns:html=\"http://www.w3.org/1999/xhtml\" level=\"2\" version=\"4\">\n" + "  <model id=\"test\" name=\"name\">\n" + "    <notes>\n" + "      <html:p>DATE: 2010/12/08 13:00:00</html:p>\n" + "      <html:p>VERSION: 0.99</html:p>\n" + "      <html:p>TAXONOMY: 9606</html:p>\n" + "    </notes>\n" + "  </model>\n" + "</sbml>\n";
            SBMLDocument sbmlDoc = new SBMLDocument (2, 4);
            sbmlDoc.getNamespaces ().@add ("http://www.w3.org/1999/xhtml", "html");
            Model sbmlModel = sbmlDoc.createModel ();
            sbmlModel.setId ("test");
            sbmlModel.setName ("name");
            setOrAppendNotes (sbmlModel, "<html:p>DATE: 2010/12/08 13:00:00</html:p>");
            setOrAppendNotes (sbmlModel, "<html:p>VERSION: 0.99</html:p>");
            setOrAppendNotes (sbmlModel, "<html:p>TAXONOMY: 9606</html:p>");

            SBMLWriter ttt = new SBMLWriter ();
            string documentString = ttt.writeToString (sbmlDoc);
            assertTrue ((notes == documentString));
        }