Home / version_2011.03.17
Name Modified Size Downloads / Week Status
Parent folder
Totals: 2 Items   24.1 kB 2
ReadMe.txt 2011-03-17 1.9 kB 11 weekly downloads
FastMRCLib-bin-win32-2011.03.17.0.zip 2011-03-17 22.2 kB 11 weekly downloads
FastMRCLib is a small and simple library for reading and parsing MARC records (ISO-2709). This library uses STL and MD5Lib (which has been included) Algoritm based on MARC 21 Specifications for Record Structure: http://www.loc.gov/marc/specifications/specrecstruc.html Features: - read records from stream - read record ID from field 001 - build MD5 digest - iterate over all fields and subfields - get fields by specified tag - get control field data - get subfield data The main classes are: fastmrc::Record fastmrc::Field fastmrc::ControlField fastmrc::DataField fastmrc::Subfield fastmrc::FieldTag fastmrc::MrcException Changes ------- Version 2010.12.23 - initial version Version 2011.02.02 Added checking for out of record's buffer, which prevents fail if stream format is not well-formed. Version 2011.03.17 Added new methods to fastmrc::Record: const char* getData() const; unsigned getDatalen() const; to fastmrc::DataField: SubfieldListCIt getSubfield(char code, SubfieldListCIt _start); Made some small changes in interface. Example of using this library ----------------------------- #include "FastMRC.h" ifstream ifs("filename.mrc", ios::in|ios::binary); fastmrc::Record rec; int id; unsigned char digest[16]; while(ifs >> rec) { // get ID id = rec.getId(); // get MD5 rec.getMD5(digest); // parse record and get field CAT fastmrc::Record::FieldMapCIt it = rec.getFirstField("CAT"); if (it == rec.getFMapEnd()) printf("Warning! Field 'CAT' not found. rec id: %09d\n", id); else { f = it->second; if (!f->isControl()) { df = (fastmrc::DataField *) f; // parse datafield and get subfields fastmrc::DataField::SubfieldListCIt sfit = df->getSFListBegin(); if (sfit != df->getSFListEnd()) { // doing comething with subfields ... } } } }
Source: ReadMe.txt, updated 2011-03-17