1 //------------------------------------------------------------------------------ 2 // <auto-generated /> 3 // 4 // This file was automatically generated by SWIG (http://www.swig.org). 5 // Version 4.0.2 6 // 7 // Do not make changes to this file unless you know what you are doing--modify 8 // the SWIG interface file instead. 9 //------------------------------------------------------------------------------ 10 11 namespace libsbml { 12 13 using System; 14 using System.Runtime.InteropServices; 15 16 /** 17 * @sbmlpackage{core} 18 * 19 @htmlinclude pkg-marker-core.html Set of SBML Level + Version + namespace triples. 20 * 21 * @htmlinclude not-sbml-warning.html 22 * 23 * There are differences in the definitions of components between different 24 * SBML Levels, as well as Versions within Levels. For example, the 25 * 'sboTerm' attribute was not introduced until Level 2 26 * Version 2, and then only on certain component classes; the SBML 27 * Level 2 Version 3 specification moved the 'sboTerm' attribute 28 * to the SBase class, thereby allowing nearly all components to have SBO 29 * annotations. As a result of differences such as those, libSBML needs to 30 * track the SBML Level and Version of every object created. 31 * 32 * The purpose of the SBMLNamespaces object class is to make it easier to 33 * communicate SBML Level and Version data between libSBML constructors and 34 * other methods. The SBMLNamespaces object class tracks 3-tuples 35 * (triples) consisting of SBML Level, Version, and the corresponding SBML 36 * XML namespace. 37 * 38 * The plural name (SBMLNamespaces) is not a mistake, because in SBML 39 * Level 3, objects may have extensions added by Level 3 packages 40 * used by a given model and therefore may have multiple namespaces 41 * associated with them; however, until the introduction of SBML 42 * Level 3, the SBMLNamespaces object only records one SBML 43 * Level/Version/namespace combination at a time. Most constructors for 44 * SBML objects in libSBML take a SBMLNamespaces object as an argument, 45 * thereby allowing the constructor to produce the proper combination of 46 * attributes and other internal data structures for the given SBML Level 47 * and Version. 48 */ 49 50 public class SBMLNamespaces : global::System.IDisposable { 51 private HandleRef swigCPtr; 52 protected bool swigCMemOwn; 53 SBMLNamespaces(IntPtr cPtr, bool cMemoryOwn)54 internal SBMLNamespaces(IntPtr cPtr, bool cMemoryOwn) 55 { 56 swigCMemOwn = cMemoryOwn; 57 swigCPtr = new HandleRef(this, cPtr); 58 } 59 getCPtr(SBMLNamespaces obj)60 internal static HandleRef getCPtr(SBMLNamespaces obj) 61 { 62 return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; 63 } 64 getCPtrAndDisown(SBMLNamespaces obj)65 internal static HandleRef getCPtrAndDisown (SBMLNamespaces obj) 66 { 67 HandleRef ptr = new HandleRef(null, IntPtr.Zero); 68 69 if (obj != null) 70 { 71 ptr = obj.swigCPtr; 72 obj.swigCMemOwn = false; 73 } 74 75 return ptr; 76 } 77 ~SBMLNamespaces()78 ~SBMLNamespaces() { 79 Dispose(false); 80 } 81 Dispose()82 public void Dispose() { 83 Dispose(true); 84 global::System.GC.SuppressFinalize(this); 85 } 86 Dispose(bool disposing)87 protected virtual void Dispose(bool disposing) { 88 lock(this) { 89 if (swigCPtr.Handle != global::System.IntPtr.Zero) { 90 if (swigCMemOwn) { 91 swigCMemOwn = false; 92 libsbmlPINVOKE.delete_SBMLNamespaces(swigCPtr); 93 } 94 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); 95 } 96 } 97 } 98 operator ==(SBMLNamespaces lhs, SBMLNamespaces rhs)99 public static bool operator==(SBMLNamespaces lhs, SBMLNamespaces rhs) 100 { 101 if((Object)lhs == (Object)rhs) 102 { 103 return true; 104 } 105 106 if( ((Object)lhs == null) || ((Object)rhs == null) ) 107 { 108 return false; 109 } 110 111 return (getCPtr(lhs).Handle.ToString() == getCPtr(rhs).Handle.ToString()); 112 } 113 operator !=(SBMLNamespaces lhs, SBMLNamespaces rhs)114 public static bool operator!=(SBMLNamespaces lhs, SBMLNamespaces rhs) 115 { 116 return !(lhs == rhs); 117 } 118 Equals(Object sb)119 public override bool Equals(Object sb) 120 { 121 if ( ! (sb is SBMLNamespaces) ) 122 { 123 return false; 124 } 125 126 return this == (SBMLNamespaces)sb; 127 } 128 GetHashCode()129 public override int GetHashCode() 130 { 131 return swigCPtr.Handle.ToInt32(); 132 } 133 134 135 /** 136 * Creates a new SBMLNamespaces object corresponding to the given SBML 137 * @p level and @p version. 138 * 139 * 140 * 141 * SBMLNamespaces objects are used in libSBML to communicate SBML Level and 142 * Version data between constructors and other methods. The SBMLNamespaces 143 * object class holds triples consisting of SBML Level, Version, and the 144 * corresponding SBML XML namespace. Most constructors for SBML objects in 145 * libSBML take a SBMLNamespaces object as an argument, thereby allowing 146 * the constructor to produce the proper combination of attributes and 147 * other internal data structures for the given SBML Level and Version. 148 * 149 * The plural name (SBMLNamespaces) is not a mistake, because in SBML 150 * Level 3, objects may have extensions added by Level 3 packages 151 * used by a given model and therefore may have multiple namespaces 152 * associated with them. In SBML Levels below Level 3, the 153 * SBMLNamespaces object only records one SBML Level/Version/namespace 154 * combination at a time. Most constructors for SBML objects in libSBML 155 * take a SBMLNamespaces object as an argument, thereby allowing the 156 * constructor to produce the proper combination of attributes and other 157 * internal data structures for the given SBML Level and Version. 158 * 159 * 160 * @param level the SBML level. 161 * @param version the SBML version. 162 * 163 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 164 */ public SBMLNamespaces(long level, long version)165 SBMLNamespaces(long level, long version) : this(libsbmlPINVOKE.new_SBMLNamespaces__SWIG_0(level, version), true) { 166 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 167 } 168 169 170 /** 171 * Creates a new SBMLNamespaces object corresponding to the given SBML 172 * @p level and @p version. 173 * 174 * 175 * 176 * SBMLNamespaces objects are used in libSBML to communicate SBML Level and 177 * Version data between constructors and other methods. The SBMLNamespaces 178 * object class holds triples consisting of SBML Level, Version, and the 179 * corresponding SBML XML namespace. Most constructors for SBML objects in 180 * libSBML take a SBMLNamespaces object as an argument, thereby allowing 181 * the constructor to produce the proper combination of attributes and 182 * other internal data structures for the given SBML Level and Version. 183 * 184 * The plural name (SBMLNamespaces) is not a mistake, because in SBML 185 * Level 3, objects may have extensions added by Level 3 packages 186 * used by a given model and therefore may have multiple namespaces 187 * associated with them. In SBML Levels below Level 3, the 188 * SBMLNamespaces object only records one SBML Level/Version/namespace 189 * combination at a time. Most constructors for SBML objects in libSBML 190 * take a SBMLNamespaces object as an argument, thereby allowing the 191 * constructor to produce the proper combination of attributes and other 192 * internal data structures for the given SBML Level and Version. 193 * 194 * 195 * @param level the SBML level. 196 * @param version the SBML version. 197 * 198 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 199 */ public SBMLNamespaces(long level)200 SBMLNamespaces(long level) : this(libsbmlPINVOKE.new_SBMLNamespaces__SWIG_1(level), true) { 201 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 202 } 203 204 205 /** 206 * Creates a new SBMLNamespaces object corresponding to the given SBML 207 * @p level and @p version. 208 * 209 * 210 * 211 * SBMLNamespaces objects are used in libSBML to communicate SBML Level and 212 * Version data between constructors and other methods. The SBMLNamespaces 213 * object class holds triples consisting of SBML Level, Version, and the 214 * corresponding SBML XML namespace. Most constructors for SBML objects in 215 * libSBML take a SBMLNamespaces object as an argument, thereby allowing 216 * the constructor to produce the proper combination of attributes and 217 * other internal data structures for the given SBML Level and Version. 218 * 219 * The plural name (SBMLNamespaces) is not a mistake, because in SBML 220 * Level 3, objects may have extensions added by Level 3 packages 221 * used by a given model and therefore may have multiple namespaces 222 * associated with them. In SBML Levels below Level 3, the 223 * SBMLNamespaces object only records one SBML Level/Version/namespace 224 * combination at a time. Most constructors for SBML objects in libSBML 225 * take a SBMLNamespaces object as an argument, thereby allowing the 226 * constructor to produce the proper combination of attributes and other 227 * internal data structures for the given SBML Level and Version. 228 * 229 * 230 * @param level the SBML level. 231 * @param version the SBML version. 232 * 233 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 234 */ public SBMLNamespaces()235 SBMLNamespaces() : this(libsbmlPINVOKE.new_SBMLNamespaces__SWIG_2(), true) { 236 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 237 } 238 239 240 /** 241 * (For extensions) Creates a new SBMLNamespaces object corresponding to 242 * the combination of (1) the given SBML @p level and @p version, and (2) 243 * the given @p package with the @p package @p version. 244 * 245 * 246 * 247 * SBMLNamespaces objects are used in libSBML to communicate SBML Level and 248 * Version data between constructors and other methods. The SBMLNamespaces 249 * object class holds triples consisting of SBML Level, Version, and the 250 * corresponding SBML XML namespace. Most constructors for SBML objects in 251 * libSBML take a SBMLNamespaces object as an argument, thereby allowing 252 * the constructor to produce the proper combination of attributes and 253 * other internal data structures for the given SBML Level and Version. 254 * 255 * The plural name (SBMLNamespaces) is not a mistake, because in SBML 256 * Level 3, objects may have extensions added by Level 3 packages 257 * used by a given model and therefore may have multiple namespaces 258 * associated with them. In SBML Levels below Level 3, the 259 * SBMLNamespaces object only records one SBML Level/Version/namespace 260 * combination at a time. Most constructors for SBML objects in libSBML 261 * take a SBMLNamespaces object as an argument, thereby allowing the 262 * constructor to produce the proper combination of attributes and other 263 * internal data structures for the given SBML Level and Version. 264 * 265 * 266 * @param level the SBML Level. 267 * @param version the SBML Version. 268 * @param pkgName the string of package name (e.g. 'layout', 'multi'). 269 * @param pkgVersion the package version. 270 * @param pkgPrefix the prefix of the package namespace (e.g. 'layout', 'multi') to be added. 271 * The package's name will be used if the given string is empty (default). 272 * 273 * @throws SBMLExtensionException if the extension module that supports the 274 * combination of the given SBML Level, SBML Version, package name, and 275 * package version has not been registered with libSBML. 276 */ public SBMLNamespaces(long level, long version, string pkgName, long pkgVersion, string pkgPrefix)277 SBMLNamespaces(long level, long version, string pkgName, long pkgVersion, string pkgPrefix) : this(libsbmlPINVOKE.new_SBMLNamespaces__SWIG_3(level, version, pkgName, pkgVersion, pkgPrefix), true) { 278 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 279 } 280 281 282 /** 283 * (For extensions) Creates a new SBMLNamespaces object corresponding to 284 * the combination of (1) the given SBML @p level and @p version, and (2) 285 * the given @p package with the @p package @p version. 286 * 287 * 288 * 289 * SBMLNamespaces objects are used in libSBML to communicate SBML Level and 290 * Version data between constructors and other methods. The SBMLNamespaces 291 * object class holds triples consisting of SBML Level, Version, and the 292 * corresponding SBML XML namespace. Most constructors for SBML objects in 293 * libSBML take a SBMLNamespaces object as an argument, thereby allowing 294 * the constructor to produce the proper combination of attributes and 295 * other internal data structures for the given SBML Level and Version. 296 * 297 * The plural name (SBMLNamespaces) is not a mistake, because in SBML 298 * Level 3, objects may have extensions added by Level 3 packages 299 * used by a given model and therefore may have multiple namespaces 300 * associated with them. In SBML Levels below Level 3, the 301 * SBMLNamespaces object only records one SBML Level/Version/namespace 302 * combination at a time. Most constructors for SBML objects in libSBML 303 * take a SBMLNamespaces object as an argument, thereby allowing the 304 * constructor to produce the proper combination of attributes and other 305 * internal data structures for the given SBML Level and Version. 306 * 307 * 308 * @param level the SBML Level. 309 * @param version the SBML Version. 310 * @param pkgName the string of package name (e.g. 'layout', 'multi'). 311 * @param pkgVersion the package version. 312 * @param pkgPrefix the prefix of the package namespace (e.g. 'layout', 'multi') to be added. 313 * The package's name will be used if the given string is empty (default). 314 * 315 * @throws SBMLExtensionException if the extension module that supports the 316 * combination of the given SBML Level, SBML Version, package name, and 317 * package version has not been registered with libSBML. 318 */ public SBMLNamespaces(long level, long version, string pkgName, long pkgVersion)319 SBMLNamespaces(long level, long version, string pkgName, long pkgVersion) : this(libsbmlPINVOKE.new_SBMLNamespaces__SWIG_4(level, version, pkgName, pkgVersion), true) { 320 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 321 } 322 323 324 /** 325 * Copy constructor; creates a copy of a SBMLNamespaces. 326 * 327 * @param orig the SBMLNamespaces instance to copy. 328 */ public SBMLNamespaces(SBMLNamespaces orig)329 SBMLNamespaces(SBMLNamespaces orig) : this(libsbmlPINVOKE.new_SBMLNamespaces__SWIG_5(SBMLNamespaces.getCPtr(orig)), true) { 330 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 331 } 332 333 334 /** 335 * Creates and returns a deep copy of this SBMLNamespaces object. 336 * 337 * @return the (deep) copy of this SBMLNamespaces object. 338 */ public new clone()339 SBMLNamespaces clone() { 340 SBMLNamespaces ret 341 = (SBMLNamespaces) libsbml.DowncastSBMLNamespaces(libsbmlPINVOKE.SBMLNamespaces_clone(swigCPtr), true); 342 return ret; 343 } 344 345 346 /** 347 * Returns a string representing the SBML XML namespace for the 348 * given @p level and @p version of SBML. 349 * 350 * @param level the SBML level. 351 * @param version the SBML version. 352 * 353 * @return a string representing the SBML namespace that reflects the 354 * SBML Level and Version specified. 355 * 356 * 357 * @if python @note Because this is a static method on a class, the Python 358 * language interface for libSBML will contain two variants. One will be the 359 * expected, normal static method on the class (i.e., a regular 360 * <em>methodName</em>), and the other will be a standalone top-level 361 * function with the name <em>ClassName_methodName()</em>. This is merely an 362 * artifact of how the language interfaces are created in libSBML. The 363 * methods are functionally identical. @endif 364 * 365 * 366 */ public getSBMLNamespaceURI(long level, long version)367 static string getSBMLNamespaceURI(long level, long version) { 368 string ret = libsbmlPINVOKE.SBMLNamespaces_getSBMLNamespaceURI(level, version); 369 return ret; 370 } 371 372 373 /** 374 * Returns a list of all supported SBMLNamespaces in this version of 375 * libsbml. 376 * 377 * @return a list with supported SBML namespaces. 378 * 379 * 380 * @if python @note Because this is a static method on a class, the Python 381 * language interface for libSBML will contain two variants. One will be the 382 * expected, normal static method on the class (i.e., a regular 383 * <em>methodName</em>), and the other will be a standalone top-level 384 * function with the name <em>ClassName_methodName()</em>. This is merely an 385 * artifact of how the language interfaces are created in libSBML. The 386 * methods are functionally identical. @endif 387 * 388 * 389 */ public getSupportedNamespaces()390 static SBMLNamespacesList getSupportedNamespaces() { 391 IntPtr cPtr = libsbmlPINVOKE.SBMLNamespaces_getSupportedNamespaces(); 392 return (cPtr == IntPtr.Zero) ? null : new SBMLNamespacesList(cPtr, true); 393 } 394 395 396 /** 397 * Frees the list of supported namespaces as generated by 398 * getSupportedNamespaces(). 399 * 400 * @param supportedNS the list to be freed. 401 * 402 * 403 * @if python @note Because this is a static method on a class, the Python 404 * language interface for libSBML will contain two variants. One will be the 405 * expected, normal static method on the class (i.e., a regular 406 * <em>methodName</em>), and the other will be a standalone top-level 407 * function with the name <em>ClassName_methodName()</em>. This is merely an 408 * artifact of how the language interfaces are created in libSBML. The 409 * methods are functionally identical. @endif 410 * 411 * 412 */ public freeSBMLNamespaces(SWIGTYPE_p_List supportedNS)413 static void freeSBMLNamespaces(SWIGTYPE_p_List supportedNS) { 414 libsbmlPINVOKE.SBMLNamespaces_freeSBMLNamespaces(SWIGTYPE_p_List.getCPtr(supportedNS)); 415 } 416 417 418 /** 419 * Returns a string representing the SBML XML namespace of this 420 * object. 421 * 422 * @return a string representing the SBML namespace that reflects the 423 * SBML Level and Version of this object. 424 */ public new getURI()425 string getURI() { 426 string ret = libsbmlPINVOKE.SBMLNamespaces_getURI(swigCPtr); 427 return ret; 428 } 429 430 431 /** 432 * Get the SBML Level of this SBMLNamespaces object. 433 * 434 * @return the SBML Level of this SBMLNamespaces object. 435 */ public getLevel()436 long getLevel() { return (long)libsbmlPINVOKE.SBMLNamespaces_getLevel__SWIG_0(swigCPtr); } 437 438 439 /** 440 * Get the SBML Version of this SBMLNamespaces object. 441 * 442 * @return the SBML Version of this SBMLNamespaces object. 443 */ public getVersion()444 long getVersion() { return (long)libsbmlPINVOKE.SBMLNamespaces_getVersion__SWIG_0(swigCPtr); } 445 446 447 /** 448 * Get the XML namespaces list for this SBMLNamespaces object. 449 * 450 * 451 * 452 * SBMLNamespaces objects are used in libSBML to communicate SBML Level and 453 * Version data between constructors and other methods. The SBMLNamespaces 454 * object class holds triples consisting of SBML Level, Version, and the 455 * corresponding SBML XML namespace. Most constructors for SBML objects in 456 * libSBML take a SBMLNamespaces object as an argument, thereby allowing 457 * the constructor to produce the proper combination of attributes and 458 * other internal data structures for the given SBML Level and Version. 459 * 460 * The plural name (SBMLNamespaces) is not a mistake, because in SBML 461 * Level 3, objects may have extensions added by Level 3 packages 462 * used by a given model and therefore may have multiple namespaces 463 * associated with them. In SBML Levels below Level 3, the 464 * SBMLNamespaces object only records one SBML Level/Version/namespace 465 * combination at a time. Most constructors for SBML objects in libSBML 466 * take a SBMLNamespaces object as an argument, thereby allowing the 467 * constructor to produce the proper combination of attributes and other 468 * internal data structures for the given SBML Level and Version. 469 * 470 * 471 * @return the XML namespaces of this SBMLNamespaces object. 472 */ public getNamespaces()473 XMLNamespaces getNamespaces() { 474 global::System.IntPtr cPtr = libsbmlPINVOKE.SBMLNamespaces_getNamespaces__SWIG_0(swigCPtr); 475 XMLNamespaces ret = (cPtr == global::System.IntPtr.Zero) ? null : new XMLNamespaces(cPtr, false); 476 return ret; 477 } 478 479 480 /** 481 * Add the given XML namespaces list to the set of namespaces within this 482 * SBMLNamespaces object. 483 * 484 * The following code gives an example of how one could add the XHTML 485 * namespace to the list of namespaces recorded by the top-level 486 * <code><sbml></code> element of a model. It gives the new 487 * namespace a prefix of <code>html</code>. 488 * @if cpp 489 * @code{.cpp} 490 SBMLDocument sd; 491 try 492 { 493 sd = new SBMLDocument(3, 1); 494 } 495 catch (SBMLConstructorException e) 496 { 497 // Here, have code to handle a truly exceptional situation. Candidate 498 // causes include invalid combinations of SBML Level and Version 499 // (impossible if hardwired as given here), running out of memory, and 500 // unknown system exceptions. 501 } 502 503 SBMLNamespaces sn = sd->getNamespaces(); 504 if (sn != null) 505 { 506 sn->add('http://www.w3.org/1999/xhtml', 'html'); 507 } 508 else 509 { 510 // Handle another truly exceptional situation. 511 } 512 @endcode 513 @endif 514 @if java 515 @code{.java} 516 SBMLDocument sd; 517 try 518 { 519 sd = new SBMLDocument(3, 1); 520 } 521 catch (SBMLConstructorException e) 522 { 523 // Here, have code to handle a truly exceptional situation. Candidate 524 // causes include invalid combinations of SBML Level and Version 525 // (impossible if hardwired as given here), running out of memory, and 526 // unknown system exceptions. 527 } 528 529 SBMLNamespaces sn = sd.getNamespaces(); 530 if (sn != null) 531 { 532 sn.add('http://www.w3.org/1999/xhtml', 'html'); 533 } 534 else 535 { 536 // Handle another truly exceptional situation. 537 } 538 @endcode 539 @endif 540 @if python 541 @code{.py} 542 sbmlDoc = None 543 try: 544 sbmlDoc = SBMLDocument(3, 1) 545 except ValueError: 546 # Do something to handle exceptional situation. Candidate 547 # causes include invalid combinations of SBML Level and Version 548 # (impossible if hardwired as given here), running out of memory, and 549 # unknown system exceptions. 550 551 namespaces = sbmlDoc.getNamespaces() 552 if namespaces == None: 553 # Do something to handle case of no namespaces. 554 555 status = namespaces.add('http://www.w3.org/1999/xhtml', 'html') 556 if status != LIBSBML_OPERATION_SUCCESS: 557 # Do something to handle failure. 558 @endcode 559 @endif 560 @if csharp 561 @code{.cs} 562 SBMLDocument sd = null; 563 try 564 { 565 sd = new SBMLDocument(3, 1); 566 } 567 catch (SBMLConstructorException e) 568 { 569 // Here, have code to handle a truly exceptional situation. 570 // Candidate causes include invalid combinations of SBML 571 // Level and Version (impossible if hardwired as given here), 572 // running out of memory, and unknown system exceptions. 573 } 574 575 XMLNamespaces sn = sd.getNamespaces(); 576 if (sn != null) 577 { 578 sn.add('http://www.w3.org/1999/xhtml', 'html'); 579 } 580 else 581 { 582 // Handle another truly exceptional situation. 583 } 584 @endcode 585 * @endif 586 * 587 * @param xmlns the XML namespaces to be added. 588 * 589 * 590 * @return integer value indicating success/failure of the 591 * function. @if clike The value is drawn from the 592 * enumeration #OperationReturnValues_t. @endif The possible values 593 * returned by this function are: 594 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 595 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 596 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 597 */ public addNamespaces(XMLNamespaces xmlns)598 int addNamespaces(XMLNamespaces xmlns) { 599 int ret = libsbmlPINVOKE.SBMLNamespaces_addNamespaces(swigCPtr, XMLNamespaces.getCPtr(xmlns)); 600 return ret; 601 } 602 603 604 /** 605 * Add an XML namespace (a pair of URI and prefix) to the set of namespaces 606 * within this SBMLNamespaces object. 607 * 608 * @param uri the XML namespace to be added. 609 * @param prefix the prefix of the namespace to be added. 610 * 611 * 612 * @return integer value indicating success/failure of the 613 * function. @if clike The value is drawn from the 614 * enumeration #OperationReturnValues_t. @endif The possible values 615 * returned by this function are: 616 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 617 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 618 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 619 */ public addNamespace(string uri, string prefix)620 int addNamespace(string uri, string prefix) { 621 int ret = libsbmlPINVOKE.SBMLNamespaces_addNamespace(swigCPtr, uri, prefix); 622 return ret; 623 } 624 625 626 /** 627 * Removes an XML namespace from the set of namespaces within this 628 * SBMLNamespaces object. 629 * 630 * @param uri the XML namespace to be added. 631 * 632 * 633 * @return integer value indicating success/failure of the 634 * function. @if clike The value is drawn from the 635 * enumeration #OperationReturnValues_t. @endif The possible values 636 * returned by this function are: 637 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 638 * @li @link libsbml#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE@endlink 639 */ public removeNamespace(string uri)640 int removeNamespace(string uri) { 641 int ret = libsbmlPINVOKE.SBMLNamespaces_removeNamespace(swigCPtr, uri); 642 return ret; 643 } 644 645 646 /** 647 * Add an XML namespace (a pair of URI and prefix) of a package extension 648 * to the set of namespaces within this SBMLNamespaces object. 649 * 650 * The SBML Level and SBML Version of this object is used. 651 * 652 * @param pkgName the string of package name (e.g. 'layout', 'multi'). 653 * @param pkgVersion the package version. 654 * @param prefix the prefix of the package namespace to be added. 655 * The package's name will be used if the given string is empty (default). 656 * 657 * 658 * @return integer value indicating success/failure of the 659 * function. @if clike The value is drawn from the 660 * enumeration #OperationReturnValues_t. @endif The possible values 661 * returned by this function are: 662 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 663 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 664 * 665 * @note An XML namespace of a non-registered package extension can't be 666 * added by this function (@link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 667 * will be returned). 668 * 669 * @see addNamespace(@if java String, String@endif) 670 */ public addPackageNamespace(string pkgName, long pkgVersion, string prefix)671 int addPackageNamespace(string pkgName, long pkgVersion, string prefix) { 672 int ret = libsbmlPINVOKE.SBMLNamespaces_addPackageNamespace__SWIG_0(swigCPtr, pkgName, pkgVersion, prefix); 673 return ret; 674 } 675 676 677 /** 678 * Add an XML namespace (a pair of URI and prefix) of a package extension 679 * to the set of namespaces within this SBMLNamespaces object. 680 * 681 * The SBML Level and SBML Version of this object is used. 682 * 683 * @param pkgName the string of package name (e.g. 'layout', 'multi'). 684 * @param pkgVersion the package version. 685 * @param prefix the prefix of the package namespace to be added. 686 * The package's name will be used if the given string is empty (default). 687 * 688 * 689 * @return integer value indicating success/failure of the 690 * function. @if clike The value is drawn from the 691 * enumeration #OperationReturnValues_t. @endif The possible values 692 * returned by this function are: 693 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 694 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 695 * 696 * @note An XML namespace of a non-registered package extension can't be 697 * added by this function (@link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 698 * will be returned). 699 * 700 * @see addNamespace(@if java String, String@endif) 701 */ public addPackageNamespace(string pkgName, long pkgVersion)702 int addPackageNamespace(string pkgName, long pkgVersion) { 703 int ret = libsbmlPINVOKE.SBMLNamespaces_addPackageNamespace__SWIG_1(swigCPtr, pkgName, pkgVersion); 704 return ret; 705 } 706 707 708 /** 709 * Add the XML namespaces of package extensions in the given XMLNamespace 710 * object to the set of namespaces within this SBMLNamespaces object 711 * (Non-package XML namespaces are not added by this function). 712 * 713 * @param xmlns the XML namespaces to be added. 714 * 715 * 716 * @return integer value indicating success/failure of the 717 * function. @if clike The value is drawn from the 718 * enumeration #OperationReturnValues_t. @endif The possible values 719 * returned by this function are: 720 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 721 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 722 * 723 * @note XML namespaces of a non-registered package extensions are not 724 * added (just ignored) by this function. @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink will be returned if the given 725 * xmlns is @c null. 726 */ public addPackageNamespaces(XMLNamespaces xmlns)727 int addPackageNamespaces(XMLNamespaces xmlns) { 728 int ret = libsbmlPINVOKE.SBMLNamespaces_addPackageNamespaces(swigCPtr, XMLNamespaces.getCPtr(xmlns)); 729 return ret; 730 } 731 732 733 /** 734 * Removes an XML namespace of a package extension from the set of namespaces 735 * within this SBMLNamespaces object. 736 * 737 * @param level the SBML level. 738 * @param version the SBML version. 739 * @param pkgName the string of package name (e.g. 'layout', 'multi'). 740 * @param pkgVersion the package version. 741 * 742 * 743 * @return integer value indicating success/failure of the 744 * function. @if clike The value is drawn from the 745 * enumeration #OperationReturnValues_t. @endif The possible values 746 * returned by this function are: 747 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 748 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 749 * @li @link libsbml#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE@endlink 750 */ public removePackageNamespace(long level, long version, string pkgName, long pkgVersion)751 int removePackageNamespace(long level, long version, string pkgName, long pkgVersion) { 752 int ret = libsbmlPINVOKE.SBMLNamespaces_removePackageNamespace(swigCPtr, level, version, pkgName, pkgVersion); 753 return ret; 754 } 755 756 757 /** */ /* libsbml-internal */ public addPkgNamespace(string pkgName, long pkgVersion, string prefix)758 int addPkgNamespace(string pkgName, long pkgVersion, string prefix) { 759 int ret = libsbmlPINVOKE.SBMLNamespaces_addPkgNamespace__SWIG_0(swigCPtr, pkgName, pkgVersion, prefix); 760 return ret; 761 } 762 763 764 /** */ /* libsbml-internal */ public addPkgNamespace(string pkgName, long pkgVersion)765 int addPkgNamespace(string pkgName, long pkgVersion) { 766 int ret = libsbmlPINVOKE.SBMLNamespaces_addPkgNamespace__SWIG_1(swigCPtr, pkgName, pkgVersion); 767 return ret; 768 } 769 770 771 /** */ /* libsbml-internal */ public addPkgNamespaces(XMLNamespaces xmlns)772 int addPkgNamespaces(XMLNamespaces xmlns) { 773 int ret = libsbmlPINVOKE.SBMLNamespaces_addPkgNamespaces(swigCPtr, XMLNamespaces.getCPtr(xmlns)); 774 return ret; 775 } 776 777 778 /** */ /* libsbml-internal */ public removePkgNamespace(long level, long version, string pkgName, long pkgVersion)779 int removePkgNamespace(long level, long version, string pkgName, long pkgVersion) { 780 int ret = libsbmlPINVOKE.SBMLNamespaces_removePkgNamespace(swigCPtr, level, version, pkgName, pkgVersion); 781 return ret; 782 } 783 784 785 /** 786 * Predicate returning @c true if the given URL is one of SBML XML 787 * namespaces. 788 * 789 * @param uri the URI of namespace. 790 * 791 * @return @c true if the 'uri' is one of SBML namespaces, @c false otherwise. 792 * 793 * 794 * @if python @note Because this is a static method on a class, the Python 795 * language interface for libSBML will contain two variants. One will be the 796 * expected, normal static method on the class (i.e., a regular 797 * <em>methodName</em>), and the other will be a standalone top-level 798 * function with the name <em>ClassName_methodName()</em>. This is merely an 799 * artifact of how the language interfaces are created in libSBML. The 800 * methods are functionally identical. @endif 801 * 802 * 803 */ public isSBMLNamespace(string uri)804 static bool isSBMLNamespace(string uri) { 805 bool ret = libsbmlPINVOKE.SBMLNamespaces_isSBMLNamespace(uri); 806 return ret; 807 } 808 809 810 /** 811 * Predicate returning @c true if the given set of namespaces represent a 812 * valid set 813 * 814 * @return @c true if the set of namespaces is valid, @c false otherwise. 815 */ public isValidCombination()816 bool isValidCombination() { 817 bool ret = libsbmlPINVOKE.SBMLNamespaces_isValidCombination(swigCPtr); 818 return ret; 819 } 820 821 822 /** */ /* libsbml-internal */ public setLevel(long level)823 void setLevel(long level) { 824 libsbmlPINVOKE.SBMLNamespaces_setLevel(swigCPtr, level); 825 } 826 827 828 /** */ /* libsbml-internal */ public setVersion(long version)829 void setVersion(long version) { 830 libsbmlPINVOKE.SBMLNamespaces_setVersion(swigCPtr, version); 831 } 832 833 834 /** */ /* libsbml-internal */ public setNamespaces(XMLNamespaces xmlns)835 void setNamespaces(XMLNamespaces xmlns) { 836 libsbmlPINVOKE.SBMLNamespaces_setNamespaces(swigCPtr, XMLNamespaces.getCPtr(xmlns)); 837 } 838 839 840 /** 841 * Returns the name of the main package for this namespace. 842 * 843 * @return the name of the main package for this namespace. 844 * 'core' will be returned if this namespace is defined in the SBML 845 * core. 846 */ public new getPackageName()847 string getPackageName() { 848 string ret = libsbmlPINVOKE.SBMLNamespaces_getPackageName(swigCPtr); 849 return ret; 850 } 851 852 } 853 854 } 855