/// <summary> /// Determines if an operator will be reflected. /// </summary> /// <param name="nrOperator">The operator to test.</param> /// <returns> /// <c>True</c> if the operator should be reflected. /// </returns> public bool Reflect(NROperator nrOperator) { return(IsUnsafePointer(nrOperator.Type.Name) || HasUnsafeParameters(nrOperator.Parameters) ? false : filter.Reflect(nrOperator)); }
/// <summary> /// Determines if an operator will be reflected. /// </summary> /// <param name="nrOperator">The operator to test.</param> /// <returns> /// <c>True</c> if the operator should be reflected. /// </returns> public bool Reflect(NROperator nrOperator) { return IsUnsafePointer(nrOperator.Type) || HasUnsafeParameters(nrOperator.Parameters) ? false : filter.Reflect(nrOperator); }
/// <summary> /// Gets the <see cref="NROperator"/> as a C# string. /// </summary> /// <param name="nrOperator">The operator to get the code for.</param> /// <returns>A string representing the operator.</returns> public static string Declaration(this NROperator nrOperator) { string accessModifier = AddSpace(nrOperator.AccessModifier.Declaration()); string modifier = AddSpace(nrOperator.OperationModifier.Declaration()); string returnType = ""; if (nrOperator.OperatorType != OperatorType.Implicit && nrOperator.OperatorType != OperatorType.Explicit) { returnType = nrOperator.Type.Declaration() + " "; } string name; switch (nrOperator.OperatorType) { case OperatorType.UnaryPlus: name = "operator +"; break; case OperatorType.UnaryNegation: name = "operator -"; break; case OperatorType.LogicalNot: name = "operator !"; break; case OperatorType.OnesComplement: name = "operator ~"; break; case OperatorType.Increment: name = "operator ++"; break; case OperatorType.Decrement: name = "operator --"; break; case OperatorType.True: name = "operator true"; break; case OperatorType.False: name = "operator false"; break; case OperatorType.Addition: name = "operator +"; break; case OperatorType.Subtraction: name = "operator -"; break; case OperatorType.Multiply: name = "operator *"; break; case OperatorType.Division: name = "operator /"; break; case OperatorType.Modulus: name = "operator %"; break; case OperatorType.BitwiseAnd: name = "operator &"; break; case OperatorType.BitwiseOr: name = "operator |"; break; case OperatorType.ExclusiveOr: name = "operator ^"; break; case OperatorType.LeftShift: name = "operator <<"; break; case OperatorType.RightShift: name = "operator >>"; break; case OperatorType.Equality: name = "operator =="; break; case OperatorType.Inequality: name = "operator !="; break; case OperatorType.LessThan: name = "operator <"; break; case OperatorType.GreaterThan: name = "operator >"; break; case OperatorType.LessThanOrEqual: name = "operator <="; break; case OperatorType.GreaterThanOrEqual: name = "operator >="; break; case OperatorType.Implicit: name = "implicit operator " + nrOperator.Type.Declaration(); break; case OperatorType.Explicit: name = "explicit operator " + nrOperator.Type.Declaration(); break; default: name = nrOperator.Name; break; } // public static explicit operator int(OperatorTests i) { return 0; } // public static implicit operator long(OperatorTests i) { return 0; } return(String.Format("{0}{1}{2}{3}({4})", accessModifier, modifier, returnType, name, nrOperator.Parameters.Declaration())); }
/// <summary> /// Determines if an operator will be reflected. /// </summary> /// <param name="nrOperator">The operator to test.</param> /// <returns><c>True</c> if the operator should be reflected.</returns> public bool Reflect(NROperator nrOperator) { return(!Filter.Reflect(nrOperator)); }
public NROperatorDeclaration(NROperator oper) { this.oper = oper; }
/// <summary> /// Determines if an operator will be reflected. /// </summary> /// <param name="nrOperator">The operator to test.</param> /// <returns> /// <c>True</c> if the operator should be reflected. /// </returns> public bool Reflect(NROperator nrOperator) { return(filter.Reflect(nrOperator) && CanImportParameters(nrOperator.Parameters) && CanImportTypeUsage(nrOperator.Type)); }
/// <summary> /// Determines if an operator will be reflected. /// </summary> /// <param name="nrOperator">The operator to test.</param> /// <returns><c>True</c> if the operator should be reflected.</returns> public bool Reflect(NROperator nrOperator) { return(Reflect(FilterElements.Operator, nrOperator)); }