/// <summary> /// The save. /// </summary> /// <param name="typeResolver"> /// The resolved type reference. /// </param> /// <param name="writer"> /// The writer. /// </param> /// <param name="savingOptions"> /// The saving Options. /// </param> private void Save(TypeResolver typeResolver, IndentedTextWriter writer, SavingOptions savingOptions) { writer.Write( savingOptions.HasFlag(SavingOptions.UseFullyQualifiedNames) || !typeResolver.IsNamespaceInUsingDerictives ? typeResolver.GetCxFullyQualifiedType(savingOptions) : typeResolver.GetCxType(savingOptions)); }
public string GetCxName(SavingOptions savingOptions) { if (this.isAuto) { return "auto"; } if (!this.IsReference) { return this.type; } if (!this.isTemplate) { return ConvertNamespaceChars(this.type); } var sb = new StringBuilder(100); // you need to convert all template types into correct types sb.Append(this.GetCxTypeNameWithoutTemplateParameters()); sb.Append('<'); var first = true; foreach (var templateType in CXXConverterLogic.GetGenericsTypes(this.type)) { var referencedType = new TypeResolver(templateType, this.namesResolver); if (!first) { sb.Append(", "); } first = false; sb.Append( savingOptions.HasFlag(SavingOptions.UseFullyQualifiedNames) ? referencedType.GetCxFullyQualifiedType(SavingOptions.None) : referencedType.GetCxType(SavingOptions.None)); } sb.Append('>'); return sb.ToString(); }