| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| |
|
| | public class StringVector : global::System.IDisposable, global::System.Collections.IEnumerable, global::System.Collections.Generic.IList<string> |
| | { |
| | private global::System.Runtime.InteropServices.HandleRef swigCPtr; |
| | protected bool swigCMemOwn; |
| |
|
| | internal StringVector(global::System.IntPtr cPtr, bool cMemoryOwn) { |
| | swigCMemOwn = cMemoryOwn; |
| | swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); |
| | } |
| |
|
| | internal static global::System.Runtime.InteropServices.HandleRef getCPtr(StringVector obj) { |
| | return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; |
| | } |
| |
|
| | ~StringVector() { |
| | Dispose(false); |
| | } |
| |
|
| | public void Dispose() { |
| | Dispose(true); |
| | global::System.GC.SuppressFinalize(this); |
| | } |
| |
|
| | protected virtual void Dispose(bool disposing) { |
| | lock(this) { |
| | if (swigCPtr.Handle != global::System.IntPtr.Zero) { |
| | if (swigCMemOwn) { |
| | swigCMemOwn = false; |
| | CoolPropPINVOKE.delete_StringVector(swigCPtr); |
| | } |
| | swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); |
| | } |
| | } |
| | } |
| |
|
| | public StringVector(global::System.Collections.IEnumerable c) : this() { |
| | if (c == null) |
| | throw new global::System.ArgumentNullException("c"); |
| | foreach (string element in c) { |
| | this.Add(element); |
| | } |
| | } |
| |
|
| | public StringVector(global::System.Collections.Generic.IEnumerable<string> c) : this() { |
| | if (c == null) |
| | throw new global::System.ArgumentNullException("c"); |
| | foreach (string element in c) { |
| | this.Add(element); |
| | } |
| | } |
| |
|
| | public bool IsFixedSize { |
| | get { |
| | return false; |
| | } |
| | } |
| |
|
| | public bool IsReadOnly { |
| | get { |
| | return false; |
| | } |
| | } |
| |
|
| | public string this[int index] { |
| | get { |
| | return getitem(index); |
| | } |
| | set { |
| | setitem(index, value); |
| | } |
| | } |
| |
|
| | public int Capacity { |
| | get { |
| | return (int)capacity(); |
| | } |
| | set { |
| | if (value < size()) |
| | throw new global::System.ArgumentOutOfRangeException("Capacity"); |
| | reserve((uint)value); |
| | } |
| | } |
| |
|
| | public int Count { |
| | get { |
| | return (int)size(); |
| | } |
| | } |
| |
|
| | public bool IsSynchronized { |
| | get { |
| | return false; |
| | } |
| | } |
| |
|
| | public void CopyTo(string[] array) |
| | { |
| | CopyTo(0, array, 0, this.Count); |
| | } |
| |
|
| | public void CopyTo(string[] array, int arrayIndex) |
| | { |
| | CopyTo(0, array, arrayIndex, this.Count); |
| | } |
| |
|
| | public void CopyTo(int index, string[] array, int arrayIndex, int count) |
| | { |
| | if (array == null) |
| | throw new global::System.ArgumentNullException("array"); |
| | if (index < 0) |
| | throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero"); |
| | if (arrayIndex < 0) |
| | throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero"); |
| | if (count < 0) |
| | throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero"); |
| | if (array.Rank > 1) |
| | throw new global::System.ArgumentException("Multi dimensional array.", "array"); |
| | if (index+count > this.Count || arrayIndex+count > array.Length) |
| | throw new global::System.ArgumentException("Number of elements to copy is too large."); |
| | for (int i=0; i<count; i++) |
| | array.SetValue(getitemcopy(index+i), arrayIndex+i); |
| | } |
| |
|
| | public string[] ToArray() { |
| | string[] array = new string[this.Count]; |
| | this.CopyTo(array); |
| | return array; |
| | } |
| |
|
| | global::System.Collections.Generic.IEnumerator<string> global::System.Collections.Generic.IEnumerable<string>.GetEnumerator() { |
| | return new StringVectorEnumerator(this); |
| | } |
| |
|
| | global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { |
| | return new StringVectorEnumerator(this); |
| | } |
| |
|
| | public StringVectorEnumerator GetEnumerator() { |
| | return new StringVectorEnumerator(this); |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | public sealed class StringVectorEnumerator : global::System.Collections.IEnumerator |
| | , global::System.Collections.Generic.IEnumerator<string> |
| | { |
| | private StringVector collectionRef; |
| | private int currentIndex; |
| | private object currentObject; |
| | private int currentSize; |
| |
|
| | public StringVectorEnumerator(StringVector collection) { |
| | collectionRef = collection; |
| | currentIndex = -1; |
| | currentObject = null; |
| | currentSize = collectionRef.Count; |
| | } |
| |
|
| | |
| | public string Current { |
| | get { |
| | if (currentIndex == -1) |
| | throw new global::System.InvalidOperationException("Enumeration not started."); |
| | if (currentIndex > currentSize - 1) |
| | throw new global::System.InvalidOperationException("Enumeration finished."); |
| | if (currentObject == null) |
| | throw new global::System.InvalidOperationException("Collection modified."); |
| | return (string)currentObject; |
| | } |
| | } |
| |
|
| | |
| | object global::System.Collections.IEnumerator.Current { |
| | get { |
| | return Current; |
| | } |
| | } |
| |
|
| | public bool MoveNext() { |
| | int size = collectionRef.Count; |
| | bool moveOkay = (currentIndex+1 < size) && (size == currentSize); |
| | if (moveOkay) { |
| | currentIndex++; |
| | currentObject = collectionRef[currentIndex]; |
| | } else { |
| | currentObject = null; |
| | } |
| | return moveOkay; |
| | } |
| |
|
| | public void Reset() { |
| | currentIndex = -1; |
| | currentObject = null; |
| | if (collectionRef.Count != currentSize) { |
| | throw new global::System.InvalidOperationException("Collection modified."); |
| | } |
| | } |
| |
|
| | public void Dispose() { |
| | currentIndex = -1; |
| | currentObject = null; |
| | } |
| | } |
| |
|
| | public void Clear() { |
| | CoolPropPINVOKE.StringVector_Clear(swigCPtr); |
| | } |
| |
|
| | public void Add(string x) { |
| | CoolPropPINVOKE.StringVector_Add(swigCPtr, x); |
| | if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve(); |
| | } |
| |
|
| | private uint size() { |
| | uint ret = CoolPropPINVOKE.StringVector_size(swigCPtr); |
| | return ret; |
| | } |
| |
|
| | private uint capacity() { |
| | uint ret = CoolPropPINVOKE.StringVector_capacity(swigCPtr); |
| | return ret; |
| | } |
| |
|
| | private void reserve(uint n) { |
| | CoolPropPINVOKE.StringVector_reserve(swigCPtr, n); |
| | } |
| |
|
| | public StringVector() : this(CoolPropPINVOKE.new_StringVector__SWIG_0(), true) { |
| | } |
| |
|
| | public StringVector(StringVector other) : this(CoolPropPINVOKE.new_StringVector__SWIG_1(StringVector.getCPtr(other)), true) { |
| | if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve(); |
| | } |
| |
|
| | public StringVector(int capacity) : this(CoolPropPINVOKE.new_StringVector__SWIG_2(capacity), true) { |
| | if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve(); |
| | } |
| |
|
| | private string getitemcopy(int index) { |
| | string ret = CoolPropPINVOKE.StringVector_getitemcopy(swigCPtr, index); |
| | if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve(); |
| | return ret; |
| | } |
| |
|
| | private string getitem(int index) { |
| | string ret = CoolPropPINVOKE.StringVector_getitem(swigCPtr, index); |
| | if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve(); |
| | return ret; |
| | } |
| |
|
| | private void setitem(int index, string val) { |
| | CoolPropPINVOKE.StringVector_setitem(swigCPtr, index, val); |
| | if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve(); |
| | } |
| |
|
| | public void AddRange(StringVector values) { |
| | CoolPropPINVOKE.StringVector_AddRange(swigCPtr, StringVector.getCPtr(values)); |
| | if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve(); |
| | } |
| |
|
| | public StringVector GetRange(int index, int count) { |
| | global::System.IntPtr cPtr = CoolPropPINVOKE.StringVector_GetRange(swigCPtr, index, count); |
| | StringVector ret = (cPtr == global::System.IntPtr.Zero) ? null : new StringVector(cPtr, true); |
| | if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve(); |
| | return ret; |
| | } |
| |
|
| | public void Insert(int index, string x) { |
| | CoolPropPINVOKE.StringVector_Insert(swigCPtr, index, x); |
| | if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve(); |
| | } |
| |
|
| | public void InsertRange(int index, StringVector values) { |
| | CoolPropPINVOKE.StringVector_InsertRange(swigCPtr, index, StringVector.getCPtr(values)); |
| | if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve(); |
| | } |
| |
|
| | public void RemoveAt(int index) { |
| | CoolPropPINVOKE.StringVector_RemoveAt(swigCPtr, index); |
| | if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve(); |
| | } |
| |
|
| | public void RemoveRange(int index, int count) { |
| | CoolPropPINVOKE.StringVector_RemoveRange(swigCPtr, index, count); |
| | if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve(); |
| | } |
| |
|
| | public static StringVector Repeat(string value, int count) { |
| | global::System.IntPtr cPtr = CoolPropPINVOKE.StringVector_Repeat(value, count); |
| | StringVector ret = (cPtr == global::System.IntPtr.Zero) ? null : new StringVector(cPtr, true); |
| | if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve(); |
| | return ret; |
| | } |
| |
|
| | public void Reverse() { |
| | CoolPropPINVOKE.StringVector_Reverse__SWIG_0(swigCPtr); |
| | } |
| |
|
| | public void Reverse(int index, int count) { |
| | CoolPropPINVOKE.StringVector_Reverse__SWIG_1(swigCPtr, index, count); |
| | if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve(); |
| | } |
| |
|
| | public void SetRange(int index, StringVector values) { |
| | CoolPropPINVOKE.StringVector_SetRange(swigCPtr, index, StringVector.getCPtr(values)); |
| | if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve(); |
| | } |
| |
|
| | public bool Contains(string value) { |
| | bool ret = CoolPropPINVOKE.StringVector_Contains(swigCPtr, value); |
| | if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve(); |
| | return ret; |
| | } |
| |
|
| | public int IndexOf(string value) { |
| | int ret = CoolPropPINVOKE.StringVector_IndexOf(swigCPtr, value); |
| | if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve(); |
| | return ret; |
| | } |
| |
|
| | public int LastIndexOf(string value) { |
| | int ret = CoolPropPINVOKE.StringVector_LastIndexOf(swigCPtr, value); |
| | if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve(); |
| | return ret; |
| | } |
| |
|
| | public bool Remove(string value) { |
| | bool ret = CoolPropPINVOKE.StringVector_Remove(swigCPtr, value); |
| | if (CoolPropPINVOKE.SWIGPendingException.Pending) throw CoolPropPINVOKE.SWIGPendingException.Retrieve(); |
| | return ret; |
| | } |
| |
|
| | } |
| |
|