| **Navigation:**  [[abc library reference.htm|ABC Library Reference]] > FileManager > FileManager Methods >====== FileManager Functional Organization - Expected Use {{c6h0009.jpg|C6H0009.jpg}} ====== | [[naming conventions and dual approach to database operations.htm|{{btn_prev_n.gif|Previous page}}]][[abc library reference.htm|{{btn_home_n.gif|Return to chapter overview}}]][[addfield track fields in a structure .htm|{{btn_next_n.gif|Next page}}]] | | || As an aid to understanding the FileManager class, it is useful to organize the various FileManager methods into two large categories according to their expected use--the primary interface and the virtual methods. This organization reflects what we believe is typical use of the FileManager methods. **Non-Virtual Methods** The Non-Virtual Methods, which you are likely to call fairly routinely from your program, can be further divided into three categories: **Housekeeping (one-time) Use:** | | Init | initialize the FileManager object | | | Kill | terminate the FileManager object | **Mainstream Use:** | | Open (v) | open the file | | | TryOpen | open the file | | | Next | get the next record in sequence | | | TryNext | get the next record in sequence | | | Previous | get the previous record in sequence | | | TryPrevious | get the previous record in sequence | | | Fetch | get a specific record by key value | | | TryFetch | get a specific record by key value | | | Position | return the unique position of the current record | | | TryReget | get a specific record by unique position | | | PrimeAutoInc (v) | prepare an autoincremented record for adding | | | Insert | add a new record | | | TryInsert | add a new record | | | CancelAutoInc (v) | restore file to its pre-PrimeAutoInc state | | | Update | change the current record | | | TryUpdate | change the current record | | | Close (v) | close the file | (v)These methods are also Virtual. **Occasional Use:** | | ClearKey | clear a range of key component fields | | | SetKey | make a specific key current for other methods | | | KeyToOrder | return ORDER expression equal to specified key | | | GetComponents | return the number of components of a key | | | GetField | return a reference to a key component | | | GetFieldName | return the field name of a key component | | | GetEOF | return current end of file status | | | GetError | return the current error ID | | | SetError | save the current error state | | | GetName | return the name of the file | | | SetName | set the file name | | | SetOpenMode | set the file open mode | | | SaveBuffer | save the current record buffer contents | | | RestoreBuffer | restore previously saved buffer contents | | | SaveFile | save the current file state | | | RestoreFile | restore a previously saved file state | | | UseFile | open a LazyOpen file | | | AddKey | describe the soft KEYs | **Virtual Methods** Typically, with the possible exception of Open and Close, you will not call these methods directly--the Non-Virtual Methods call them. However, we anticipate you will often want to override these methods, and because they are virtual, they are very easy to override. These methods do provide reasonable default behavior in case you do not want to override them. | ** ** | Open | open the file | | ** ** | BindFields | BIND all the file's fields | | ** ** | PrimeAutoInc | prepare an autoincremented record for adding | | ** ** | TryPrimeAutoInc | prepare an autoincremented record for adding | | ** ** | CancelAutoInc | restore file to its pre-PrimeAutoInc state | | ** ** | EqualBuffer | detect record buffer changes | | ** ** | PrimeFields | prepare record fields for adding | | ** ** | PrimeRecord | prepare a record for adding | | ** ** | Throw | process an error | | ** ** | ThrowMessage | set custom message text then process an error | | ** ** | ValidateField | validate a specific field in the current buffer | | ** ** | ValidateFields | validate a range of fields in the current buffer | | ** ** | ValidateRecord | validate all fields in the current buffer | | ** ** | Close | close the file |