Пример #1
0
 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);
     }
 }
Пример #2
0
 /// <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);
 }
Пример #3
0
 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();
         }
     }
 }
Пример #4
0
 private static extern bool libxobotos_Matcher_matches(java.util.regex.Matcher.NativeRegexMatcher
                                                       addr, System.IntPtr s, System.IntPtr offsets);
Пример #5
0
 private static bool hitEndImpl(java.util.regex.Matcher.NativeRegexMatcher addr)
 {
     return(libxobotos_Matcher_hitEnd(addr));
 }
Пример #6
0
 private static extern bool libxobotos_Matcher_hitEnd(java.util.regex.Matcher.NativeRegexMatcher
                                                      addr);
Пример #7
0
 private static int groupCountImpl(java.util.regex.Matcher.NativeRegexMatcher addr
                                   )
 {
     return(libxobotos_Matcher_groupCount(addr));
 }
Пример #8
0
 private static extern int libxobotos_Matcher_groupCount(java.util.regex.Matcher.NativeRegexMatcher
                                                         addr);
Пример #9
0
 private static extern bool libxobotos_Matcher_find(java.util.regex.Matcher.NativeRegexMatcher
                                                    addr, System.IntPtr s, int startIndex, System.IntPtr offsets);
Пример #10
0
 private static void closeImpl(java.util.regex.Matcher.NativeRegexMatcher addr)
 {
     addr.Dispose();
 }
Пример #11
0
 private static void useTransparentBoundsImpl(java.util.regex.Matcher.NativeRegexMatcher
                                              addr, bool value)
 {
     libxobotos_Matcher_useTransparentBounds(addr, value);
 }
Пример #12
0
 private static extern void libxobotos_Matcher_useTransparentBounds(java.util.regex.Matcher.NativeRegexMatcher
                                                                    addr, bool value);
Пример #13
0
 private static extern void libxobotos_Matcher_useAnchoringBounds(java.util.regex.Matcher.NativeRegexMatcher
                                                                  addr, bool value);
Пример #14
0
 private static extern void libxobotos_Matcher_setInput(java.util.regex.Matcher.NativeRegexMatcher
                                                        addr, System.IntPtr s, int start_1, int end_1);
Пример #15
0
		/// <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;
		}