static void GenerateWriter(Parameters parameters) { var protocol = new Protocol(parameters.Input); protocol.GenerateCppWriter(parameters.Output); //XSLT.Generator.Generate(XSLT.Templates.CppWriterHeader, parameters.Input, parameters.Output + ".h"); //XSLT.Generator.Generate(XSLT.Templates.CppWriterSource, parameters.Input, parameters.Output + ".hpp"); }
static int Verify(Parameters parameters) { var oldProtocol = new Protocol(parameters.Old); var newProtocol = new Protocol(parameters.New); if (oldProtocol.Compare(newProtocol)) return 0; return 1; }
static void GenerateServer(Parameters parameters) { if (parameters.Mode == Mode.Local) { var protocol = new Protocol(parameters.Input); protocol.GenerateCharpLocalServer(parameters.Namespace, parameters.Output); } else if (parameters.Mode == Mode.Remote) { Console.WriteLine("Remote C# server is not implemented"); } else { Console.WriteLine("Not supported {0} mode by C# server", parameters.Operation); } }
static void GenerateServer(Parameters parameters) { if (parameters.Mode == Mode.Local) { var protocol = new Protocol(parameters.Input); protocol.GenerateCppLocalServer(parameters.Output, parameters.Prefix); } else if (parameters.Mode == Mode.Remote) { var protocol = new Protocol(parameters.Input); protocol.GenerateCppRemoteServer(parameters.Output, parameters.Prefix); } else { Console.WriteLine("Not supported {0} mode by C++ server", parameters.Operation); } }
static void GenerateClient(Parameters parameters) { if (parameters.Mode == Mode.Local) { var protocol = new Protocol(parameters.Input); protocol.GenerateCharpLocalClient(parameters.Namespace, parameters.Output); } else if (parameters.Mode == Mode.Remote) { var protocol = new Protocol(parameters.Input); protocol.GenerateCharpRemoteClient(parameters.Namespace, parameters.Output); } else { Console.WriteLine("Not supported {0} mode by C# client", parameters.Operation); } }
bool Compare(Component component, Protocol other) { foreach (var element in other.Components) { if (component.Name == element.Name) { return component.Compare(element); } } Console.WriteLine("Component {0} does not exist", component.Name); return false; }
public bool Compare(Protocol other) { var result = true; foreach (var element in this.Components) { if (!this.Compare(element, other)) { result = false; } } return result; }
static void GenerateReader(Parameters parameters) { var protocol = new Protocol(parameters.Input); protocol.GenerateCSharpReader(protocol.Namespace, parameters.Output); //XSLT.Generator.Generate(XSLT.Templates.CSharpReader, parameters.Input, parameters.Output); }