private flatFileType GetFlatFileType(string flatFileTypeName) { flatFileType flatFileType = _flatFileTypes[flatFileTypeName]; if (flatFileType == null) { throw new AddmlDefinitionParseException("No flatFileType with name " + flatFileTypeName); } return(flatFileType); }
private string GetFieldSeparator(string flatFileTypeName) { flatFileType flatFileType = GetFlatFileType(flatFileTypeName); Type type = flatFileType.Item.GetType(); if (type == typeof(delimFileFormat)) { return(((delimFileFormat)flatFileType.Item).fieldSeparatingChar); } else { return(null); } }
private string GetRecordSeparator(string flatFileTypeName) { flatFileType flatFileType = GetFlatFileType(flatFileTypeName); Type type = flatFileType.Item.GetType(); if (type == typeof(fixedFileFormat)) { return(((fixedFileFormat)flatFileType.Item).recordSeparator); } else if (type == typeof(delimFileFormat)) { return(((delimFileFormat)flatFileType.Item).recordSeparator); } else { throw new AddmlDefinitionParseException("Unkown flatFileType: " + type); } }
private AddmlFlatFileFormat GetFlatFileFormat(string flatFileTypeName) { flatFileType flatFileType = GetFlatFileType(flatFileTypeName); Type type = flatFileType.Item.GetType(); if (type == typeof(fixedFileFormat)) { return(AddmlFlatFileFormat.Fixed); } else if (type == typeof(delimFileFormat)) { return(AddmlFlatFileFormat.Delimiter); } else { throw new AddmlDefinitionParseException("Unkown flatFileType: " + type); } }