public bool match(string s) { #line 56 "/opt/haxe/std/cs/_std/EReg.hx" this.m = this.regex.Match(((string)(s))); this.cur = s; #line 58 "/opt/haxe/std/cs/_std/EReg.hx" return((this.m as global::System.Text.RegularExpressions.Group).Success); }
public bool match(string s) { #line 56 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" this.m = this.regex.Match(((string)(s))); this.cur = s; #line 58 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" return((this.m as global::System.Text.RegularExpressions.Group).Success); }
public virtual bool match(string s) { unchecked { this.m = this.regex.Match(global::haxe.lang.Runtime.toString(s)); this.cur = s; return((this.m as global::System.Text.RegularExpressions.Group).Success); } }
public bool matchSub(string s, int pos, global::haxe.lang.Null <int> len) { unchecked { #line 81 "/opt/haxe/std/cs/_std/EReg.hx" int len1 = ((!(len.hasValue)) ? (-1) : ((len).@value)); this.m = (((len1 < 0)) ? (this.regex.Match(((string)(s)), ((int)(pos)))) : (this.regex.Match(((string)(s)), ((int)(pos)), ((int)(len1))))); #line 83 "/opt/haxe/std/cs/_std/EReg.hx" this.cur = s; return((this.m as global::System.Text.RegularExpressions.Group).Success); } #line default }
public bool matchSub(string s, int pos, object len) { unchecked { #line 81 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" int len1 = (((len == default(object))) ? (-1) : (((int)(global::haxe.lang.Runtime.toInt(len))))); this.m = (((len1 < 0)) ? (this.regex.Match(((string)(s)), ((int)(pos)))) : (this.regex.Match(((string)(s)), ((int)(pos)), ((int)(len1))))); #line 83 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" this.cur = s; return((this.m as global::System.Text.RegularExpressions.Group).Success); } #line default }
public override object __hx_setField(string field, int hash, object @value, bool handleProperties) { unchecked { #line 28 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" switch (hash) { case 4949376: { #line 28 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" this.cur = global::haxe.lang.Runtime.toString(@value); #line 28 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" return(@value); } case 1821933: { #line 28 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" this.isGlobal = global::haxe.lang.Runtime.toBool(@value); #line 28 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" return(@value); } case 109: { #line 28 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" this.m = ((global::System.Text.RegularExpressions.Match)(@value)); #line 28 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" return(@value); } case 1723805383: { #line 28 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" this.regex = ((global::System.Text.RegularExpressions.Regex)(@value)); #line 28 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" return(@value); } default: { #line 28 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" return(base.__hx_setField(field, hash, @value, handleProperties)); } } } #line default }
public global::Array <string> split(string s) { if (this.isGlobal) { return(new global::Array <string>(((string[])(this.regex.Split(((string)(s))))))); } global::System.Text.RegularExpressions.Match m = this.regex.Match(((string)(s))); if (!((m as global::System.Text.RegularExpressions.Group).Success)) { return(new global::Array <string>(new string[] { s })); } return(new global::Array <string>(new string[] { s.Substring(((int)(0)), ((int)((m as global::System.Text.RegularExpressions.Capture).Index))), s.Substring(((int)(((m as global::System.Text.RegularExpressions.Capture).Index + (m as global::System.Text.RegularExpressions.Capture).Length)))) })); }
/// <summary> /// Numbered string from # template /// </summary> private string ConvertNumberedString(string template, int i) { global::System.Text.RegularExpressions.Regex r = new global::System.Text.RegularExpressions.Regex(@"#+"); global::System.Text.RegularExpressions.Match m = r.Match(template); if (m.Length == 0) { return(template); } string numStrFmt = m.Value.Replace("#", "0"); string numStr = i.ToString(numStrFmt); return(template.Replace(m.Value, numStr)); }
public global::haxe.root.Array split(string s) { #line 88 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" if (this.isGlobal) { #line 89 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" string[] native = this.regex.Split(((string)(s))); #line 89 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" object[] ret = new object[(native as global::System.Array).Length]; #line 89 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" { #line 89 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" int _g = 0; #line 89 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" int _g1 = (native as global::System.Array).Length; #line 89 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" while ((_g < _g1)) { #line 89 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" int i = _g++; #line 89 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" ret[i] = ((string)(native[i])); } } #line 89 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" object[] dyn = ret; #line 89 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" return(new global::haxe.root.Array(((object[])(dyn)))); } #line 90 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" global::System.Text.RegularExpressions.Match m = this.regex.Match(((string)(s))); if (!((m as global::System.Text.RegularExpressions.Group).Success)) { #line 92 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" return(new global::haxe.root.Array(new object[] { s })); } #line 93 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\EReg.hx" return(new global::haxe.root.Array(new object[] { s.Substring(((int)(0)), ((int)((m as global::System.Text.RegularExpressions.Capture).Index))), s.Substring(((int)(((m as global::System.Text.RegularExpressions.Capture).Index + (m as global::System.Text.RegularExpressions.Capture).Length)))) })); }
public global::Array <string> split(string s) { #line 88 "/opt/haxe/std/cs/_std/EReg.hx" if (this.isGlobal) { #line 89 "/opt/haxe/std/cs/_std/EReg.hx" return(new global::Array <string>(((string[])(this.regex.Split(((string)(s))))))); } #line 90 "/opt/haxe/std/cs/_std/EReg.hx" global::System.Text.RegularExpressions.Match m = this.regex.Match(((string)(s))); if (!((m as global::System.Text.RegularExpressions.Group).Success)) { #line 92 "/opt/haxe/std/cs/_std/EReg.hx" return(new global::Array <string>(new string[] { s })); } #line 93 "/opt/haxe/std/cs/_std/EReg.hx" return(new global::Array <string>(new string[] { s.Substring(((int)(0)), ((int)((m as global::System.Text.RegularExpressions.Capture).Index))), s.Substring(((int)(((m as global::System.Text.RegularExpressions.Capture).Index + (m as global::System.Text.RegularExpressions.Capture).Length)))) })); }
public override object __hx_setField(string field, int hash, object @value, bool handleProperties) { unchecked { switch (hash) { case 4949376: { this.cur = global::haxe.lang.Runtime.toString(@value); return(@value); } case 1821933: { this.isGlobal = ((bool)(@value)); return(@value); } case 109: { this.m = ((global::System.Text.RegularExpressions.Match)(@value)); return(@value); } case 1723805383: { this.regex = ((global::System.Text.RegularExpressions.Regex)(@value)); return(@value); } default: { return(base.__hx_setField(field, hash, @value, handleProperties)); } } } }
private void OnRefreshTokenSuccess(string json) { try { HelperMethods.RefreshTokenResponseObject tokenObject = ClientSDK.Utils.Json.GetObjectFromJson <HelperMethods.RefreshTokenResponseObject>(json); Debug.LogError("RefreshToken: normal"); SessionManager.UpdateUserToken(tokenObject.token); if (null == bufferedCall) { return; } // Make original call again StartCoroutine(_PerformRequest <string>(bufferedCall.URL, bufferedCall.RequestBody, bufferedCall.SuccessHandler, bufferedCall.FailureHandler)); } catch (JsonFx.Json.JsonDeserializationException d) { global::System.Text.RegularExpressions.Match match = global::System.Text.RegularExpressions.Regex.Match(json, "[A-Za-z0-9-_]{43}"); Debug.LogError("RefreshToken: odd format: " + json + " " + d.Message); SessionManager.UpdateUserToken(match.ToString()); if (null == bufferedCall) { return; } // Make original call again string url = bufferedCall.URL; string request = bufferedCall.RequestBody; Action <string> successHandler = bufferedCall.SuccessHandler; Action <string> failureHandler = bufferedCall.FailureHandler; bufferedCall = null; StartCoroutine(_PerformRequest <string>(url, request, successHandler, failureHandler, false)); } catch (Exception e) { Debug.LogError("Token response parsing error: " + e.Message); } }
private string ParseNameAndArguments(string name, out string arguments) { arguments = null; global::System.Text.RegularExpressions.Match match = NameAndArgumentsRegex.Match(name); if (match.Success) { if (match.Groups["arguments"].Success) { CaptureCollection argumentCaptures = match.Groups["arguments"].Captures; if (argumentCaptures.Count == 1 && !String.IsNullOrEmpty(argumentCaptures[0].Value)) { arguments = argumentCaptures[0].Value; } } return(match.Groups["name"].Captures[0].Value); } else { throw new XmlTransformationException(SR.XMLTRANSFORMATION_BadAttributeValue); } }
public override object __hx_setField(string field, int hash, object @value, bool handleProperties) { unchecked { switch (hash) { case 4949376: { this.cur = global::haxe.lang.Runtime.toString(@value); return @value; } case 1821933: { this.isGlobal = ((bool) (@value) ); return @value; } case 109: { this.m = ((global::System.Text.RegularExpressions.Match) (@value) ); return @value; } case 1723805383: { this.regex = ((global::System.Text.RegularExpressions.Regex) (@value) ); return @value; } default: { return base.__hx_setField(field, hash, @value, handleProperties); } } } }
private static string EncodeName(string name, /*Name_not_NmToken*/ bool first, bool local) { if (string.IsNullOrEmpty(name)) { return(name); } StringBuilder bufBld = null; int length = name.Length; int copyPosition = 0; int position = 0; int underscorePos = name.IndexOf('_'); MatchCollection mc = null; IEnumerator en = null; if (underscorePos >= 0) { if (s_encodeCharPattern == null) { s_encodeCharPattern = new Regex("(?<=_)[Xx]([0-9a-fA-F]{4}|[0-9a-fA-F]{8})_"); } mc = s_encodeCharPattern.Matches(name, underscorePos); en = mc.GetEnumerator(); } int matchPos = -1; if (en != null && en.MoveNext()) { global::System.Text.RegularExpressions.Match m = (global::System.Text.RegularExpressions.Match)en.Current; matchPos = m.Index - 1; } if (first) { if ((!s_xmlCharType.IsStartNCNameCharXml4e(name[0]) && (local || (!local && name[0] != ':'))) || matchPos == 0) { if (bufBld == null) { bufBld = new StringBuilder(length + 20); } bufBld.Append("_x"); if (length > 1 && XmlCharType.IsHighSurrogate(name[0]) && XmlCharType.IsLowSurrogate(name[1])) { int x = name[0]; int y = name[1]; Int32 u = XmlCharType.CombineSurrogateChar(y, x); bufBld.Append(u.ToString("X8", CultureInfo.InvariantCulture)); position++; copyPosition = 2; } else { bufBld.Append(((Int32)name[0]).ToString("X4", CultureInfo.InvariantCulture)); copyPosition = 1; } bufBld.Append('_'); position++; if (matchPos == 0) { if (en.MoveNext()) { global::System.Text.RegularExpressions.Match m = (global::System.Text.RegularExpressions.Match)en.Current; matchPos = m.Index - 1; } } } } for (; position < length; position++) { if ((local && !s_xmlCharType.IsNCNameCharXml4e(name[position])) || (!local && !s_xmlCharType.IsNameCharXml4e(name[position])) || (matchPos == position)) { if (bufBld == null) { bufBld = new StringBuilder(length + 20); } if (matchPos == position) { if (en.MoveNext()) { global::System.Text.RegularExpressions.Match m = (global::System.Text.RegularExpressions.Match)en.Current; matchPos = m.Index - 1; } } bufBld.Append(name, copyPosition, position - copyPosition); bufBld.Append("_x"); if ((length > position + 1) && XmlCharType.IsHighSurrogate(name[position]) && XmlCharType.IsLowSurrogate(name[position + 1])) { int x = name[position]; int y = name[position + 1]; Int32 u = XmlCharType.CombineSurrogateChar(y, x); bufBld.Append(u.ToString("X8", CultureInfo.InvariantCulture)); copyPosition = position + 2; position++; } else { bufBld.Append(((Int32)name[position]).ToString("X4", CultureInfo.InvariantCulture)); copyPosition = position + 1; } bufBld.Append('_'); } } if (copyPosition == 0) { return(name); } else { if (copyPosition < length) { bufBld.Append(name, copyPosition, length - copyPosition); } return(bufBld.ToString()); } }
/// <include file='doc\XmlConvert.uex' path='docs/doc[@for="XmlConvert.DecodeName"]/*' /> /// <devdoc> /// <para> /// Transforms an XML name into an object name (such as DataTable or DataColumn).</para> /// </devdoc> public static string DecodeName(string name) { if (name == null || name.Length == 0) { return(name); } StringBuilder bufBld = null; int length = name.Length; int copyPosition = 0; int underscorePos = name.IndexOf('_'); MatchCollection mc = null; IEnumerator en = null; if (underscorePos >= 0) { if (s_decodeCharPattern == null) { s_decodeCharPattern = new Regex("_[Xx]([0-9a-fA-F]{4}|[0-9a-fA-F]{8})_"); } mc = s_decodeCharPattern.Matches(name, underscorePos); en = mc.GetEnumerator(); } else { return(name); } int matchPos = -1; if (en != null && en.MoveNext()) { global::System.Text.RegularExpressions.Match m = (global::System.Text.RegularExpressions.Match)en.Current; matchPos = m.Index; } for (int position = 0; position < length - s_encodedCharLength + 1; position++) { if (position == matchPos) { if (en.MoveNext()) { global::System.Text.RegularExpressions.Match m = (global::System.Text.RegularExpressions.Match)en.Current; matchPos = m.Index; } if (bufBld == null) { bufBld = new StringBuilder(length + 20); } bufBld.Append(name, copyPosition, position - copyPosition); if (name[position + 6] != '_') { //_x1234_ Int32 u = FromHex(name[position + 2]) * 0x10000000 + FromHex(name[position + 3]) * 0x1000000 + FromHex(name[position + 4]) * 0x100000 + FromHex(name[position + 5]) * 0x10000 + FromHex(name[position + 6]) * 0x1000 + FromHex(name[position + 7]) * 0x100 + FromHex(name[position + 8]) * 0x10 + FromHex(name[position + 9]); if (u >= 0x00010000) { if (u <= 0x0010ffff) { //convert to two chars copyPosition = position + s_encodedCharLength + 4; char lowChar, highChar; XmlCharType.SplitSurrogateChar(u, out lowChar, out highChar); bufBld.Append(highChar); bufBld.Append(lowChar); } //else bad ucs-4 char don't convert } else { //convert to single char copyPosition = position + s_encodedCharLength + 4; bufBld.Append((char)u); } position += s_encodedCharLength - 1 + 4; //just skip } else { copyPosition = position + s_encodedCharLength; bufBld.Append((char)( FromHex(name[position + 2]) * 0x1000 + FromHex(name[position + 3]) * 0x100 + FromHex(name[position + 4]) * 0x10 + FromHex(name[position + 5]))); position += s_encodedCharLength - 1; } } } if (copyPosition == 0) { return(name); } else { if (copyPosition < length) { bufBld.Append(name, copyPosition, length - copyPosition); } return(bufBld.ToString()); } }
public bool match(string s) { this.m = this.regex.Match(((string)(s))); this.cur = s; return((this.m as global::System.Text.RegularExpressions.Group).Success); }
public virtual bool match(string s) { unchecked { this.m = this.regex.Match(global::haxe.lang.Runtime.toString(s)); this.cur = s; return ( this.m as global::System.Text.RegularExpressions.Group ).Success; } }