1
#ifndef __SYSTAB_UTIL_H__
2
#define __SYSTAB_UTIL_H__
3
/* Copyright (c) 2009 PrimeBase Technologies GmbH, Germany
5
* PrimeBase Media Stream for MySQL
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
* Created by Barry Leslie on 3/20/09.
27
class SysTabRec: public CSRefStringBuffer {
28
void logError(const char *text = NULL);
34
uint32_t recordLength, start_of_record;
37
const char *db_name, *file_name, *table_name;
38
char *ptr, *end_of_record, *end_of_data;
40
SysTabRec(const char *db_name_arg, const char *file_name_arg, const char *table_name_arg):
41
CSRefStringBuffer(64),
43
file_name(file_name_arg),
44
table_name(table_name_arg),
53
// Methods used to read records
57
uint8_t getInt1Field();
58
uint32_t getInt4Field();
59
const char *getStringField();
63
return ((ptr == end_of_record) && !badRecord);
66
// Methods used to write records
70
void setInt1Field(uint8_t val);
71
void setInt4Field(uint32_t val);
72
void setStringField(const char *val);
73
void setStringField(const char *val, uint32_t len);
78
CSString *getPBMSPath(CSString *db_path);
79
CSPath *getSysFile(CSString *db_path, const char *name, size_t min_size);
81
#endif // __SYSTAB_UTIL_H__