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 A qualified XML name.
20  *
21  * @htmlinclude not-sbml-warning.html
22  *
23  * A 'triple' in the libSBML XML layer encapsulates the notion of qualified
24  * name, meaning an element name or an attribute name with an optional
25  * namespace qualifier.  Triples by themselves are not entities in an XML
26  * stream&mdash;they are not, for example, elements or attributes; rather,
27  * XMLTriple is used in libSBML to construct these other kinds of objects.
28  *
29  * An XMLTriple instance carries up to three data items:
30  * <ol>
31  * <li> The name of the attribute or element; that is, the attribute name
32  * as it appears in an XML document or data stream;
33  * <li> The XML namespace prefix (if any) of the attribute.  For example,
34  * in the following fragment of XML, the namespace prefix is the string
35  * <code>mysim</code> and it appears on both the element
36  * <code>someelement</code> and the attribute <code>attribA</code>.  When
37  * both the element and the attribute are stored as XMLTriple objects,
38  * their <i>prefix</i> is <code>mysim</code>.
39  * @verbatim
40 <mysim:someelement mysim:attribA='value' />
41 @endverbatim
42  * <li> The XML namespace URI with which the prefix is associated.  In
43  * XML, every namespace used must be declared and mapped to a URI.
44  * </ol>
45  *
46  * XMLTriple objects are the lowest-level data item in the XML layer
47  * of libSBML.  Other objects such as XMLToken make use of XMLTriple
48  * objects.
49  *
50  * @see XMLToken
51  * @see XMLNode
52  * @see XMLAttributes
53  * @see XMLNamespaces
54  */
55 
56 public class XMLTriple : global::System.IDisposable {
57 	private HandleRef swigCPtr;
58 	protected bool swigCMemOwn;
59 
XMLTriple(IntPtr cPtr, bool cMemoryOwn)60 	internal XMLTriple(IntPtr cPtr, bool cMemoryOwn)
61 	{
62 		swigCMemOwn = cMemoryOwn;
63 		swigCPtr    = new HandleRef(this, cPtr);
64 	}
65 
getCPtr(XMLTriple obj)66 	internal static HandleRef getCPtr(XMLTriple obj)
67 	{
68 		return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
69 	}
70 
getCPtrAndDisown(XMLTriple obj)71 	internal static HandleRef getCPtrAndDisown (XMLTriple obj)
72 	{
73 		HandleRef ptr = new HandleRef(null, IntPtr.Zero);
74 
75 		if (obj != null)
76 		{
77 			ptr             = obj.swigCPtr;
78 			obj.swigCMemOwn = false;
79 		}
80 
81 		return ptr;
82 	}
83 
~XMLTriple()84   ~XMLTriple() {
85     Dispose(false);
86   }
87 
Dispose()88   public void Dispose() {
89     Dispose(true);
90     global::System.GC.SuppressFinalize(this);
91   }
92 
Dispose(bool disposing)93   protected virtual void Dispose(bool disposing) {
94     lock(this) {
95       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
96         if (swigCMemOwn) {
97           swigCMemOwn = false;
98           libsbmlPINVOKE.delete_XMLTriple(swigCPtr);
99         }
100         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
101       }
102     }
103   }
104 
105 
106 /**
107    * Creates a new, empty XMLTriple object.
108    */ public
XMLTriple()109  XMLTriple() : this(libsbmlPINVOKE.new_XMLTriple__SWIG_0(), true) {
110   }
111 
112 
113 /**
114    * Creates a new XMLTriple object with a given @p name, @p uri and and @p
115    * prefix.
116    *
117    * @param name a string, the name for the entity represented by this object.
118    * @param uri a string, the XML namespace URI associated with the prefix.
119    * @param prefix a string, the XML namespace prefix for this triple.
120    */ public
XMLTriple(string name, string uri, string prefix)121  XMLTriple(string name, string uri, string prefix) : this(libsbmlPINVOKE.new_XMLTriple__SWIG_1(name, uri, prefix), true) {
122   }
123 
124 
125 /**
126    * Creates an XMLTriple object by splitting a given string at a given
127    * separator character.
128    *
129    * The 'triplet' in this case is a string that may be in one of the
130    * following three possible formats:
131    * <ol>
132    * <li> <span style='background-color: lightblue; padding-left: 2px; padding-right: 2px'>name</span> </li>
133    * <li> <span style='background-color: #ccc; padding-left: 2px; padding-right: 2px'>URI</span><span style='background-color: purple; color: white; padding-left: 2px; padding-right: 2px'>x</span><span style='background-color: lightblue; padding-left: 2px; padding-right: 2px'>name</span></li>
134    * <li> <span style='background-color: #ccc; padding-left: 2px; padding-right: 2px'>URI</span><span style='background-color: purple; color: white; padding-left: 2px; padding-right: 2px'>x</span><span style='background-color: lightblue; padding-left: 2px; padding-right: 2px'>name</span><span style='background-color: purple; color: white; padding-left: 2px; padding-right: 2px'>x</span><span style='background-color: #d0d0fd; padding-left: 2px; padding-right: 2px'>prefix</span></li>
135    * </ol>
136    *
137    * where <span style='background-color: purple; color: white; padding-left: 2px; padding-right: 2px'>x</span>
138    * represents the separator character, @p sepchar.
139    *
140    * @param triplet a string representing the triplet as shown above.
141    * @param sepchar a character, the sepchar used in the triplet.
142    *
143    * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif
144    */ public
XMLTriple(string triplet, char sepchar)145  XMLTriple(string triplet, char sepchar) : this(libsbmlPINVOKE.new_XMLTriple__SWIG_2(triplet, sepchar), true) {
146   }
147 
148 
149 /**
150    * Creates an XMLTriple object by splitting a given string at a given
151    * separator character.
152    *
153    * The 'triplet' in this case is a string that may be in one of the
154    * following three possible formats:
155    * <ol>
156    * <li> <span style='background-color: lightblue; padding-left: 2px; padding-right: 2px'>name</span> </li>
157    * <li> <span style='background-color: #ccc; padding-left: 2px; padding-right: 2px'>URI</span><span style='background-color: purple; color: white; padding-left: 2px; padding-right: 2px'>x</span><span style='background-color: lightblue; padding-left: 2px; padding-right: 2px'>name</span></li>
158    * <li> <span style='background-color: #ccc; padding-left: 2px; padding-right: 2px'>URI</span><span style='background-color: purple; color: white; padding-left: 2px; padding-right: 2px'>x</span><span style='background-color: lightblue; padding-left: 2px; padding-right: 2px'>name</span><span style='background-color: purple; color: white; padding-left: 2px; padding-right: 2px'>x</span><span style='background-color: #d0d0fd; padding-left: 2px; padding-right: 2px'>prefix</span></li>
159    * </ol>
160    *
161    * where <span style='background-color: purple; color: white; padding-left: 2px; padding-right: 2px'>x</span>
162    * represents the separator character, @p sepchar.
163    *
164    * @param triplet a string representing the triplet as shown above.
165    * @param sepchar a character, the sepchar used in the triplet.
166    *
167    * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif
168    */ public
XMLTriple(string triplet)169  XMLTriple(string triplet) : this(libsbmlPINVOKE.new_XMLTriple__SWIG_3(triplet), true) {
170   }
171 
172 
173 /**
174    * Copy constructor; creates a copy of this XMLTriple object.
175    *
176    * @param orig the XMLTriple object to copy.
177    */ public
XMLTriple(XMLTriple orig)178  XMLTriple(XMLTriple orig) : this(libsbmlPINVOKE.new_XMLTriple__SWIG_4(XMLTriple.getCPtr(orig)), true) {
179     if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
180   }
181 
182 
183 /**
184    * Creates and returns a deep copy of this XMLTriple object.
185    *
186    * @return the (deep) copy of this XMLTriple object.
187    */ public
clone()188  XMLTriple clone() {
189     global::System.IntPtr cPtr = libsbmlPINVOKE.XMLTriple_clone(swigCPtr);
190     XMLTriple ret = (cPtr == global::System.IntPtr.Zero) ? null : new XMLTriple(cPtr, true);
191     return ret;
192   }
193 
194 
195 /**
196    * Returns the @em name portion of this XMLTriple object.
197    *
198    * @return a string, the name portion of this XMLTriple object.
199    */ public
getName()200  string getName() {
201     string ret = libsbmlPINVOKE.XMLTriple_getName(swigCPtr);
202     return ret;
203   }
204 
205 
206 /**
207    * Returns the @em prefix portion of this XMLTriple object.
208    *
209    * @return a string, the prefix portion of this XMLTriple object.
210    */ public
getPrefix()211  string getPrefix() {
212     string ret = libsbmlPINVOKE.XMLTriple_getPrefix(swigCPtr);
213     return ret;
214   }
215 
216 
217 /**
218    * Returns the @em URI portion of this XMLTriple object.
219    *
220    * @return URI a string, the URI portion of this XMLTriple object.
221    */ public
getURI()222  string getURI() {
223     string ret = libsbmlPINVOKE.XMLTriple_getURI(swigCPtr);
224     return ret;
225   }
226 
227 
228 /**
229    * Returns the prefixed name from this XMLTriple.
230    *
231    * @return a string, the prefixed name from this XMLTriple.  This is
232    * constructed by concatenating the @em prefix stored in this XMLTriple
233    * object, followed by a colon character <code>':'</code>, followed by the
234    * @em name stored in this XMLTriple object.
235    */ public
getPrefixedName()236  string getPrefixedName() {
237     string ret = libsbmlPINVOKE.XMLTriple_getPrefixedName(swigCPtr);
238     return ret;
239   }
240 
241 
242 /**
243    * Returns @c true if this XMLTriple object is empty.
244    *
245    * @return @c true if this XMLTriple is empty, @c false otherwise.
246    */ public
isEmpty()247  bool isEmpty() {
248     bool ret = libsbmlPINVOKE.XMLTriple_isEmpty(swigCPtr);
249     return ret;
250   }
251 
252 }
253 
254 }
255