Пример #1
0
        protected AbstractFile(GenericCharMap charmap, FFTTextFactory.FileInfo layout, IList <IList <string> > strings, string fileComments, IList <string> sectionComments, bool compressible)
            : this(charmap, layout, fileComments, sectionComments, compressible)
        {
            List <IList <string> > sections = new List <IList <string> >(NumberOfSections);

            for (int i = 0; i < NumberOfSections; i++)
            {
                int      numEntries  = Math.Max(strings[i].Count, layout.SectionLengths[i]);
                string[] thisSection = new string[numEntries];
                strings[i].CopyTo(thisSection, 0);

                for (int index = strings[i].Count; index < numEntries; index++)
                {
                    thisSection[index] = "";
                }

                for (int j = 0; j < thisSection.Length; j++)
                {
                    if (!CharMap.ValidateString(thisSection[j], layout.AllowedTerminators[0]))
                    {
                        throw new InvalidStringException(layout.Guid.ToString(), i, j, thisSection[j]);
                    }
                }
                sections.Add(thisSection);
            }

            this.Sections = sections.AsReadOnly();

            PopulateDisallowedSections();
        }
Пример #2
0
        protected AbstractFile(GenericCharMap charmap, FFTTextFactory.FileInfo layout, IList <IList <string> > strings, bool compressible)
            : this(charmap, layout, compressible)
        {
            List <IList <string> > sections = new List <IList <string> >(NumberOfSections);

            for (int i = 0; i < NumberOfSections; i++)
            {
                string[] thisSection = new string[strings[i].Count];
                strings[i].CopyTo(thisSection, 0);
                for (int j = 0; j < thisSection.Length; j++)
                {
                    if (!CharMap.ValidateString(thisSection[j]))
                    {
                        throw new InvalidStringException(layout.Guid.ToString(), i, j, thisSection[j]);
                    }
                }
                sections.Add(thisSection);
            }

            this.Sections = sections.AsReadOnly();

            PopulateDisallowedSections();
        }
Пример #3
0
 public SectionedFile(GenericCharMap map, FFTTextFactory.FileInfo layout, IList <IList <string> > strings, string fileComments, IList <string> sectionComments, bool compressed) :
     base(map, layout, strings, fileComments, sectionComments, compressed)
 {
 }
Пример #4
0
 public SectionedFile(GenericCharMap map, FFTTextFactory.FileInfo layout, IList <IList <string> > strings, string fileComments, IList <string> sectionComments)
     : this(map, layout, strings, fileComments, sectionComments, false)
 {
 }
Пример #5
0
 public PartitionedFile(GenericCharMap map, FFTTextFactory.FileInfo layout, IList <IList <string> > strings, string fileComments, IList <string> sectionComments)
     : base(map, layout, strings, fileComments, sectionComments, false)
 {
     PartitionSize = layout.Size / NumberOfSections;
 }
 public CompressibleOneShotFile(GenericCharMap map, FFTTextFactory.FileInfo layout, IList <IList <string> > strings, string fileComments, IList <string> sectionComments)
     : base(map, layout, strings, fileComments, sectionComments, true)
 {
 }