public static string GetMessageClassPath(string inFilePath, string outPath) { string rosPackageName = MessageAutoGen.GetRosPackageName(inFilePath); string outFolder = MessageAutoGen.GetMessageOutFolder(outPath, rosPackageName); string extension = Path.GetExtension(inFilePath); string className = MsgAutoGenUtilities.CapitalizeFirstLetter(Path.GetFileNameWithoutExtension(inFilePath)); return(Path.Combine(outFolder, "msg", className + ".cs")); }
public static string[] GetServiceClassPaths(string inFilePath, string outPath) { string rosPackageName = MessageAutoGen.GetRosPackageName(inFilePath); string outFolder = MessageAutoGen.GetMessageOutFolder(outPath, rosPackageName); string extension = Path.GetExtension(inFilePath); string className = MsgAutoGenUtilities.CapitalizeFirstLetter(Path.GetFileNameWithoutExtension(inFilePath)); string[] result = new string[types.Length]; for (int Idx = 0; Idx < types.Length; ++Idx) { result[Idx] = Path.Combine(outFolder, "srv", className + types[Idx] + ".cs"); } return(result); }
public MessageParser(List <MessageToken> tokens, string outPath, string rosPackageName, string type, Dictionary <string, string> builtInTypeMapping, Dictionary <string, string> builtInTypesDefaultInitialValues, Dictionary <string, string> numericTypeDeserializationFunctions, Dictionary <string, int> numericTypeByteSize, string className = "", string rosMsgName = "") { this.tokens = tokens; this.inFilePath = tokens[0].content; this.inFileName = Path.GetFileNameWithoutExtension(inFilePath); this.rosPackageName = rosPackageName; this.rosPackageNamespace = MsgAutoGenUtilities.ResolvePackageName(rosPackageName); if (className.Equals("")) { this.className = MsgAutoGenUtilities.CapitalizeFirstLetter(inFileName); } else { this.className = className; } if (rosMsgName.Equals("")) { this.rosMsgName = MsgAutoGenUtilities.CapitalizeFirstLetter(inFileName); } else { this.rosMsgName = rosMsgName; } this.outPath = outPath; this.outFilePath = Path.Combine(outPath, type); this.tokens.RemoveAt(0); this.builtInTypeMapping = builtInTypeMapping; this.builtInTypesDefaultInitialValues = builtInTypesDefaultInitialValues; this.numericTypeDeserializationFunctions = numericTypeDeserializationFunctions; this.numericTypeByteSize = numericTypeByteSize; }