Previous: WordReference ASCII FORMAT, Up: WordReference   [Contents][Index]


10.18.5 WordReference METHODS

WordReference(WordContext* ncontext) :

Constructor. Build an object with empty key and empty record. The ncontext argument must be a pointer to a valid WordContext object.

WordReference(WordContext* ncontext, const String& key0, const String& record0) :

Constructor. Build an object from disk representation of key and record . The ncontext argument must be a pointer to a valid WordContext object.

WordReference(WordContext* ncontext, const String& word) :

Constructor. Build an object with key word set to word and otherwise empty and empty record. The ncontext argument must be a pointer to a valid WordContext object.

void Clear()

Reset to empty key and record

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.

inline String& GetWord()

Return the word data member.

inline const String& GetWord() const

Return the word data member as a const.

inline void SetWord(const String& nword)

Set the word data member from the nword argument.

WordKey& Key()

Return the key object.

const WordKey& Key() const

Return the key object as const.

WordRecord& Record()

Return the record object.

const WordRecord& Record() const

Return the record object as const.

void Key(const WordKey& arg)

Copy arg in the key part of the object.

int KeyUnpack(const String& packed)

Set key structure from disk storage format as found in packed string. Return OK if successfull, NOTOK otherwise.

String KeyPack() const

Convert key object into disk storage format as found in return the resulting string.

int KeyPack(String& packed) const

Convert key object into disk storage format as found in and place the result in packed string. Return OK if successfull, NOTOK otherwise.

void Record(const WordRecord& arg)

Copy arg in the record part of the object.

int RecordUnpack(const String& packed)

Set record structure from disk storage format as found in packed string. Return OK if successfull, NOTOK otherwise.

String RecordPack() const

Convert record object into disk storage format as found in return the resulting string.

int RecordPack(String& packed) const

Convert record object into disk storage format as found in and place the result in packed string. Return OK if successfull, NOTOK otherwise.

inline int Pack(String& ckey, String& crecord) const

Short hand for KeyPack( ckey ) RecordPack( crecord ).

int Unpack(const String& ckey, const String& crecord)

Short hand for KeyUnpack( ckey ) RecordUnpack( crecord ).

int Merge(const WordReference& other)

Merge key with other.Key() using the WordKey::Merge method: key.Merge(other.Key()). See the corresponding manual page for details. Copy other.record into the record part of the object.

static WordReference Merge(const WordReference& master, const WordReference& slave)

Copy master before merging with master. Merge( slave ) and return the copy. Prevents alteration of master .

int Set(const String& bufferin)

Set the whole structure from ASCII string in bufferin . See ASCII FORMAT section. Return OK if successfull, NOTOK otherwise.

int Get(String& bufferout) const

Convert the whole structure to an ASCII string description in bufferout. See ASCII FORMAT section. Return OK if successfull, NOTOK otherwise.

String Get() const

Convert the whole structure to an ASCII string description and return it. See ASCII FORMAT section.

int Write(FILE* f) const

Print object in ASCII form on f (uses Get method). See ASCII FORMAT section.

void Print() const

Print object in ASCII form on stdout (uses Get method). See ASCII FORMAT section.


Previous: WordReference ASCII FORMAT, Up: WordReference   [Contents][Index]