|
CenGen - Генератор ценников
1.1
|
00001 #ifndef DBF_INFORMER_H 00002 #define DBF_INFORMER_H 00003 #include "dbf.h" 00004 #include <QFile> 00005 #include <QMap> 00006 #include <QTextCodec> 00007 #include "tovar.h" 00008 00009 class dbf_informer : public dbfHeader { 00010 00011 public: 00012 dbf_informer(); 00013 ~dbf_informer(); 00014 00015 struct dbf_one_field { 00016 int offset; 00017 int length; 00018 }; 00019 00020 QMap<QString, dbf_one_field> dbf_fields; //для понимания полей DBF-файла 00021 00022 00023 public slots: 00024 bool file_is_ready(); 00025 QStringList get_dbf_header(QString filename); 00026 QList<Tovar> found_record_in_dbf(QString searchText, QString method, int limit, 00027 int startPos = 0, int endPos = -1, 00028 bool FromStartToEnd = true); 00029 QList<Tovar> found_by_tnomer(int tnomer); 00030 int last_found_record(); 00031 00032 private slots: 00033 bool describe_dbf(); 00034 QString get_one_cell(int offset, int lenth); 00035 void read_file(int startPos, int endPos); 00036 00037 00038 private: 00039 QFile file; 00040 int file_read_start; 00041 int file_read_end; 00042 QTextCodec *codec; 00043 QTextEncoder *decoder; 00044 QTextDecoder *decodec; 00045 int last_record; 00046 bool first_time; 00047 QByteArray one_cell; 00048 00049 bool first_tnomer_search; 00050 int maximum_tnomer; 00051 int *offsets; 00052 00053 00054 }; 00055 00056 #endif // DBF_INFORMER_H