/** * Writes the given SBML document to the output stream. * * @param d the SBML document to be written * * @param stream the stream object where the SBML is to be written. * * @return @c true on success and @c false if one of the underlying * parser components fail (rare). * * @see setProgramVersion(string version) * @see setProgramName(string name) */ public bool writeSBML(SBMLDocument d, OStream stream) { bool ret = libsbmlPINVOKE.SBMLWriter_writeSBML__SWIG_1(swigCPtr, SBMLDocument.getCPtr(d), SWIGTYPE_p_std__ostream.getCPtr(stream.get_ostream())); if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); return ret; }
internal static HandleRef getCPtr(OStream obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; }
internal static HandleRef getCPtrAndDisown(OStream obj) { HandleRef ptr = new HandleRef(null, IntPtr.Zero); if (obj != null) { ptr = obj.swigCPtr; obj.swigCMemOwn = false; } return ptr; }
/** * Prints to the given output stream all the errors or warnings * encountered during parsing, consistency checking, or attempted * translation of this model. * * If no errors have occurred, i.e., <c>getNumErrors() == 0</c>, no * output will be sent to the stream. * * The format of the output is: * <code> N error(s): line NNN: (id) message </code> * * @if notcpp @docnote @htmlinclude warn-default-args-in-docs.html @endif */ public void printErrors(OStream stream) { libsbmlPINVOKE.SBMLDocument_printErrors__SWIG_0(swigCPtr, SWIGTYPE_p_std__ostream.getCPtr(stream.get_ostream())); if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); }
/** * Creates a new XMLOutputStream that wraps the given @p stream. * * * * * The functionality associated with the @p programName and @p * programVersion arguments concerns an optional comment that libSBML can * write at the beginning of the output stream. The comment is intended * for human readers of the XML file, and has the following form: * @verbatim <!-- Created by <program name> version <program version> on yyyy-MM-dd HH:mm with libSBML version <libsbml version>. --> @endverbatim * * This program information comment is a separate item from the XML * declaration that this method can also write to this output stream. The * comment is also not mandated by any SBML specification. This libSBML * functionality is provided for the convenience of calling programs, and to * help humans trace the origin of SBML files. * * * * * * * The XML declaration has the form * @verbatim <?xml version='1.0' encoding='UTF-8'?> @endverbatim * Note that the SBML specifications require the use of UTF-8 encoding and * version 1.0, so for SBML documents, the above is the standard XML * declaration. * * * * @param stream the input stream to wrap. * * @param encoding the XML encoding to declare in the output. This value * should be <code>'UTF-8'</code> for SBML documents. The default value * is <code>'UTF-8'</code> if no value is supplied for this parameter. * * @param writeXMLDecl whether to write a standard XML declaration at * the beginning of the content written on @p stream. The default is * @c true. * * @param programName an optional program name to write as a comment * in the output stream. * * @param programVersion an optional version identification string to write * as a comment in the output stream. * * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif */ public XMLOutputStream(OStream stream) : this(libsbmlPINVOKE.new_XMLOutputStream__SWIG_4(SWIGTYPE_p_std__ostream.getCPtr(stream.get_ostream())), true) { if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); }
/** * Creates a new XMLOutputStream that wraps the given @p stream. * * * * * The functionality associated with the @p programName and @p * programVersion arguments concerns an optional comment that libSBML can * write at the beginning of the output stream. The comment is intended * for human readers of the XML file, and has the following form: * @verbatim <!-- Created by <program name> version <program version> on yyyy-MM-dd HH:mm with libSBML version <libsbml version>. --> @endverbatim * * This program information comment is a separate item from the XML * declaration that this method can also write to this output stream. The * comment is also not mandated by any SBML specification. This libSBML * functionality is provided for the convenience of calling programs, and to * help humans trace the origin of SBML files. * * * * * * * The XML declaration has the form * @verbatim <?xml version='1.0' encoding='UTF-8'?> @endverbatim * Note that the SBML specifications require the use of UTF-8 encoding and * version 1.0, so for SBML documents, the above is the standard XML * declaration. * * * * @param stream the input stream to wrap. * * @param encoding the XML encoding to declare in the output. This value * should be <code>'UTF-8'</code> for SBML documents. The default value * is <code>'UTF-8'</code> if no value is supplied for this parameter. * * @param writeXMLDecl whether to write a standard XML declaration at * the beginning of the content written on @p stream. The default is * @c true. * * @param programName an optional program name to write as a comment * in the output stream. * * @param programVersion an optional version identification string to write * as a comment in the output stream. * * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif */ public XMLOutputStream(OStream stream, string encoding, bool writeXMLDecl) : this(libsbmlPINVOKE.new_XMLOutputStream__SWIG_2(SWIGTYPE_p_std__ostream.getCPtr(stream.get_ostream()), encoding, writeXMLDecl), true) { if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); }
/** * Prints the errors or warnings with given severity stored in this error log. * * This method prints the text to the stream given by the optional * parameter @p stream. If no stream is given, the method prints the * output to the standard error stream. * * The format of the output is: * @verbatim N error(s): line NNN: (id) message @endverbatim * If no errors with that severity was found, then no output will be produced. * * @param stream the ostream or ostringstream object indicating where * the output should be printed. * @param severity the severity of the errors sought. * */ public void printErrors(OStream stream, long severity) { libsbmlPINVOKE.XMLErrorLog_printErrors__SWIG_2(swigCPtr, SWIGTYPE_p_std__ostream.getCPtr(stream.get_ostream()), severity); if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); }
internal static HandleRef getCPtr(OStream obj) { return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr); }