示例#1
0
文件: reader.go 项目: rputikar/sbml
//ReadSBML ...
func ReadSBML(file string) (doc *Document, err error) {
	cfile := C.CString(file)
	defer C.free(unsafe.Pointer(cfile))
	doc = &Document{}
	doc.d = C.readSBML(cfile)

	errors := int(C.SBMLDocument_getNumErrors(doc.d))

	if errors > 0 {
		fmt.Printf("Encountered the following SBML error(s):\n")
		C.SBMLDocument_printErrors(doc.d, (*C.FILE)(C.stdout))
		fmt.Printf("Conversion skipped.  Please correct the problems above first.\n")
		return nil, err
	}

	return doc, err
}
示例#2
0
文件: document.go 项目: rputikar/sbml
//GetNumErrors ...
func (d *Document) GetNumErrors() int {
	return int(C.SBMLDocument_getNumErrors(d.d))
}