private static void setInputImpl(java.util.regex.Matcher.NativeRegexMatcher addr, string s, int start_1, int end_1) { System.IntPtr s_ptr = System.IntPtr.Zero; try { s_ptr = XobotOS.Runtime.MarshalGlue.String_Helper.ManagedToNative(s); libxobotos_Matcher_setInput(addr, s_ptr, start_1, end_1); } finally { XobotOS.Runtime.MarshalGlue.String_Helper.FreeManagedPtr(s_ptr); } }
/// <summary> /// Sets a new pattern for the /// <code>Matcher</code> /// . Results of a previous find /// get lost. The next attempt to find an occurrence of the /// <see cref="Pattern">Pattern</see> /// in the string will start at the beginning of the input. /// </summary> /// <param name="pattern"> /// the new /// <code>Pattern</code> /// . /// </param> /// <returns> /// the /// <code>Matcher</code> /// itself. /// </returns> public java.util.regex.Matcher usePattern(java.util.regex.Pattern pattern_1) { if (pattern_1 == null) { throw new System.ArgumentException(); } this._pattern = pattern_1; if (address != null) { closeImpl(address); address = null; } address = openImpl(pattern_1.address); if (input != null) { resetForInput(); } matchOffsets = new int[(groupCount() + 1) * 2]; matchFound = false; return(this); }
private static bool matchesImpl(java.util.regex.Matcher.NativeRegexMatcher addr, string s, int[] offsets) { System.IntPtr s_ptr = System.IntPtr.Zero; Sharpen.INativeHandle offsets_handle = null; try { s_ptr = XobotOS.Runtime.MarshalGlue.String_Helper.ManagedToNative(s); offsets_handle = XobotOS.Runtime.MarshalGlue.Array_int_Helper.GetPinnedPtr(offsets ); return(libxobotos_Matcher_matches(addr, s_ptr, offsets_handle != null ? offsets_handle .Address : System.IntPtr.Zero)); } finally { XobotOS.Runtime.MarshalGlue.String_Helper.FreeManagedPtr(s_ptr); if (offsets_handle != null) { offsets_handle.Free(); } } }
private static extern bool libxobotos_Matcher_matches(java.util.regex.Matcher.NativeRegexMatcher addr, System.IntPtr s, System.IntPtr offsets);
private static bool hitEndImpl(java.util.regex.Matcher.NativeRegexMatcher addr) { return(libxobotos_Matcher_hitEnd(addr)); }
private static extern bool libxobotos_Matcher_hitEnd(java.util.regex.Matcher.NativeRegexMatcher addr);
private static int groupCountImpl(java.util.regex.Matcher.NativeRegexMatcher addr ) { return(libxobotos_Matcher_groupCount(addr)); }
private static extern int libxobotos_Matcher_groupCount(java.util.regex.Matcher.NativeRegexMatcher addr);
private static extern bool libxobotos_Matcher_find(java.util.regex.Matcher.NativeRegexMatcher addr, System.IntPtr s, int startIndex, System.IntPtr offsets);
private static void closeImpl(java.util.regex.Matcher.NativeRegexMatcher addr) { addr.Dispose(); }
private static void useTransparentBoundsImpl(java.util.regex.Matcher.NativeRegexMatcher addr, bool value) { libxobotos_Matcher_useTransparentBounds(addr, value); }
private static extern void libxobotos_Matcher_useTransparentBounds(java.util.regex.Matcher.NativeRegexMatcher addr, bool value);
private static extern void libxobotos_Matcher_useAnchoringBounds(java.util.regex.Matcher.NativeRegexMatcher addr, bool value);
private static extern void libxobotos_Matcher_setInput(java.util.regex.Matcher.NativeRegexMatcher addr, System.IntPtr s, int start_1, int end_1);
/// <summary> /// Sets a new pattern for the /// <code>Matcher</code> /// . Results of a previous find /// get lost. The next attempt to find an occurrence of the /// <see cref="Pattern">Pattern</see> /// in the string will start at the beginning of the input. /// </summary> /// <param name="pattern"> /// the new /// <code>Pattern</code> /// . /// </param> /// <returns> /// the /// <code>Matcher</code> /// itself. /// </returns> public java.util.regex.Matcher usePattern(java.util.regex.Pattern pattern_1) { if (pattern_1 == null) { throw new System.ArgumentException(); } this._pattern = pattern_1; if (address != null) { closeImpl(address); address = null; } address = openImpl(pattern_1.address); if (input != null) { resetForInput(); } matchOffsets = new int[(groupCount() + 1) * 2]; matchFound = false; return this; }