Quick Guide to OOFILE Basic Commands

Back to index


Note: assume the following are methods applied to dbTable subclasses except where noted as applying to dbField subclasses.

SORTING

setSortOrder(field)
setSortOrder(dbSorter)
setReverseSortOrder(field)
suspendSorting()
resumeSorting()
unsorted()
dbSorter << field >> field
OR
dbSorter << field << reversed(field);

SEARCHING

search(tuple condition)
searchSelection(tuple condition)
searchSelContainsAllDelimited(field, string, char)
searchSelContainsAllOf(field, array, count)
searchSelContainsAnyDelimited(field, string, char)
searchSelContainsAnyOf(field, array, count)
* - multiple character wildcard
? - single character wildcard

simple single search tuples

field == value

field != value

field < value

field <= value

field > value

field >= value

field.equal(value)

field.notEqual(value)

field.lessThan(value)

field.lessThanOrEqual(value)

field.greaterThan(value)

field.greaterThanOrEqual(value)

field.between(value1, value2)

field.outside(value1, value2)

char field.startsWith(value)

char field == wildcard expression

dbChar and dbText fields can be keyword searched with the following operations, eg:
table->search(table->field.hasWord("bah"));

You can also directly apply the operators to the table, which means all keyword indexes for that table are searched, eg:
table->search(table->hasWord("bah"));

hasWord(const char* str);

hasAnyWordsDelimited(const char*, char delimiter);

hasAllWordsDelimited(const char*, char delimiter);

hasAnyWordsOf(const char **schStrs, unsigned long count);

hasAllWordsOf(const char **schStrs, unsigned long count);

hasWordStartsWith(const char* str);

hasAnyWordsStartsWithDelimited(const char*, char delimiter);

hasAllWordsStartsWithDelimited(const char*, char delimiter);

hasAnyWordsStartsWithOf(const char **schStrs, unsigned long count);

hasAllWordsStartsWithOf(const char **schStrs, unsigned long count);

 

combining search tuples

tuple || tuple

tuple && tuple

tuple | tuple

tuple & tuple


MANAGING SELECTIONS

changing the selection

selectAll()
selectNone()
selectJustRecord(number)
selectJustCurrent()
currentOID() // to get an oidT that can be used to refer to a single record
selectJustOID(oidT)
currentSelection() // return just the selection, not a full dbTable clone

addOIDtoSelection(oidT)
dropRecordFromSelection(record number)

combining selections

table1.difference_with(table2)

table1 %= table2

table1 -= table2

table1.union_with(table2)

table1 |= table2

table1 += table2

table1.intersection_with(table2)

table1 &= table2

table.invert()

~table

!table

iterating over selections

start()
next()
prev()
more()
atFirst()
atLast()
atRelative()
recordNumber() // to get temporary number representing current position
gotoRecord(number in sorted order)
unloadRecord()

measuring selections

count()
countAll()
isEmpty()
contains(oidT)


EDITING DATA

newRecord()
field = expression
saveRecord()
deleteRecord()
deleteSelection()
deleteAll()

TAB-DELIMITED DATA EXCHANGE

ostream << table

table.extract(ostream)

ostream << view

view.extract(ostream)

istream >> table


Back to index


(c) Copyright A.D. Software 1994-1997 (All Rights Reserved).
Last Updated: 8th March 1997