34 lines
631 B
C
34 lines
631 B
C
|
|
#ifndef PGSQL_VALUE_H
|
|||
|
|
#define PGSQL_VALUE_H
|
|||
|
|
|
|||
|
|
#include "Pgsql_declare.h"
|
|||
|
|
#include <QString>
|
|||
|
|
#include <QDateTime>
|
|||
|
|
|
|||
|
|
namespace Pgsql {
|
|||
|
|
|
|||
|
|
/** \brief Class that is returned as value of a cell to facilitate auto conversion.
|
|||
|
|
*/
|
|||
|
|
class Value {
|
|||
|
|
public:
|
|||
|
|
Value(const char *val, Oid typ);
|
|||
|
|
QString asQString() const;
|
|||
|
|
operator QString() const;
|
|||
|
|
operator QDateTime() const;
|
|||
|
|
operator std::string() const;
|
|||
|
|
operator short() const;
|
|||
|
|
operator int() const;
|
|||
|
|
operator Oid() const;
|
|||
|
|
operator __int64() const;
|
|||
|
|
operator bool() const;
|
|||
|
|
|
|||
|
|
private:
|
|||
|
|
const char *m_val;
|
|||
|
|
Oid m_typ;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
|
|||
|
|
} // end namespace Pgsql
|
|||
|
|
|
|||
|
|
#endif // PGSQL_VALUE_H
|