Main Page · Modules · All Classes · Class Hierarchy
MSSessionStorageInterface.hpp
1 /*
2  * This file is part of the AiBO+ project
3  *
4  * Copyright (C) 2005-2016 Csaba Kertész (csaba.kertesz@gmail.com)
5  *
6  * AiBO+ is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * AiBO+ is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
19  *
20  */
21 
22 #pragma once
23 
29 #include <qobject.h>
30 #include <qstringlist.h>
31 
36 class MSSessionStorageInterface : public QObject
37 {
38  Q_OBJECT
39 
40 public:
41 
43  typedef enum
44  {
45  sd_Min = 0,
54 
55  static QStringList StorageDataTypeMsgs;
56 
59 
69  virtual QStringList GetSupportedTypes() = 0;
70 
82  virtual StorageDataType FindStorageType(const QString& type_name) = 0;
83 
98  virtual bool SaveBinaryDataToFile(const QString& file_name, const QString& output_type,
99  const StorageDataType& storage_type, void* output_data) = 0;
100 
115  virtual bool LoadBinaryDataFromFile(const QString& file_name, const QString& output_type,
116  const StorageDataType& storage_type, void* output_data) = 0;
117 
130  virtual QString ConvertDataToSqlString(const QString& type_name, void* output_data) = 0;
131 
145  virtual bool ConvertSqlStringToData(const QString& type_name, const QString& sql_str, void* output_data) = 0;
146 
154  virtual void Finalize() = 0;
155 };
156 
virtual ~MSSessionStorageInterface()
Class destructor.
Interface class to handle new types in the storage.
virtual bool SaveBinaryDataToFile(const QString &file_name, const QString &output_type, const StorageDataType &storage_type, void *output_data)=0
Save binary data to a file.
virtual bool ConvertSqlStringToData(const QString &type_name, const QString &sql_str, void *output_data)=0
Convert an Sql string to a data.
virtual StorageDataType FindStorageType(const QString &type_name)=0
Translate the type.
virtual QString ConvertDataToSqlString(const QString &type_name, void *output_data)=0
Convert the data to a string for an Sql insert.
virtual void Finalize()=0
Finalize the operations of the storage.
virtual QStringList GetSupportedTypes()=0
Get the list of the supported types.
virtual bool LoadBinaryDataFromFile(const QString &file_name, const QString &output_type, const StorageDataType &storage_type, void *output_data)=0
Load binary data from a file.