示例#1
0
        public MARCRecord(char[] rawRecord)
        {
            char[] temp = new char[MARCChar.LEADER_LEN];

            init();

            try
            {

                Array.Copy(rawRecord, temp, MARCChar.LEADER_LEN);
                _ldr = new MARCLeader(temp);

                int dirLength = _ldr.getBaseAddressOfData() - MARCChar.LEADER_LEN;
                char[] temp1 = new char[dirLength];
                Array.Copy(rawRecord, MARCChar.LEADER_LEN, temp1, 0, dirLength);
                _dir = new MARCRecordDirectory(temp1);

                MARCField field;
                ArrayList dirEntries = _dir.getEntries();

                foreach (MARCDirectoryEntry entry in dirEntries)
                {
                    temp1 = new char[entry.fieldLength];
                    Array.Copy(rawRecord, _ldr.getBaseAddressOfData() + entry.dataEnd, temp1, 0, entry.fieldLength);
                    field = new MARCField(entry.tagStr, entry.fieldLength, temp1);
                    addField(field);
                }
                //char[] dir = new
                build_dir();
                build_Leader();
            }
            catch (Exception ex)
            {
                _warning = "Error!";
            }
        }
示例#2
0
文件: Marc.cs 项目: jasonzou/marcnet
        private void init()
        {
            _fields = new ArrayList();

            _dir = new MARCRecordDirectory();

            _ldr = null;

            _warning = new ArrayList();
        }
示例#3
0
文件: Marc.cs 项目: jasonzou/marcnet
 public void build_Leader()
 {
     if (_ldr == null)
     {
         _ldr = new MARCLeader(getRecordLength(), getBaseAddress());
     }
 }