Home / version_2011.02.02
Name Modified Size Downloads / Week Status
Parent folder
Totals: 2 Items   23.5 kB 2
ReadMe.txt 2011-02-02 1.7 kB 11 weekly downloads
FastMRCLib-bin-win32-2011.02.02.0.zip 2011-02-02 21.9 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. 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-02-02