public override void Write(SwiftWriter writer) { if (writer == null) { throw new ArgumentNullException("writer"); } writer.Write("["); _elementType.Write(writer); writer.Write("]"); }
public override void Write(SwiftWriter writer) { if (writer == null) { throw new ArgumentNullException("writer"); } writer.Write(writer.IsEmittingSwift_12 ? "Set<" : "["); _elementType.Write(writer); writer.Write(writer.IsEmittingSwift_12 ? ">" : "]"); }
public override void Write(SwiftWriter writer) { if (writer == null) { throw new ArgumentNullException("writer"); } writer.Write(this.Name); }
public override void Write(SwiftWriter writer) { if (writer == null) { throw new ArgumentNullException("writer"); } this.InnerType.Write(writer); writer.Write(_implicitlyUnwrapped ? "!" : "?"); }
public void WriteDeclaration(SwiftWriter writer) { if (writer == null) { throw new ArgumentNullException("writer"); } SwiftComposite.WriteComment(1, writer, this.BriefComment); writer.Write("\t{0} {1}: ", _isConstant ? "let" : "var", this.Name); this.Type.Write(writer); writer.WriteLine(); }
public void TestCleanup() { foreach (var tuple in _translator.GetCachedSwiftTypes()) { var swiftType = tuple.Item1; var type = tuple.Item2; _writer.Write(type, swiftType); } var swiftSource = _writer.ToString(); }
protected void WriteDeclaration(SwiftWriter writer, bool forDefinition) { if (writer == null) { throw new ArgumentNullException("writer"); } writer.Write(this.Name); if (this.TypeParameterNames.Any()) { var separator = ""; writer.Write("<"); foreach (var name in this.TypeParameterNames) { writer.Write(separator); var parameter = GetTypeParameter(name); parameter.Write(writer); if (forDefinition) { var constraint = GetTypeParameterConstraint(name); if (constraint != null) { writer.Write(": "); constraint.Write(writer); } } separator = ", "; } writer.Write(">"); } }
public void WriteDefinition(SwiftWriter writer) { if (writer == null) { throw new ArgumentNullException("writer"); } WriteComment(0, writer, this.BriefComment); WriteKeyword(writer); writer.Write(" "); WriteDeclaration(writer, true); if (this.BaseType != null) { writer.Write(": "); this.BaseType.Write(writer); } writer.WriteLine(" {"); WriteChildren(writer); writer.WriteLine("}"); }
protected override void WriteKeyword(SwiftWriter writer) { writer.Write("enum"); }