villa 9871e8d6a4 Modifiche memo; sistemata TPrintrow::put() per gestione @t tabulazione
git-svn-id: svn://10.65.10.50/trunk@1472 c028cbd2-c16b-5b4b-a496-9718f37d4682
1995-06-13 08:23:45 +00:00

46 lines
1.2 KiB
C++
Executable File

#ifndef __MEMO_H
#define __MEMO_H
#ifndef __TEXT_H
#include <text.h>
#endif
// quick and dirty memofile class
// to be used with isamfiles
// memo field is a long integer, memo file is <isamname>.mem
class TMemo_file : public TObject
{
bool _dirty;
FILE* _fp;
long _current;
TFilename _fname;
bool _isnew;
long _id_max;
long _next_ofs;
bool _find_id(long id);
public:
// retrieves text with specified ID (or last one passed);
// returns TRUE if successful
bool get_field(TTextfile& t, long id = -1l);
// sets field to specified text; if not present
// returns new ID; if error returns -1, otherwise 0
long set_field(TTextfile& t, long id = -1l);
// removes field and pakkettates file
bool remove_field(long id);
// calls editor to edit text (specified as mem into config)
bool edit_field(long id = -1l);
// returns the maximum ID used (<= n. of fields in file)
long max_id() const { return _id_max; }
// must be passed the basename of archive
TMemo_file(const char* archive);
~TMemo_file();
};
#endif