
using System;
using System.Diagnostics;

namespace Tesseract.Internal
{
	static class Guard
	{
		
		
		
		
		
		
		
		
		[DebuggerHidden]
		public static void Require(string paramName, bool condition)
		{
			if (!condition)
				throw new ArgumentException(string.Empty, paramName);
		}

		
		
		
		
		
		
		
		[DebuggerHidden]
		public static void Require(string paramName, bool condition, string message)
		{
			if (!condition)
				throw new ArgumentException(message, paramName);
		}

		
		
		
		
		
		
		
		
		[DebuggerHidden]
		public static void Require(string paramName, bool condition, string message, params object[] args)
		{
			if (!condition)
				throw new ArgumentException(String.Format(message, args), paramName);
		}
		
		
		
		[DebuggerHidden]
		public static void RequireNotNull(string argName, object value)
		{
			if (value == null) {
				throw new ArgumentException($"Argument \"{value}\" must not be null.");
			}
		}
		
		
		
		
		
		
		
		[DebuggerHidden]
		public static void RequireNotNullOrEmpty(string paramName, string value)
		{
			RequireNotNull(paramName, value);
			if (value.Length == 0) {
				throw new ArgumentException(paramName,
				    $@"The argument ""{paramName}"" must not be null or empty.");
			}
		}

		
		
		
		
		
		
		[DebuggerHidden]
		public static void Verify(bool condition, string message, params object[] args)
		{
			if(!condition) {
				throw new InvalidOperationException(String.Format(message, args));
			}
		}
	}
}

