Esempio n. 1
0
        private flatFileType GetFlatFileType(string flatFileTypeName)
        {
            flatFileType flatFileType = _flatFileTypes[flatFileTypeName];

            if (flatFileType == null)
            {
                throw new AddmlDefinitionParseException("No flatFileType with name " + flatFileTypeName);
            }

            return(flatFileType);
        }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
        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);
            }
        }
Esempio n. 4
0
        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);
            }
        }