The IbycusIdtFile class provides an interface to PHI\TLG .IDT files which are indexes to their corresponding .TXT files. Like an IbycusTxtFile, each file contains 1 (or possibly more) authors, with 1 or more works divided into 1 or more sections. Each of these may be accessed by index number, which are 0-based. The first section of the first work of the first author is therefore at index 0, 0, 0.
When you create an IbycusTxtFile it creates its own IbycusIdtFile, and most of the methods of IbycusIdtFile can be accessed through equivalent IbycusTxtFile methods.
IbycusIdtFile()
IbycusIdtFile(const ibystring_t & id, const ibystring_t & vol)
void Open(const ibystring_t & id, const ibystring_t & vol)
int Count(const int auth = -1, const int work = -1)
const ibystring_t & Name(const int auth = 0, const int work = -1)
const IbycusId & Id(const int auth = 0, const int work = -1, const int sect = -1)
const IbycusId & Start(const int auth = 0, const int work = 0, const int sect = 0)
const IbycusId & End(const int auth = 0, const int work = -1, const int sect = -1)
ibylen_t Block(const int auth = 0, const int work = 0, const int sect = 0, const IbycusId & id = IbycusId()) throw(IbycusNoId)
int Span(const int auth = 0, const int work = 0, const int sect = 0)
int tellg()
int CiteLevels(int auth=0, int work=0)
Default constructor. Constructs an empty IbycusIdtFile
id | The author ID of the file to be opened |
vol | The directory where the file exists |
Creates an IbycusIdtFile, given an author ID (e.g., LAT0500, TLG1010) and a directory. Note that id is not the filename and must not have the .IDT extension.
id | The author ID of the file to be opened |
vol | The directory where the file exists |
Opens a .IDT file. Can be called after IbycusIdtFile(), but it is better to use IbycusIdtFile(id, vol) in the first place. Throws an IbycusFileException if the file cannot be opened
auth | The index of the desired author (default: 0) |
work | The index of the desired work (default: -1) |
Returns the number of works in the author auth, or the number of sections in the work auth, work. See IbycusTxtFile.Count().
auth | The index of the desired author (default: 0) |
work | The index of the desired work (default: -1) |
Returns the name of the author with the index auth, or of the work auth, work.See IbycusTxtFile.Name().
auth | The index of the desired author (default: 0) |
work | The index of the desired work (default: -1) |
sect | The index of the desired section (default: -1) |
Returns the ID of the author with the index auth, work with the index auth, work, or section with the index auth, work, sect.
IbycusIdtFile idt("LAT0960", "D:\"); // Your directory may be different cout << idt.Id() << "\n"; cout << idt.Id(0,0) << "\n";
The output of this would be:
0960 0960.001
auth | The index of the desired author (default: 0) |
work | The index of the desired work (default: 0) |
sect | The index of the desired section (default: 0) |
Returns the start ID of the author with the index auth, work with the index auth, work, or section with the index auth, work, sect.
auth | The index of the desired author (default: 0) |
work | The index of the desired work (default: -1) |
sect | The index of the desired section (default: -1) |
Returns the end ID of the author with the index auth, work with the index auth, work, or section with the index auth, work, sect.
auth | The index of the desired author (default: 0) |
work | The index of the desired work (default: 0) |
sect | The index of the desired section (default: 0) |
id | The ID to be found |
Returns the block of the corresponding .TXT file that contains the author with the index auth, work with the index auth, work, section with the index auth, work, sect or section with the index auth, work, sect and the ID ID. Throws an IbycusNoId if the ID is supplied but cannot be found.
auth | The index of the desired author (default: 0) |
work | The index of the desired work (default: 0) |
sect | The index of the desired section (default: 0) |
Returns the number of blocks spanned by the author with the index auth, work with the index auth, work, or section with the index auth, work
.Returns the current position of the file pointer in the .IDT file
auth | The index of the desired author (default: 0) |
work | The index of the desired work (default: 0) |
Returns the number of citation levels required to describe the work with the index auth, work.