2
#ifndef __SYSTAB_UTIL_H__
3
#define __SYSTAB_UTIL_H__
4
/* Copyright (C) 2009 PrimeBase Technologies GmbH, Germany
6
* PrimeBase Media Stream for MySQL
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* (at your option) any later version.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
* Created by Barry Leslie on 3/20/09.
26
#include "cslib/CSLog.h"
29
class SysTabRec: public CSRefStringBuffer {
30
void logError(const char *text = NULL);
36
uint32_t recordLength, start_of_record;
39
const char *db_name, *file_name, *table_name;
40
char *ptr, *end_of_record, *end_of_data;
42
SysTabRec(const char *db_name_arg, const char *file_name_arg, const char *table_name_arg):
43
CSRefStringBuffer(64),
48
file_name(file_name_arg),
49
table_name(table_name_arg),
56
// Methods used to read records
61
uint8_t getInt1Field();
62
uint32_t getInt4Field();
63
const char *getStringField();
67
return ((ptr == end_of_record) && !badRecord);
70
// Methods used to write records
74
void setInt1Field(uint8_t val);
75
void setInt4Field(uint32_t val);
76
void setStringField(const char *val);
77
void setStringField(const char *val, uint32_t len);
82
CSString *getPBMSPath(CSString *db_path);
83
CSPath *getSysFile(CSString *db_path, const char *name, size_t min_size);
85
#endif // __SYSTAB_UTIL_H__