FreeBSD Manual Pages
WordRecord(3) Library Functions Manual WordRecord(3) NAME WordRecord - inverted index record. SYNOPSIS #include <WordRecord.h> WordContext* context; WordRecord* record = context->Record(); if(record->DefaultType() == WORD_RECORD_DATA) { record->info.data = 120; } else if(record->DefaultType() == WORD_RECORD_STR) { record->info.str = "foobar"; } delete record; DESCRIPTION The record can contain an integer, if the default record type (see CON- FIGURATION in WordKeyInfo ) is set to DATA or a string if set to STR. If the type is set to NONE the record does not contain any usable in- formation. Although constructors may be used, the prefered way to create a Wor- dRecord object is by using the WordContext::Record method. ASCII FORMAT If default type is DATA it is the decimal representation of an integer. If default type is NONE it is the empty string. METHODS inline WordRecord(WordContext* ncontext) Constructor. Build an empty record. The ncontext argument must be a pointer to a valid WordContext object. inline void Clear() Reset to empty and set the type to the default specified in the configuration. inline int DefaultType() Return the default type WORD_RECORD_{DATA,STR,NONE} inline int Pack(String& packed) const Convert the object to a representation for disk storage written in the packed string. Return OK on success, NOTOK otherwise. inline int Unpack(const char* string, int length) Alias for Unpack(String(string, length)) inline int Unpack(const String& packed) Read the object from a representation for disk storage contained in the packed argument. Return OK on success, NOTOK otherwise. int Set(const String& bufferin) Set the whole structure from ASCII string description stored in the bufferin argument. Return OK on success, NOTOK otherwise. int Get(String& bufferout) const Convert the whole structure to an ASCII string description and return it in the bufferout argument. Return OK on success, NO- TOK otherwise. String Get() const Convert the whole structure to an ASCII string description and return it. inline WordContext* GetContext() Return a pointer to the WordContext object used to create this instance. inline const WordContext* GetContext() const Return a pointer to the WordContext object used to create this instance as a const. int Write(FILE* f) const Print object in ASCII form on descriptor f using the Get method. AUTHORS Loic Dachary loic@gnu.org The Ht://Dig group http://dev.htdig.org/ SEE ALSO htdb_dump(1), htdb_stat(1), htdb_load(1), mifluzdump(1), mifluzload(1), mifluzsearch(1), mifluzdict(1), WordContext(3), WordList(3), Word- Dict(3), WordListOne(3), WordKey(3), WordKeyInfo(3), WordType(3), Word- DBInfo(3), WordRecordInfo(3), WordReference(3), WordCursor(3), WordCur- sorOne(3), WordMonitor(3), Configuration(3), mifluz(3) local WordRecord(3)
NAME | SYNOPSIS | DESCRIPTION | ASCII FORMAT | METHODS | AUTHORS | SEE ALSO
Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=WordRecord&sektion=3&manpath=FreeBSD+Ports+14.3.quarterly>
