private static async Task Generate(string name, Type underlying, string fulleName, string ns, SvoFeatures features, string path, string formatExceptionMessage) { var arguments = new SvoArguments { Name = name, Underlying = underlying, FullName = fulleName, Namespace = ns, Features = features, FormatExceptionMessage = formatExceptionMessage ?? $"QowaivMessages.FormatException{name}" }; var generator = new SvoCodeGenerator(arguments); var generated = await generator.GenerateAsync(); var location = new FileInfo(path); if (!location.Directory.Exists) { location.Directory.Create(); } using var writer = new StreamWriter(location.FullName, false, Encoding.UTF8); generated.WriteTo(writer); }
public async Task generate_Int32_based_SVO() { var args = new SvoArguments { Name = "Integer", FullName = "Int32 wrapper", Underlying = typeof(int), Features = SvoFeatures.Default ^ SvoFeatures.IsEmpty ^ SvoFeatures.IsUnknown, }; var generator = new SvoCodeGenerator(args); var result = await generator.GenerateAsync(); Console.WriteLine(result.ToFullString()); }