Drizzled Public API Documentation

systab_httpheader_ms.h

00001 /* Copyright (C) 2009 PrimeBase Technologies GmbH, Germany
00002  *
00003  * PrimeBase Media Stream for MySQL
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00018  *
00019  * Barry Leslie
00020  *
00021  * System HTTP header storage table.
00022  *
00023  */
00024 
00025 #pragma once
00026 #ifndef __SYSTAB_HTTPHEADER_H__
00027 #define __SYSTAB_HTTPHEADER_H__
00028 
00029 #include "cslib/CSMutex.h"
00030 
00031 #include "defs_ms.h"
00032 #include "system_table_ms.h"
00033 #include "discover_ms.h"
00034 
00035 class SysTabRec;
00036 
00037 class MSHTTPHeaderTable : public MSOpenSystemTable {
00038 public:
00039   MSHTTPHeaderTable(MSSystemTableShare *share, TABLE *table);
00040   ~MSHTTPHeaderTable();
00041 
00042   void use();
00043   void unuse();
00044   void seqScanInit();
00045   bool seqScanNext(char *buf);
00046   int getRefLen() { return sizeof(iHeaderIndex);}
00047   void seqScanPos(unsigned char *pos);
00048   void seqScanRead(unsigned char *pos, char *buf);
00049 
00050   void  insertRow(char *buf);
00051   void  deleteRow(char *buf);
00052   void  updateRow(char *old_data, char *new_data);
00053   
00054   static void transferTable(MSDatabase *dst_db, MSDatabase *src_db);
00055   static void removeTable(CSString *db_path);
00056   static void saveTable(MSDatabase *db);
00057   static void loadTable(MSDatabase *db);
00058   
00059   static CSStringBuffer *dumpTable(MSDatabase *db);
00060   static void restoreTable(MSDatabase *db, const char *data, size_t size, bool reload = true);
00061   
00062   static void setDefaultMetaDataHeaders(const char *defaults);
00063   static void releaseDefaultMetaDataHeaders();
00064   
00065   static const uint8_t tableID = 0X02; // A unique id for the MSHTTPHeaderTable dump data
00066   static const uint16_t tableVersion = 0X0001; // The current version of the table
00067 
00068 private:
00069   static      SysTabRec *gDefaultMetaDataHeaders;
00070   uint32_t    iHeaderIndex;
00071   bool      iDirty;
00072 };
00073 
00074 #define METADATA_HEADER_NAME "pbms_metadata_header"
00075 
00076 extern DT_FIELD_INFO pbms_metadata_headers_info[];
00077 extern DT_KEY_INFO pbms_metadata_headers_keys[];
00078 
00079 
00080 #endif // __SYSTAB_HTTPHEADER_H__