public ISpecProvider GetProvider(ServiceSpecType type) { ISpecProvider spec; _providers.TryGetValue(type, out spec); return(spec); }
// TODO: return the correct path of compiler in Linux platform public static string GetCompilerPath(ServiceSpecType t, ClientPlatform p = ClientPlatform.Windows) { var path = ""; var prefix = Path.Combine(Environment.GetEnvironmentVariable("DSN_ROOT"), "bin/windows"); switch(t) { case ServiceSpecType.proto: path = Path.Combine(prefix, "protoc.exe"); break; case ServiceSpecType.thrift: path = Path.Combine(prefix, "thrift.exe"); break; case ServiceSpecType.bond_3_0: path = Path.Combine(prefix, "bondc.exe"); break; default: break; } if (File.Exists(path)) { return path; } Console.WriteLine($"Cannot find {t.ToString()} compiler at path: {path}!"); return ""; }
// TODO: return the correct path of compiler in Linux platform public static string GetCompilerPath(ServiceSpecType t, ClientPlatform p = ClientPlatform.Windows) { var path = ""; var prefix = Path.Combine(Environment.GetEnvironmentVariable("DSN_ROOT"), "bin/windows"); switch (t) { case ServiceSpecType.proto: path = Path.Combine(prefix, "protoc.exe"); break; case ServiceSpecType.thrift: path = Path.Combine(prefix, "thrift.exe"); break; case ServiceSpecType.bond_3_0: path = Path.Combine(prefix, "bondc.exe"); break; default: break; } if (File.Exists(path)) { return(path); } Console.WriteLine($"Cannot find {t.ToString()} compiler at path: {path}!"); return(""); }
public static IdlTranslator GetInstance(ServiceSpecType t) { switch(t) { case ServiceSpecType.thrift: return new ThriftTranslator(); case ServiceSpecType.proto: throw new NotImplementedException(); default: return null; } }
public static IdlGenerator GetInstance(ServiceSpecType t) { switch (t) { case ServiceSpecType.Proto: return new ProtoGenerator(); case ServiceSpecType.Thrift: return new ThriftGenerator(); default: return null; } }
public static IdlGenerator GetInstance(ServiceSpecType t) { switch (t) { case ServiceSpecType.proto: return(new ProtoGenerator()); case ServiceSpecType.thrift: return(new ThriftGenerator()); default: return(null); } }
public static IdlTranslator GetInstance(ServiceSpecType t) { switch (t) { case ServiceSpecType.thrift: return(new ThriftTranslator()); case ServiceSpecType.proto: throw new NotImplementedException(); default: return(null); } }
public ThriftTranslator(ServiceSpecType t) : base(t) { }
public IdlTranslator(ServiceSpecType t) { specType = t; }